mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-07-03 07:08:27 +00:00
Compare commits
33 Commits
2026.06.10
...
2026.06.24
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ee0126259 | ||
|
|
e23ecf36d6 | ||
|
|
32dc3d6bdf | ||
|
|
f76adc5054 | ||
|
|
95b583606d | ||
|
|
693b805114 | ||
|
|
5ebc50d36a | ||
|
|
d1fe541b62 | ||
|
|
71e3f2e44d | ||
|
|
4891aa401a | ||
|
|
a6d59c0dc1 | ||
|
|
ac54bde383 | ||
|
|
dfe7810346 | ||
|
|
82894176d9 | ||
|
|
87b3035eda | ||
|
|
a89b53504c | ||
|
|
91a6266d50 | ||
|
|
469751f8e8 | ||
|
|
908274a500 | ||
|
|
6e4a616f1c | ||
|
|
535b62db40 | ||
|
|
c039b04717 | ||
|
|
a7a46bb5bf | ||
|
|
a95b5adee8 | ||
|
|
2b97021341 | ||
|
|
1235306f80 | ||
|
|
1a69d19f30 | ||
|
|
5628f6e0b7 | ||
|
|
6f349b4992 | ||
|
|
2193591448 | ||
|
|
e9269c5501 | ||
|
|
fdac0a6d14 | ||
|
|
2aa9afaa2c |
61
.github/CONTRIBUTING.md
vendored
61
.github/CONTRIBUTING.md
vendored
@@ -1,6 +1,7 @@
|
|||||||
# How to Contribute?
|
# How to Contribute?
|
||||||
|
|
||||||
We welcome contributions from the community. You can contribute to Win11Debloat by:
|
We welcome contributions from the community. You can contribute to Win11Debloat by:
|
||||||
|
|
||||||
- Reporting issues and bugs [here](https://github.com/Raphire/Win11Debloat/issues/new?template=bug_report.yml)
|
- Reporting issues and bugs [here](https://github.com/Raphire/Win11Debloat/issues/new?template=bug_report.yml)
|
||||||
- Submitting feature requests [here](https://github.com/Raphire/Win11Debloat/issues/new?template=feature_request.yml)
|
- Submitting feature requests [here](https://github.com/Raphire/Win11Debloat/issues/new?template=feature_request.yml)
|
||||||
- Testing Win11Debloat
|
- Testing Win11Debloat
|
||||||
@@ -15,6 +16,7 @@ You can help us test the latest changes and additions to the script. If you enco
|
|||||||
> The prerelease version of Win11Debloat is meant for developers to test the script. Don't use this in production environments!
|
> The prerelease version of Win11Debloat is meant for developers to test the script. Don't use this in production environments!
|
||||||
|
|
||||||
You can launch the prerelease version of Win11Debloat by running this command:
|
You can launch the prerelease version of Win11Debloat by running this command:
|
||||||
|
|
||||||
```ps1
|
```ps1
|
||||||
& ([scriptblock]::Create((irm "https://debloat.raphi.re/dev")))
|
& ([scriptblock]::Create((irm "https://debloat.raphi.re/dev")))
|
||||||
```
|
```
|
||||||
@@ -28,12 +30,14 @@ You can launch the prerelease version of Win11Debloat by running this command:
|
|||||||
1. **Fork the project** on GitHub by clicking the "Fork" button at the top right of the repository page.
|
1. **Fork the project** on GitHub by clicking the "Fork" button at the top right of the repository page.
|
||||||
|
|
||||||
2. **Clone the repository** to your local machine:
|
2. **Clone the repository** to your local machine:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
git clone https://github.com/YOUR-USERNAME/Win11Debloat.git
|
git clone https://github.com/YOUR-USERNAME/Win11Debloat.git
|
||||||
cd Win11Debloat
|
cd Win11Debloat
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **Create a new branch** for your contribution:
|
3. **Create a new branch** for your contribution:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
git checkout -b feature/your-feature-name
|
git checkout -b feature/your-feature-name
|
||||||
```
|
```
|
||||||
@@ -42,11 +46,14 @@ You can launch the prerelease version of Win11Debloat by running this command:
|
|||||||
|
|
||||||
1. Open PowerShell as an administrator
|
1. Open PowerShell as an administrator
|
||||||
2. Enable script execution if necessary:
|
2. Enable script execution if necessary:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
Set-ExecutionPolicy Unrestricted -Scope Process -Force
|
Set-ExecutionPolicy Unrestricted -Scope Process -Force
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Navigate to your Win11Debloat directory
|
3. Navigate to your Win11Debloat directory
|
||||||
4. Run the script:
|
4. Run the script:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
.\Win11Debloat.ps1
|
.\Win11Debloat.ps1
|
||||||
```
|
```
|
||||||
@@ -57,18 +64,31 @@ You can launch the prerelease version of Win11Debloat by running this command:
|
|||||||
|
|
||||||
Understanding the project structure is essential for contributing effectively:
|
Understanding the project structure is essential for contributing effectively:
|
||||||
|
|
||||||
```
|
```text
|
||||||
Win11Debloat/
|
Win11Debloat/
|
||||||
├── Win11Debloat.ps1 # Main PowerShell script
|
├── Win11Debloat.ps1 # Main PowerShell script
|
||||||
|
├── Run.bat # Batch launcher for the quick launch method
|
||||||
├── Scripts/ # Additional PowerShell scripts and functions
|
├── Scripts/ # Additional PowerShell scripts and functions
|
||||||
│ └── Get.ps1 # Script used for the quick launch method to automatically download and run Win11debloat
|
│ ├── Get.ps1 # Script used for the quick launch method to automatically download and run Win11debloat
|
||||||
|
│ ├── AppRemoval/ # App package removal logic
|
||||||
|
│ ├── CLI/ # Command-line interface helpers
|
||||||
|
│ ├── Features/ # Feature apply/undo logic (e.g. InvokeChanges.ps1, ReplaceStartMenu.ps1)
|
||||||
|
│ ├── FileIO/ # File input/output helpers
|
||||||
|
│ ├── GUI/ # GUI window definitions and logic
|
||||||
|
│ ├── Helpers/ # Shared helper functions
|
||||||
|
│ └── Threading/ # Threading utilities
|
||||||
├── Config/
|
├── Config/
|
||||||
│ ├── Apps.json # List of supported apps for removal
|
│ ├── Apps.json # List of supported apps for removal
|
||||||
│ ├── DefaultSettings.json # Default configuration preset
|
│ ├── DefaultSettings.json # Default configuration preset
|
||||||
│ ├── Features.json # All features with metadata
|
│ ├── Features.json # All features with metadata
|
||||||
│ └── LastUsedSettings.json # Last used configuration (generated during use)
|
│ └── LastUsedSettings.json # Last used configuration (generated during use)
|
||||||
├── Regfiles/ # Registry files for all features
|
├── Regfiles/ # Registry files for all features
|
||||||
└── Schemas/ # XAML Schemas for GUI elements
|
│ ├── Undo/ # Registry files for reverting features
|
||||||
|
│ └── Sysprep/ # Registry files for Sysprep mode
|
||||||
|
├── Schemas/ # XAML Schemas for GUI elements
|
||||||
|
├── Assets/ # Static assets (icons, start menu templates)
|
||||||
|
├── Backups/ # Registry backups (generated during use)
|
||||||
|
└── Logs/ # Script logs (generated during use)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Best Practices
|
### Best Practices
|
||||||
@@ -109,9 +129,9 @@ Avoid these common mistakes when contributing:
|
|||||||
|
|
||||||
Placing files in the wrong directory may cause the script to fail when trying to apply or undo changes.
|
Placing files in the wrong directory may cause the script to fail when trying to apply or undo changes.
|
||||||
|
|
||||||
6. **Not Testing Undo Functionality**: Always test that your undo registry file properly reverts all changes.
|
5. **Not Testing Undo Functionality**: Always test that your undo registry file properly reverts all changes.
|
||||||
|
|
||||||
7. **Not Testing User/Sysprep Functionality**: Always test that your feature works when applied to another user or to the Windows default user with Sysprep. Sysprep changes can be tested by creating new users after running the script.
|
6. **Not Testing User/Sysprep Functionality**: Always test that your feature works when applied to another user or to the Windows default user with Sysprep. Sysprep changes can be tested by creating new users after running the script.
|
||||||
|
|
||||||
7. **Missing Category**: Features without a `Category` field (set to `null`) won't appear in the GUI. This is intentional for command-line-only features, make sure this is what you want before submitting.
|
7. **Missing Category**: Features without a `Category` field (set to `null`) won't appear in the GUI. This is intentional for command-line-only features, make sure this is what you want before submitting.
|
||||||
|
|
||||||
@@ -127,11 +147,13 @@ Avoid these common mistakes when contributing:
|
|||||||
To add a new app that can be removed via Win11Debloat:
|
To add a new app that can be removed via Win11Debloat:
|
||||||
|
|
||||||
1. **Find the AppId**: To find the correct AppId for an app:
|
1. **Find the AppId**: To find the correct AppId for an app:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
Get-AppxPackage | Select-Object Name, PackageFullName
|
Get-AppxPackage | Select-Object Name, PackageFullName
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Edit `Config/Apps.json`**: Add a new entry to the `"Apps"` array:
|
2. **Edit `Config/Apps.json`**: Add a new entry to the `"Apps"` array:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"FriendlyName": "Display Name",
|
"FriendlyName": "Display Name",
|
||||||
@@ -142,9 +164,10 @@ To add a new app that can be removed via Win11Debloat:
|
|||||||
```
|
```
|
||||||
|
|
||||||
3. **Follow the Guidelines**:
|
3. **Follow the Guidelines**:
|
||||||
- Use clear, user-friendly names for `FriendlyName`
|
|
||||||
- Set `SelectedByDefault` to `true` only for apps that are largely considered bloatware, otherwise set to `false`
|
- Use clear, user-friendly names for `FriendlyName`
|
||||||
- Provide a concise description explaining what the app does
|
- Set `SelectedByDefault` to `true` only for apps that are largely considered bloatware, otherwise set to `false`
|
||||||
|
- Provide a concise description explaining what the app does
|
||||||
|
|
||||||
### Adding a New Feature
|
### Adding a New Feature
|
||||||
|
|
||||||
@@ -162,6 +185,7 @@ Create new registry files in the `Regfiles/` directory:
|
|||||||
- **Sysprep file**: `Sysprep/Disable_YourFeature.reg` (for Sysprep mode)
|
- **Sysprep file**: `Sysprep/Disable_YourFeature.reg` (for Sysprep mode)
|
||||||
|
|
||||||
Example registry file structure:
|
Example registry file structure:
|
||||||
|
|
||||||
```reg
|
```reg
|
||||||
Windows Registry Editor Version 5.00
|
Windows Registry Editor Version 5.00
|
||||||
|
|
||||||
@@ -170,6 +194,7 @@ Windows Registry Editor Version 5.00
|
|||||||
```
|
```
|
||||||
|
|
||||||
A Sysprep registry file should apply the same changes as the normal action. Replace the hive of registry keys that start with `HKEY_CURRENT_USER` with `hkey_users\default`. For example:
|
A Sysprep registry file should apply the same changes as the normal action. Replace the hive of registry keys that start with `HKEY_CURRENT_USER` with `hkey_users\default`. For example:
|
||||||
|
|
||||||
```reg
|
```reg
|
||||||
Windows Registry Editor Version 5.00
|
Windows Registry Editor Version 5.00
|
||||||
|
|
||||||
@@ -179,7 +204,7 @@ Windows Registry Editor Version 5.00
|
|||||||
|
|
||||||
#### 1b. Implement the Feature Logic
|
#### 1b. Implement the Feature Logic
|
||||||
|
|
||||||
If your feature requires more than just applying a registry file, add custom logic to the main script in the appropriate section. In most cases this will involve creating a new entry in the `ExecuteParameter` function for your new feature.
|
If your feature requires more than just applying a registry file, add custom logic to the main script in the appropriate section. In most cases this will involve creating a new entry in the `Invoke-FeatureApply` function (in `Scripts/Features/InvokeChanges.ps1`) for your new feature. If your feature also requires custom undo logic (beyond a simple registry file import), add a corresponding entry to the `Invoke-FeatureUndo` function in the same file.
|
||||||
|
|
||||||
#### 2. Add Feature to Features.json
|
#### 2. Add Feature to Features.json
|
||||||
|
|
||||||
@@ -192,18 +217,20 @@ Add your feature to the `"Features"` array in `Config/Features.json`:
|
|||||||
"ToolTip": "Detailed explanation of what this feature does and its impact.",
|
"ToolTip": "Detailed explanation of what this feature does and its impact.",
|
||||||
"Category": "Privacy & Suggested Content",
|
"Category": "Privacy & Suggested Content",
|
||||||
"Priority": 1,
|
"Priority": 1,
|
||||||
"Action": "Disable",
|
|
||||||
"RegistryKey": "Disable_YourFeature.reg",
|
"RegistryKey": "Disable_YourFeature.reg",
|
||||||
"ApplyText": "Disabling your feature...",
|
"ApplyText": "Disabling your feature",
|
||||||
"UndoAction": "Enable",
|
"UndoLabel": "Short description for the undo",
|
||||||
|
"ApplyUndoText": "Enabling your feature",
|
||||||
"RegistryUndoKey": "Enable_YourFeature.reg",
|
"RegistryUndoKey": "Enable_YourFeature.reg",
|
||||||
"RequiresReboot": false,
|
"RequiresReboot": false,
|
||||||
|
"DisableWhenApplied": false,
|
||||||
"MinVersion": null,
|
"MinVersion": null,
|
||||||
"MaxVersion": null
|
"MaxVersion": null
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**Field Descriptions**:
|
**Field Descriptions**:
|
||||||
|
|
||||||
- `FeatureId`: Unique identifier, this must match parameter name in the Win11Debloat.ps1 and Get.ps1 files.
|
- `FeatureId`: Unique identifier, this must match parameter name in the Win11Debloat.ps1 and Get.ps1 files.
|
||||||
- `Label`: Short description shown in the UI and wiki documentation.
|
- `Label`: Short description shown in the UI and wiki documentation.
|
||||||
- `ToolTip`: Detailed explanation of what the feature does, used for tooltips in the GUI.
|
- `ToolTip`: Detailed explanation of what the feature does, used for tooltips in the GUI.
|
||||||
@@ -222,6 +249,7 @@ Add your feature to the `"Features"` array in `Config/Features.json`:
|
|||||||
#### 3. Add Command-Line Parameter
|
#### 3. Add Command-Line Parameter
|
||||||
|
|
||||||
Add a corresponding parameter to both `Win11Debloat.ps1` AND `Scripts/Get.ps1`, the parameter name should match the FeatureId you have defined in `Features.json`. In most cases this will be a switch parameter, example:
|
Add a corresponding parameter to both `Win11Debloat.ps1` AND `Scripts/Get.ps1`, the parameter name should match the FeatureId you have defined in `Features.json`. In most cases this will be a switch parameter, example:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
[switch]$YourFeatureId,
|
[switch]$YourFeatureId,
|
||||||
```
|
```
|
||||||
@@ -234,12 +262,14 @@ Add a corresponding parameter to both `Win11Debloat.ps1` AND `Scripts/Get.ps1`,
|
|||||||
The default preset (`Config/DefaultSettings.json`) defines which features are automatically applied when users run Win11Debloat in "Default Mode" or with the `-RunDefaults` parameter. This preset should include features that are widely considered to improve the Windows experience without breaking functionality.
|
The default preset (`Config/DefaultSettings.json`) defines which features are automatically applied when users run Win11Debloat in "Default Mode" or with the `-RunDefaults` parameter. This preset should include features that are widely considered to improve the Windows experience without breaking functionality.
|
||||||
|
|
||||||
**When to add a feature to the default preset:**
|
**When to add a feature to the default preset:**
|
||||||
|
|
||||||
- The feature removes obvious bloatware or distractions
|
- The feature removes obvious bloatware or distractions
|
||||||
- The feature enhances privacy without breaking core functionality
|
- The feature enhances privacy without breaking core functionality
|
||||||
- The feature is generally non-controversial and beneficial to most users
|
- The feature is generally non-controversial and beneficial to most users
|
||||||
- The change can be easily reverted if needed
|
- The change can be easily reverted if needed
|
||||||
|
|
||||||
**When NOT to add a feature to the default preset:**
|
**When NOT to add a feature to the default preset:**
|
||||||
|
|
||||||
- The feature significantly changes core Windows behavior
|
- The feature significantly changes core Windows behavior
|
||||||
- The feature might break applications or workflows for some users
|
- The feature might break applications or workflows for some users
|
||||||
- The feature is highly opinionated or preference-based
|
- The feature is highly opinionated or preference-based
|
||||||
@@ -255,10 +285,12 @@ To add your feature to the default preset, edit `Config/DefaultSettings.json` an
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Field Descriptions**:
|
**Field Descriptions**:
|
||||||
|
|
||||||
- `Name`: Must exactly match the `FeatureId` from Features.json
|
- `Name`: Must exactly match the `FeatureId` from Features.json
|
||||||
- `Value`: Set to `true` to enable the feature in default mode
|
- `Value`: Set to `true` to enable the feature in default mode
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"Version": "1.0",
|
"Version": "1.0",
|
||||||
@@ -284,6 +316,7 @@ To add your feature to the default preset, edit `Config/DefaultSettings.json` an
|
|||||||
To add a new category for organizing features:
|
To add a new category for organizing features:
|
||||||
|
|
||||||
- Add a new category entry to the `"Categories"` array in `Config/Features.json`:
|
- Add a new category entry to the `"Categories"` array in `Config/Features.json`:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"Name": "Your Category Name",
|
"Name": "Your Category Name",
|
||||||
@@ -321,17 +354,20 @@ UI Groups allow features to be grouped together in the GUI with a combobox (drop
|
|||||||
## Submitting a Pull Request
|
## Submitting a Pull Request
|
||||||
|
|
||||||
1. **Commit your changes** with clear, descriptive commit messages:
|
1. **Commit your changes** with clear, descriptive commit messages:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Add feature: Description of your changes"
|
git commit -m "Add feature: Description of your changes"
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Push to your fork**:
|
2. **Push to your fork**:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
git push origin feature/your-feature-name
|
git push origin feature/your-feature-name
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **Create a Pull Request** on GitHub:
|
3. **Create a Pull Request** on GitHub:
|
||||||
|
|
||||||
- Go to the original Win11Debloat repository
|
- Go to the original Win11Debloat repository
|
||||||
- Click "New Pull Request"
|
- Click "New Pull Request"
|
||||||
- Select your fork and branch
|
- Select your fork and branch
|
||||||
@@ -343,6 +379,7 @@ UI Groups allow features to be grouped together in the GUI with a combobox (drop
|
|||||||
# Questions?
|
# Questions?
|
||||||
|
|
||||||
If you have questions about contributing, feel free to:
|
If you have questions about contributing, feel free to:
|
||||||
|
|
||||||
- Open a [discussion](https://github.com/Raphire/Win11Debloat/discussions)
|
- Open a [discussion](https://github.com/Raphire/Win11Debloat/discussions)
|
||||||
- Comment on an existing issue
|
- Comment on an existing issue
|
||||||
- Ask in your pull request
|
- Ask in your pull request
|
||||||
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
name: "🐞 Bug report"
|
name: "🐞 Bug report"
|
||||||
description: "Report an issue you encountered"
|
description: "Report an issue you encountered"
|
||||||
labels: ["bug"]
|
labels: ["bug", "unconfirmed"]
|
||||||
|
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,7 +1,3 @@
|
|||||||
LastSettings
|
|
||||||
SavedSettings
|
|
||||||
LastUsedSettings.json
|
LastUsedSettings.json
|
||||||
CustomAppsList
|
|
||||||
Logs/*
|
Logs/*
|
||||||
Win11Debloat.log
|
|
||||||
Backups/*
|
Backups/*
|
||||||
495
Config/Apps.json
495
Config/Apps.json
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -35,7 +35,7 @@
|
|||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Message Text -->
|
<!-- Message Text -->
|
||||||
<Grid Grid.Row="0" Margin="20,4,20,20">
|
<Grid Grid.Row="0" Margin="20,4,20,16">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
@@ -79,15 +79,15 @@
|
|||||||
<!-- Separator -->
|
<!-- Separator -->
|
||||||
<Border Grid.Row="1"
|
<Border Grid.Row="1"
|
||||||
Height="1"
|
Height="1"
|
||||||
Background="{DynamicResource BorderColor}"
|
Background="{DynamicResource AppBorderColor}"
|
||||||
Margin="20,0"/>
|
Margin="20,0"/>
|
||||||
|
|
||||||
<!-- Content -->
|
<!-- Content -->
|
||||||
<StackPanel Grid.Row="2" Margin="20,18,20,20">
|
<StackPanel Grid.Row="2" Margin="20,16,20,16">
|
||||||
<!-- Donation Message -->
|
<!-- Donation Message -->
|
||||||
<TextBlock Text="Win11Debloat is a passion project that I maintain in my free time. If you've found this tool useful, please consider making a small donation to support its development. I really appreciate it!"
|
<TextBlock Text="Win11Debloat is a passion project that I maintain in my free time. If you've found this tool useful, please consider making a small donation to support its development. I really appreciate it!"
|
||||||
FontSize="14"
|
FontSize="14"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Margin="0,0,0,15"/>
|
Margin="0,0,0,15"/>
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
FontFamily="Segoe Fluent Icons"
|
FontFamily="Segoe Fluent Icons"
|
||||||
Text=""
|
Text=""
|
||||||
Foreground="{DynamicResource CloseHover}"
|
Foreground="{DynamicResource TitleBarCloseHoverColor}"
|
||||||
Margin="0,0,8,0"/>
|
Margin="0,0,8,0"/>
|
||||||
|
|
||||||
<TextBlock x:Name="KofiLink"
|
<TextBlock x:Name="KofiLink"
|
||||||
@@ -124,11 +124,17 @@
|
|||||||
|
|
||||||
<!-- Button Panel -->
|
<!-- Button Panel -->
|
||||||
<Border Grid.Row="2" Style="{DynamicResource ModalFooterBorderStyle}">
|
<Border Grid.Row="2" Style="{DynamicResource ModalFooterBorderStyle}">
|
||||||
<StackPanel x:Name="ButtonPanel" Style="{DynamicResource ModalFooterButtonsRightStyle}">
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button x:Name="CloseButton"
|
<Button x:Name="CloseButton"
|
||||||
|
Grid.Column="1"
|
||||||
Content="Close"
|
Content="Close"
|
||||||
Style="{DynamicResource ModalSecondaryActionButtonStyle}"/>
|
Style="{DynamicResource ModalSecondaryStretchedButtonStyle}"/>
|
||||||
</StackPanel>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
AllowsTransparency="True"
|
AllowsTransparency="True"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
Foreground="{DynamicResource FgColor}">
|
Foreground="{DynamicResource AppFgColor}">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<!-- Title Bar Button Style -->
|
<!-- Title Bar Button Style -->
|
||||||
<Style x:Key="TitleBarButton" TargetType="Button">
|
<Style x:Key="TitleBarButton" TargetType="Button">
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="BorderThickness" Value="0"/>
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
<Setter Property="Width" Value="46"/>
|
<Setter Property="Width" Value="46"/>
|
||||||
<Setter Property="Height" Value="32"/>
|
<Setter Property="Height" Value="32"/>
|
||||||
@@ -31,17 +31,17 @@
|
|||||||
<Style x:Key="CloseButton" TargetType="Button" BasedOn="{StaticResource TitleBarButton}">
|
<Style x:Key="CloseButton" TargetType="Button" BasedOn="{StaticResource TitleBarButton}">
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource CloseHover}"/>
|
<Setter Property="Background" Value="{DynamicResource TitleBarCloseHoverColor}"/>
|
||||||
<Setter Property="Foreground" Value="White"/>
|
<Setter Property="Foreground" Value="White"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
<Border BorderBrush="{DynamicResource BorderColor}"
|
<Border BorderBrush="{DynamicResource AppBorderColor}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
CornerRadius="8"
|
CornerRadius="8"
|
||||||
Background="{DynamicResource BgColor}"
|
Background="{DynamicResource AppBgColor}"
|
||||||
Margin="25">
|
Margin="25">
|
||||||
<Border.Effect>
|
<Border.Effect>
|
||||||
<DropShadowEffect Color="Black"
|
<DropShadowEffect Color="Black"
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
<!-- Custom Title Bar -->
|
<!-- Custom Title Bar -->
|
||||||
<Grid Grid.Row="0" x:Name="TitleBar">
|
<Grid Grid.Row="0" x:Name="TitleBar">
|
||||||
<Border Background="{DynamicResource BgColor}" CornerRadius="8,8,0,0">
|
<Border Background="{DynamicResource AppBgColor}" CornerRadius="8,8,0,0">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Column="0"
|
<TextBlock Grid.Column="0"
|
||||||
Text="Win11Debloat Application Selection"
|
Text="Win11Debloat Application Selection"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Margin="12,0,0,0"
|
Margin="12,0,0,0"
|
||||||
FontSize="12"/>
|
FontSize="12"/>
|
||||||
@@ -90,27 +90,27 @@
|
|||||||
<TextBlock Grid.Row="0"
|
<TextBlock Grid.Row="0"
|
||||||
Text="Check apps that you wish to remove, uncheck apps that you wish to keep"
|
Text="Check apps that you wish to remove, uncheck apps that you wish to keep"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
Margin="0,0,0,10"/>
|
Margin="0,0,0,10"/>
|
||||||
|
|
||||||
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,8">
|
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,8">
|
||||||
<CheckBox x:Name="CheckAllBox" Content="Check/Uncheck all" Margin="8,0,15,0" Foreground="{DynamicResource FgColor}" AutomationProperties.Name="Check or Uncheck all"/>
|
<CheckBox x:Name="CheckAllBox" Content="Check/Uncheck all" Margin="8,0,15,0" Foreground="{DynamicResource AppFgColor}" AutomationProperties.Name="Check or Uncheck all"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<Border Grid.Row="2" BorderBrush="{DynamicResource BorderColor}" CornerRadius="4" BorderThickness="1" Margin="0,0,0,10" Background="{DynamicResource CardBgColor}">
|
<Border Grid.Row="2" BorderBrush="{DynamicResource AppBorderColor}" CornerRadius="4" BorderThickness="1" Margin="0,0,0,10" Background="{DynamicResource CardBgColor}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<StackPanel x:Name="AppsPanel" Margin="5"/>
|
<StackPanel x:Name="AppsPanel" Margin="5"/>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
<Border x:Name="LoadingAppsIndicator" CornerRadius="4" Background="{DynamicResource ScrollBarThumbColor}" Opacity="0.8" Visibility="Collapsed">
|
<Border x:Name="LoadingAppsIndicator" CornerRadius="4" Background="{DynamicResource ScrollBarThumbColor}" Opacity="0.8" Visibility="Collapsed">
|
||||||
<TextBlock Text="Loading apps..." FontSize="16" FontWeight="SemiBold" Foreground="{DynamicResource FgColor}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
<TextBlock Text="Loading apps..." FontSize="16" FontWeight="SemiBold" Foreground="{DynamicResource AppFgColor}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
<Grid Margin="0,8,10,10">
|
<Grid Margin="0,8,10,10">
|
||||||
<CheckBox x:Name="OnlyInstalledBox" Content="Only show installed apps" Foreground="{DynamicResource FgColor}" AutomationProperties.Name="Only show installed apps"/>
|
<CheckBox x:Name="OnlyInstalledBox" Content="Only show installed apps" Foreground="{DynamicResource AppFgColor}" AutomationProperties.Name="Only show installed apps"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Button x:Name="ConfirmBtn" Width="80" Height="32" Margin="0,0,10,0" Content="Confirm" Style="{DynamicResource PrimaryButtonStyle}" AutomationProperties.Name="Confirm"/>
|
<Button x:Name="ConfirmBtn" Width="80" Height="32" Margin="0,0,10,0" Content="Confirm" Style="{DynamicResource PrimaryButtonStyle}" AutomationProperties.Name="Confirm"/>
|
||||||
<Button x:Name="CancelBtn" Width="80" Height="32" Content="Cancel" Style="{DynamicResource SecondaryButtonStyle}" IsCancel="True" AutomationProperties.Name="Cancel"/>
|
<Button x:Name="CancelBtn" Width="80" Height="32" Content="Cancel" Style="{DynamicResource SecondaryButtonStyle}" IsCancel="True" AutomationProperties.Name="Cancel"/>
|
||||||
|
|||||||
@@ -36,10 +36,10 @@
|
|||||||
<Button.Style>
|
<Button.Style>
|
||||||
<Style TargetType="Button">
|
<Style TargetType="Button">
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource CloseHover}"/>
|
<Setter Property="Background" Value="{DynamicResource TitleBarCloseHoverColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
Text=""
|
Text=""
|
||||||
FontFamily="Segoe Fluent Icons"
|
FontFamily="Segoe Fluent Icons"
|
||||||
FontSize="36"
|
FontSize="36"
|
||||||
Foreground="{DynamicResource ButtonBg}"
|
Foreground="{DynamicResource ButtonBgColor}"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Margin="0,0,0,16"
|
Margin="0,0,0,16"
|
||||||
RenderTransformOrigin="0.5,0.5">
|
RenderTransformOrigin="0.5,0.5">
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
<TextBlock x:Name="ApplyStepCounter"
|
<TextBlock x:Name="ApplyStepCounter"
|
||||||
Text="Step 0 of 0"
|
Text="Step 0 of 0"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Opacity="0.8"/>
|
Opacity="0.8"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
Text=""
|
Text=""
|
||||||
FontFamily="Segoe Fluent Icons"
|
FontFamily="Segoe Fluent Icons"
|
||||||
FontSize="40"
|
FontSize="40"
|
||||||
Foreground="{DynamicResource ButtonBg}"
|
Foreground="{DynamicResource ButtonBgColor}"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Margin="0,0,0,12"/>
|
Margin="0,0,0,12"/>
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
<!-- Reboot required section -->
|
<!-- Reboot required section -->
|
||||||
<Border x:Name="ApplyRebootPanel"
|
<Border x:Name="ApplyRebootPanel"
|
||||||
Visibility="Collapsed"
|
Visibility="Collapsed"
|
||||||
BorderBrush="{DynamicResource BorderColor}"
|
BorderBrush="{DynamicResource AppBorderColor}"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
BorderThickness="0,1,0,1"
|
BorderThickness="0,1,0,1"
|
||||||
Padding="24,12,24,14">
|
Padding="24,12,24,14">
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
<TextBlock Text="A reboot is required for these changes to take effect:"
|
<TextBlock Text="A reboot is required for these changes to take effect:"
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
VerticalAlignment="Center"/>
|
VerticalAlignment="Center"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel x:Name="ApplyRebootList" Margin="22,0,0,0"/>
|
<StackPanel x:Name="ApplyRebootList" Margin="22,0,0,0"/>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
Text="View the selected changes here"
|
Text="View the selected changes here"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
MaxWidth="260"
|
MaxWidth="260"
|
||||||
Foreground="{DynamicResource FgColor}"/>
|
Foreground="{DynamicResource AppFgColor}"/>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@@ -29,12 +29,12 @@
|
|||||||
|
|
||||||
<!-- Content -->
|
<!-- Content -->
|
||||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" Padding="0,0,8,0">
|
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" Padding="0,0,8,0">
|
||||||
<StackPanel x:Name="ContentPanel" Margin="20,4,20,8">
|
<StackPanel x:Name="ContentPanel" Margin="20,4">
|
||||||
<TextBlock x:Name="PromptText"
|
<TextBlock x:Name="PromptText"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
FontSize="14"
|
FontSize="14"
|
||||||
LineHeight="20"
|
LineHeight="20"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
Margin="0,0,0,14"/>
|
Margin="0,0,0,14"/>
|
||||||
<!-- Checkboxes are added dynamically at runtime -->
|
<!-- Checkboxes are added dynamically at runtime -->
|
||||||
<StackPanel x:Name="CheckboxPanel"/>
|
<StackPanel x:Name="CheckboxPanel"/>
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework"
|
xmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework"
|
||||||
Title="Win11Debloat"
|
Title="Win11Debloat"
|
||||||
MinWidth="860" MinHeight="600"
|
MinWidth="860" MinHeight="640"
|
||||||
ResizeMode="CanResize"
|
ResizeMode="CanResize"
|
||||||
SnapsToDevicePixels="True"
|
SnapsToDevicePixels="True"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
AllowsTransparency="False"
|
AllowsTransparency="False"
|
||||||
Background="{DynamicResource BgColor}"
|
Background="{DynamicResource AppBorderColor}"
|
||||||
Foreground="{DynamicResource FgColor}">
|
Foreground="{DynamicResource AppFgColor}">
|
||||||
<shell:WindowChrome.WindowChrome>
|
<shell:WindowChrome.WindowChrome>
|
||||||
<shell:WindowChrome ResizeBorderThickness="5"
|
<shell:WindowChrome ResizeBorderThickness="5"
|
||||||
CaptionHeight="32"
|
CaptionHeight="32"
|
||||||
@@ -30,8 +30,8 @@
|
|||||||
</Style>
|
</Style>
|
||||||
<!-- TextBlock Label Style -->
|
<!-- TextBlock Label Style -->
|
||||||
<Style x:Key="LabelStyle" TargetType="TextBlock">
|
<Style x:Key="LabelStyle" TargetType="TextBlock">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="FontSize" Value="12"/>
|
<Setter Property="FontSize" Value="13"/>
|
||||||
<Setter Property="Margin" Value="0,0,0,2"/>
|
<Setter Property="Margin" Value="0,0,0,2"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
@@ -46,28 +46,30 @@
|
|||||||
|
|
||||||
<!-- Category card border style -->
|
<!-- Category card border style -->
|
||||||
<Style x:Key="CategoryCardBorderStyle" TargetType="Border">
|
<Style x:Key="CategoryCardBorderStyle" TargetType="Border">
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderColor}"/>
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
<Setter Property="CornerRadius" Value="4"/>
|
<Setter Property="CornerRadius" Value="4"/>
|
||||||
<Setter Property="Background" Value="{DynamicResource CardBgColor}"/>
|
<Setter Property="Background" Value="{DynamicResource CardBgColor}"/>
|
||||||
<Setter Property="Padding" Value="16,12,16,2"/>
|
<Setter Property="Padding" Value="16,13,16,4"/>
|
||||||
<Setter Property="Margin" Value="0,0,0,16"/>
|
<Setter Property="Margin" Value="0,0,0,16"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- Category header text style -->
|
<!-- Category header text style -->
|
||||||
<Style x:Key="CategoryHeaderTextBlock" TargetType="TextBlock">
|
<Style x:Key="CategoryHeaderTextBlock" TargetType="TextBlock">
|
||||||
<Setter Property="FontWeight" Value="Bold"/>
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||||
<Setter Property="FontSize" Value="16"/>
|
<Setter Property="FontSize" Value="18"/>
|
||||||
<Setter Property="Margin" Value="0,0,0,12"/>
|
<Setter Property="LineHeight" Value="20"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Margin" Value="0,0,0,16"/>
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- Category header icon style -->
|
<!-- Category header icon style -->
|
||||||
<Style x:Key="CategoryHeaderIcon" TargetType="TextBlock">
|
<Style x:Key="CategoryHeaderIcon" TargetType="TextBlock">
|
||||||
<Setter Property="FontFamily" Value="Segoe Fluent Icons"/>
|
<Setter Property="FontFamily" Value="Segoe Fluent Icons"/>
|
||||||
<Setter Property="FontSize" Value="19"/>
|
<Setter Property="FontSize" Value="20"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="LineHeight" Value="20"/>
|
||||||
<Setter Property="Margin" Value="0,0,8,12"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
|
<Setter Property="Margin" Value="0,0,8,16"/>
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
@@ -83,7 +85,7 @@
|
|||||||
<Setter Property="IsTabStop" Value="False"/>
|
<Setter Property="IsTabStop" Value="False"/>
|
||||||
<Setter Property="Cursor" Value="Hand"/>
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ButtonBg}"/>
|
<Setter Property="Foreground" Value="{DynamicResource ButtonBgColor}"/>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="Button">
|
<ControlTemplate TargetType="Button">
|
||||||
@@ -95,17 +97,18 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ButtonHover}"/>
|
<Setter Property="Foreground" Value="{DynamicResource ButtonHoverColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsPressed" Value="True">
|
<Trigger Property="IsPressed" Value="True">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ButtonPressed}"/>
|
<Setter Property="Foreground" Value="{DynamicResource ButtonPressedColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="CategoryHelpLinkTextStyle" TargetType="TextBlock">
|
<Style x:Key="CategoryHelpLinkTextStyle" TargetType="TextBlock">
|
||||||
<Setter Property="FontSize" Value="12"/>
|
<Setter Property="FontSize" Value="14"/>
|
||||||
<Setter Property="FontWeight" Value="Bold"/>
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||||
|
<Setter Property="Margin" Value="0,0,0,5"/>
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
<Setter Property="Foreground">
|
<Setter Property="Foreground">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
@@ -116,14 +119,14 @@
|
|||||||
|
|
||||||
<!-- Overview changes text style -->
|
<!-- Overview changes text style -->
|
||||||
<Style x:Key="OverviewNoChangesTextStyle" TargetType="TextBlock">
|
<Style x:Key="OverviewNoChangesTextStyle" TargetType="TextBlock">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="Margin" Value="0,0,0,8"/>
|
<Setter Property="Margin" Value="0,0,0,8"/>
|
||||||
<Setter Property="FontSize" Value="12"/>
|
<Setter Property="FontSize" Value="12"/>
|
||||||
<Setter Property="FontStyle" Value="Italic"/>
|
<Setter Property="FontStyle" Value="Italic"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="OverviewChangeBulletStyle" TargetType="TextBlock">
|
<Style x:Key="OverviewChangeBulletStyle" TargetType="TextBlock">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="Margin" Value="0,0,0,8"/>
|
<Setter Property="Margin" Value="0,0,0,8"/>
|
||||||
<Setter Property="FontSize" Value="12"/>
|
<Setter Property="FontSize" Value="12"/>
|
||||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||||
@@ -131,45 +134,7 @@
|
|||||||
|
|
||||||
<!-- TextBox Style for search -->
|
<!-- TextBox Style for search -->
|
||||||
<Style TargetType="TextBox">
|
<Style TargetType="TextBox">
|
||||||
<Setter Property="CaretBrush" Value="{DynamicResource FgColor}"/>
|
<Setter Property="CaretBrush" Value="{DynamicResource AppFgColor}"/>
|
||||||
</Style>
|
|
||||||
|
|
||||||
<!-- User TextBox Style with disabled state -->
|
|
||||||
<Style x:Key="UserTextBoxStyle" TargetType="TextBox">
|
|
||||||
<Setter Property="CaretBrush" Value="{DynamicResource FgColor}"/>
|
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
|
||||||
<Setter Property="BorderThickness" Value="0"/>
|
|
||||||
<Setter Property="FontSize" Value="13"/>
|
|
||||||
<Setter Property="Margin" Value="1,0,0,1"/>
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
||||||
<Setter Property="Padding" Value="0"/>
|
|
||||||
<Style.Triggers>
|
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
|
|
||||||
<Setter Property="Opacity" Value="0.6"/>
|
|
||||||
</Trigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<!-- User TextBox Border Style with disabled state -->
|
|
||||||
<Style x:Key="UserTextBoxBorderStyle" TargetType="Border">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource ComboBgColor}"/>
|
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
|
||||||
<Setter Property="CornerRadius" Value="4"/>
|
|
||||||
<Setter Property="Padding" Value="8,6"/>
|
|
||||||
<Style.Triggers>
|
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
|
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
|
|
||||||
<Setter Property="Opacity" Value="0.6"/>
|
|
||||||
</Trigger>
|
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource ComboHoverColor}"/>
|
|
||||||
</Trigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- TextBlock style for App ID column in apps table -->
|
<!-- TextBlock style for App ID column in apps table -->
|
||||||
@@ -194,7 +159,7 @@
|
|||||||
|
|
||||||
<!-- Column widths for the app table rows and header (dot | name | description | id) -->
|
<!-- Column widths for the app table rows and header (dot | name | description | id) -->
|
||||||
<GridLength x:Key="AppTableDotColWidth">16</GridLength>
|
<GridLength x:Key="AppTableDotColWidth">16</GridLength>
|
||||||
<GridLength x:Key="AppTableNameColWidth">151</GridLength>
|
<GridLength x:Key="AppTableNameColWidth">180</GridLength>
|
||||||
<GridLength x:Key="AppTableDescColWidth">1*</GridLength>
|
<GridLength x:Key="AppTableDescColWidth">1*</GridLength>
|
||||||
<GridLength x:Key="AppTableIdColWidth">261</GridLength>
|
<GridLength x:Key="AppTableIdColWidth">261</GridLength>
|
||||||
|
|
||||||
@@ -219,10 +184,15 @@
|
|||||||
<SolidColorBrush x:Key="ValidationErrorColor" Color="#c42b1c"/>
|
<SolidColorBrush x:Key="ValidationErrorColor" Color="#c42b1c"/>
|
||||||
<SolidColorBrush x:Key="ValidationSuccessColor" Color="#28a745"/>
|
<SolidColorBrush x:Key="ValidationSuccessColor" Color="#28a745"/>
|
||||||
|
|
||||||
|
<!-- App recommendation dot / legend colors -->
|
||||||
|
<SolidColorBrush x:Key="AppRecommendationSafeColor" Color="#4CAF50"/>
|
||||||
|
<SolidColorBrush x:Key="AppRecommendationOptionalColor" Color="#FFC107"/>
|
||||||
|
<SolidColorBrush x:Key="AppRecommendationUnsafeColor" Color="#F44336"/>
|
||||||
|
|
||||||
<!-- Title Bar Button Style -->
|
<!-- Title Bar Button Style -->
|
||||||
<Style x:Key="TitleBarButton" TargetType="Button">
|
<Style x:Key="TitleBarButton" TargetType="Button">
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="BorderThickness" Value="0"/>
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
<Setter Property="Width" Value="46"/>
|
<Setter Property="Width" Value="46"/>
|
||||||
<Setter Property="Height" Value="32"/>
|
<Setter Property="Height" Value="32"/>
|
||||||
@@ -237,11 +207,21 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource AncestorType=Window}}" Value="False">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource TitleBarUnfocusedFgColor}"/>
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="CloseButton" TargetType="Button" BasedOn="{StaticResource TitleBarButton}">
|
<Style x:Key="CloseButton" TargetType="Button" BasedOn="{StaticResource TitleBarButton}">
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource CloseHover}"/>
|
<Setter Property="Background" Value="{DynamicResource TitleBarCloseHoverColor}"/>
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsPressed" Value="True">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource TitleBarClosePressedColor}"/>
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -257,25 +237,12 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource TitlebarButtonHover}"/>
|
<Setter Property="Background" Value="{DynamicResource TitleBarButtonHoverColor}"/>
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsPressed" Value="True">
|
<Trigger Property="IsPressed" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource TitlebarButtonPressed}"/>
|
<Setter Property="Background" Value="{DynamicResource TitleBarButtonPressedColor}"/>
|
||||||
</Trigger>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<!-- SearchBox Border Style -->
|
|
||||||
<Style x:Key="SearchBoxBorderStyle" TargetType="Border">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource ComboBgColor}"/>
|
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
|
||||||
<Setter Property="CornerRadius" Value="4"/>
|
|
||||||
<Setter Property="Width" Value="300"/>
|
|
||||||
<Setter Property="Padding" Value="8,6"/>
|
|
||||||
<Style.Triggers>
|
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource ComboHoverColor}"/>
|
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -283,7 +250,7 @@
|
|||||||
<!-- ContextMenu Style -->
|
<!-- ContextMenu Style -->
|
||||||
<Style TargetType="ContextMenu">
|
<Style TargetType="ContextMenu">
|
||||||
<Setter Property="Background" Value="{DynamicResource CardBgColor}"/>
|
<Setter Property="Background" Value="{DynamicResource CardBgColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderColor}"/>
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
<Setter Property="Padding" Value="4"/>
|
<Setter Property="Padding" Value="4"/>
|
||||||
<Setter Property="HasDropShadow" Value="True"/>
|
<Setter Property="HasDropShadow" Value="True"/>
|
||||||
@@ -311,7 +278,7 @@
|
|||||||
|
|
||||||
<!-- MenuItem Style -->
|
<!-- MenuItem Style -->
|
||||||
<Style TargetType="MenuItem">
|
<Style TargetType="MenuItem">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
<Setter Property="Padding" Value="8,6"/>
|
<Setter Property="Padding" Value="8,6"/>
|
||||||
<Setter Property="Height" Value="32"/>
|
<Setter Property="Height" Value="32"/>
|
||||||
@@ -337,10 +304,10 @@
|
|||||||
</Border>
|
</Border>
|
||||||
<ControlTemplate.Triggers>
|
<ControlTemplate.Triggers>
|
||||||
<Trigger Property="IsHighlighted" Value="True">
|
<Trigger Property="IsHighlighted" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource ComboItemHoverColor}"/>
|
<Setter Property="Background" Value="{DynamicResource ComboBoxItemHoverColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsPressed" Value="True">
|
<Trigger Property="IsPressed" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource ComboItemSelectedColor}"/>
|
<Setter Property="Background" Value="{DynamicResource ComboBoxItemSelectedColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
@@ -349,10 +316,10 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
<Border x:Name="MainBorder" BorderBrush="{DynamicResource BorderColor}"
|
<Border x:Name="MainBorder" BorderBrush="{DynamicResource AppBorderColor}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
CornerRadius="8"
|
CornerRadius="8"
|
||||||
Background="{DynamicResource BgColor}"
|
Background="{DynamicResource AppBgColor}"
|
||||||
Margin="0">
|
Margin="0">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@@ -372,7 +339,7 @@
|
|||||||
|
|
||||||
<!-- Custom Title Bar -->
|
<!-- Custom Title Bar -->
|
||||||
<Grid Grid.Row="0" x:Name="TitleBar">
|
<Grid Grid.Row="0" x:Name="TitleBar">
|
||||||
<Border x:Name="TitleBarBackground" Background="{DynamicResource BgColor}" CornerRadius="8,8,0,0">
|
<Border x:Name="TitleBarBackground" Background="{DynamicResource AppBgColor}" CornerRadius="8,8,0,0">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
@@ -380,10 +347,20 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Column="0"
|
<TextBlock Grid.Column="0"
|
||||||
Text="Win11Debloat"
|
Text="Win11Debloat"
|
||||||
Foreground="{DynamicResource FgColor}"
|
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Margin="12,0,0,0"
|
Margin="12,0,0,0"
|
||||||
FontSize="12"/>
|
FontSize="12">
|
||||||
|
<TextBlock.Style>
|
||||||
|
<Style TargetType="TextBlock">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource AncestorType=Window}}" Value="False">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource TitleBarUnfocusedFgColor}"/>
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</TextBlock.Style>
|
||||||
|
</TextBlock>
|
||||||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||||
<Button x:Name="KofiBtn" shell:WindowChrome.IsHitTestVisibleInChrome="True" Content="" FontFamily="Segoe Fluent Icons" FontSize="15" Style="{StaticResource TitlebarButton}" ToolTip="Support the creator" AutomationProperties.Name="Support the creator"/>
|
<Button x:Name="KofiBtn" shell:WindowChrome.IsHitTestVisibleInChrome="True" Content="" FontFamily="Segoe Fluent Icons" FontSize="15" Style="{StaticResource TitlebarButton}" ToolTip="Support the creator" AutomationProperties.Name="Support the creator"/>
|
||||||
<Button x:Name="MenuBtn" shell:WindowChrome.IsHitTestVisibleInChrome="True" Content="" FontFamily="Segoe Fluent Icons" FontSize="15" Style="{StaticResource TitlebarButton}" ToolTip="Options" AutomationProperties.Name="Options">
|
<Button x:Name="MenuBtn" shell:WindowChrome.IsHitTestVisibleInChrome="True" Content="" FontFamily="Segoe Fluent Icons" FontSize="15" Style="{StaticResource TitlebarButton}" ToolTip="Options" AutomationProperties.Name="Options">
|
||||||
@@ -395,7 +372,7 @@
|
|||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="Separator">
|
<ControlTemplate TargetType="Separator">
|
||||||
<Border Height="1" Background="{DynamicResource BorderColor}" SnapsToDevicePixels="True" HorizontalAlignment="Stretch"/>
|
<Border Height="1" Background="{DynamicResource AppBorderColor}" SnapsToDevicePixels="True" HorizontalAlignment="Stretch"/>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
@@ -403,38 +380,38 @@
|
|||||||
</ContextMenu.Resources>
|
</ContextMenu.Resources>
|
||||||
<MenuItem x:Name="ImportConfigBtn" Header="Import config" AutomationProperties.Name="Import configuration">
|
<MenuItem x:Name="ImportConfigBtn" Header="Import config" AutomationProperties.Name="Import configuration">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource AppFgColor}"/>
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem x:Name="ExportConfigBtn" Header="Export config" AutomationProperties.Name="Export configuration">
|
<MenuItem x:Name="ExportConfigBtn" Header="Export config" AutomationProperties.Name="Export configuration">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource AppFgColor}"/>
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem x:Name="RestoreBackupBtn" Header="Restore backup" AutomationProperties.Name="Restore registry backup">
|
<MenuItem x:Name="RestoreBackupBtn" Header="Restore backup" AutomationProperties.Name="Restore registry backup">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource AppFgColor}"/>
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem x:Name="MenuDocumentation" Header="Documentation" AutomationProperties.Name="Documentation">
|
<MenuItem x:Name="MenuDocumentation" Header="Documentation" AutomationProperties.Name="Documentation">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<TextBlock Text="" FontFamily="Segoe MDL2 Assets" FontSize="16" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock Text="" FontFamily="Segoe MDL2 Assets" FontSize="16" Foreground="{DynamicResource AppFgColor}"/>
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem x:Name="MenuReportBug" Header="Report a bug" AutomationProperties.Name="Report a bug">
|
<MenuItem x:Name="MenuReportBug" Header="Report a bug" AutomationProperties.Name="Report a bug">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource AppFgColor}"/>
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem x:Name="MenuLogs" Header="Logs" AutomationProperties.Name="Logs">
|
<MenuItem x:Name="MenuLogs" Header="Logs" AutomationProperties.Name="Logs">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource AppFgColor}"/>
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem x:Name="MenuAbout" Header="About" AutomationProperties.Name="About">
|
<MenuItem x:Name="MenuAbout" Header="About" AutomationProperties.Name="About">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="16" Foreground="{DynamicResource AppFgColor}"/>
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
@@ -459,16 +436,16 @@
|
|||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="TabItem">
|
<ControlTemplate TargetType="TabItem">
|
||||||
<Border Name="Border" Background="{DynamicResource SecondaryButtonBg}" BorderThickness="0" CornerRadius="0" Padding="10,10" Margin="0">
|
<Border Name="Border" Background="{DynamicResource SecondaryButtonBgColor}" BorderThickness="0" CornerRadius="0" Padding="10,10" Margin="0">
|
||||||
<ContentPresenter ContentSource="Header" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
<ContentPresenter ContentSource="Header" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||||
</Border>
|
</Border>
|
||||||
<ControlTemplate.Triggers>
|
<ControlTemplate.Triggers>
|
||||||
<Trigger Property="IsSelected" Value="True">
|
<Trigger Property="IsSelected" Value="True">
|
||||||
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ButtonBg}"/>
|
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ButtonBgColor}"/>
|
||||||
<Setter Property="Foreground" Value="White"/>
|
<Setter Property="Foreground" Value="White"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsSelected" Value="False">
|
<Trigger Property="IsSelected" Value="False">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
@@ -487,30 +464,30 @@
|
|||||||
<Grid>
|
<Grid>
|
||||||
<StackPanel x:Name="HomeContentPanel" HorizontalAlignment="Center" VerticalAlignment="Top">
|
<StackPanel x:Name="HomeContentPanel" HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||||
<!-- Logo -->
|
<!-- Logo -->
|
||||||
<Viewbox Width="250" Height="250" Margin="0,0,0,10" HorizontalAlignment="Center">
|
<Viewbox Width="250" Height="250" Margin="0,0,0,16" HorizontalAlignment="Center">
|
||||||
<Grid Width="250" Height="250">
|
<Grid Width="250" Height="250">
|
||||||
<!-- Windows logo style icon -->
|
<!-- Windows logo style icon -->
|
||||||
<Path x:Name="LogoFallback" Data="M0,0 L80,0 L80,80 L0,80 Z M90,0 L170,0 L170,80 L90,80 Z M0,90 L80,90 L80,170 L0,170 Z M90,90 L170,90 L170,170 L90,170 Z"
|
<Path x:Name="LogoFallback" Data="M0,0 L80,0 L80,80 L0,80 Z M90,0 L170,0 L170,80 L90,80 Z M0,90 L80,90 L80,170 L0,170 Z M90,90 L170,90 L170,170 L90,170 Z"
|
||||||
Fill="{DynamicResource ButtonBg}" Stretch="Uniform" Margin="10"/>
|
Fill="{DynamicResource ButtonBgColor}" Stretch="Uniform" Margin="10"/>
|
||||||
<!-- Sparkle effects -->
|
<!-- Sparkle effects -->
|
||||||
<Canvas HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="50" Height="50" Margin="0,0,2,2">
|
<Canvas HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="50" Height="50" Margin="0,0,2,2">
|
||||||
<Path Canvas.Left="10" Canvas.Top="16" Data="M12,0 L14,10 L24,12 L14,14 L12,24 L10,14 L0,12 L10,10 Z"
|
<Path Canvas.Left="10" Canvas.Top="16" Data="M12,0 L14,10 L24,12 L14,14 L12,24 L10,14 L0,12 L10,10 Z"
|
||||||
Fill="{DynamicResource AccentColor}" Width="40" Height="40" Stretch="Uniform"/>
|
Fill="{DynamicResource AppAccentColor}" Width="40" Height="40" Stretch="Uniform"/>
|
||||||
<Path Canvas.Left="0" Canvas.Top="0" Data="M6,0 L7,5 L12,6 L7,7 L6,12 L5,7 L0,6 L5,5 Z"
|
<Path Canvas.Left="0" Canvas.Top="0" Data="M6,0 L7,5 L12,6 L7,7 L6,12 L5,7 L0,6 L5,5 Z"
|
||||||
Fill="{DynamicResource AccentColor}" Width="22" Height="22" Stretch="Uniform"/>
|
Fill="{DynamicResource AppAccentColor}" Width="22" Height="22" Stretch="Uniform"/>
|
||||||
<Path Canvas.Left="35" Canvas.Top="8" Data="M4,0 L5,3 L8,4 L5,5 L4,8 L3,5 L0,4 L3,3 Z"
|
<Path Canvas.Left="35" Canvas.Top="8" Data="M4,0 L5,3 L8,4 L5,5 L4,8 L3,5 L0,4 L3,3 Z"
|
||||||
Fill="{DynamicResource AccentColor}" Width="17" Height="17" Stretch="Uniform"/>
|
Fill="{DynamicResource AppAccentColor}" Width="17" Height="17" Stretch="Uniform"/>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
|
|
||||||
<!-- Title -->
|
<!-- Title -->
|
||||||
<TextBlock Text="Welcome to Win11Debloat" FontSize="30" FontWeight="Bold" Foreground="{DynamicResource FgColor}" HorizontalAlignment="Center" Margin="0,0,0,10"/>
|
<TextBlock Text="Welcome to Win11Debloat" FontSize="40" FontWeight="SemiBold" Foreground="{DynamicResource AppFgColor}" HorizontalAlignment="Center"/>
|
||||||
<TextBlock TextWrapping="Wrap" Foreground="{DynamicResource FgColor}" FontSize="18" LineHeight="22" HorizontalAlignment="Center" Margin="0,0,0,60">
|
<TextBlock TextWrapping="Wrap" Foreground="{DynamicResource AppFgColor}" FontSize="20" HorizontalAlignment="Center" Margin="0,4,0,48">
|
||||||
<Run Text="Your clean Windows experience is just a few clicks away!"/>
|
<Run Text="Your clean Windows experience is just a few clicks away!"/>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
<Border HorizontalAlignment="Center" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Width="500">
|
<Border HorizontalAlignment="Center" BorderBrush="{DynamicResource AppBorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Width="500">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="What user do you want to apply changes to?" Style="{StaticResource CategoryHeaderTextBlock}"/>
|
<TextBlock Text="What user do you want to apply changes to?" Style="{StaticResource CategoryHeaderTextBlock}"/>
|
||||||
<ComboBox x:Name="UserSelectionCombo" Margin="0,0,0,6" AutomationProperties.Name="Apply Changes To">
|
<ComboBox x:Name="UserSelectionCombo" Margin="0,0,0,6" AutomationProperties.Name="Apply Changes To">
|
||||||
@@ -519,32 +496,25 @@
|
|||||||
<ComboBoxItem Content="Windows Default User (Sysprep)"/>
|
<ComboBoxItem Content="Windows Default User (Sysprep)"/>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
<StackPanel x:Name="OtherUserPanel" Visibility="Collapsed" Margin="0,0,0,6">
|
<StackPanel x:Name="OtherUserPanel" Visibility="Collapsed" Margin="0,0,0,6">
|
||||||
<TextBlock x:Name="UsernameValidationMessage" Text="" FontStyle="Italic" Foreground="{DynamicResource CloseHover}" FontSize="11" Margin="3,0,0,4" TextWrapping="Wrap"/>
|
<TextBlock x:Name="UsernameValidationMessage" Text="" FontStyle="Italic" Foreground="{DynamicResource TitleBarCloseHoverColor}" FontSize="11" Margin="3,0,0,4" TextWrapping="Wrap"/>
|
||||||
<Border IsEnabled="{Binding ElementName=OtherUsernameTextBox, Path=IsEnabled}">
|
<Border Style="{DynamicResource TextBoxBorderStyle}">
|
||||||
<Border.Style>
|
<Border Style="{DynamicResource TextBoxBottomBorderStyle}">
|
||||||
<Style TargetType="Border" BasedOn="{StaticResource UserTextBoxBorderStyle}">
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding ElementName=OtherUsernameTextBox, Path=IsFocused}" Value="True">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource InputFocusColor}"/>
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</Border.Style>
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Column="0" Text="" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock x:Name="UsernameTextBoxPlaceholder" Grid.Column="0" Text="Enter username" Foreground="{DynamicResource AppFgColor}" Opacity="0.7" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
|
||||||
<TextBlock x:Name="UsernameTextBoxPlaceholder" Grid.Column="1" Text="Enter username" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
|
<TextBox x:Name="OtherUsernameTextBox" Grid.Column="0" Style="{DynamicResource TextBoxInputStyle}" Text="" AutomationProperties.Name="Enter username"/>
|
||||||
<TextBox x:Name="OtherUsernameTextBox" Grid.Column="1" Style="{StaticResource UserTextBoxStyle}" Text="" AutomationProperties.Name="Enter username"/>
|
<TextBlock Grid.Column="1" Text="" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="8,0,4,0" Foreground="{DynamicResource AppFgColor}" Opacity="0.7"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<Separator Margin="0,10,0,8" Background="{DynamicResource BorderColor}"/>
|
<Separator Margin="0,10,0,8" Background="{DynamicResource AppBorderColor}"/>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,8,0,0">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,8,0,4">
|
||||||
<Button x:Name="HomeDefaultModeBtn" Width="227" Height="50" Style="{DynamicResource PrimaryButtonStyle}" Margin="0,0,12,0" AutomationProperties.Name="Default Mode">
|
<Button x:Name="HomeDefaultModeBtn" Width="227" Height="50" Style="{DynamicResource PrimaryButtonStyle}" Margin="0,0,12,0" AutomationProperties.Name="Default Mode">
|
||||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="16" VerticalAlignment="Center" Margin="0,0,8,-1"/>
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="16" VerticalAlignment="Center" Margin="0,0,8,-1"/>
|
||||||
@@ -567,10 +537,10 @@
|
|||||||
<!-- App Removal Tab -->
|
<!-- App Removal Tab -->
|
||||||
<TabItem Header="App Removal">
|
<TabItem Header="App Removal">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<Border DockPanel.Dock="Top" Padding="20,10,20,0">
|
<Border DockPanel.Dock="Top" Padding="20,4,20,0">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="App Removal" FontWeight="Bold" FontSize="20" Margin="0,0,0,5" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock Text="App Removal" FontWeight="SemiBold" FontSize="24" Foreground="{DynamicResource AppFgColor}"/>
|
||||||
<TextBlock Text="Select which apps you want to remove from your system" FontSize="13" Margin="0,0,0,20" Foreground="{DynamicResource FgColor}" TextWrapping="Wrap"/>
|
<TextBlock Text="Select which apps you want to remove" FontSize="14" Margin="0,5,0,20" Foreground="{DynamicResource AppFgColor}" TextWrapping="Wrap"/>
|
||||||
|
|
||||||
<!-- Filter Options -->
|
<!-- Filter Options -->
|
||||||
<Grid Margin="0,0,0,12">
|
<Grid Margin="0,0,0,12">
|
||||||
@@ -583,11 +553,11 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal" Grid.Column="0">
|
<StackPanel Orientation="Horizontal" Grid.Column="0">
|
||||||
<ToggleButton x:Name="PresetsBtn" ToolTip="Select or clear app presets" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="App Presets">
|
<ToggleButton x:Name="PresetsBtn" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="App Presets">
|
||||||
<ToggleButton.Style>
|
<ToggleButton.Style>
|
||||||
<Style TargetType="ToggleButton">
|
<Style TargetType="ToggleButton">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonBg}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonBgColor}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
<Setter Property="FontSize" Value="14"/>
|
<Setter Property="FontSize" Value="14"/>
|
||||||
@@ -603,20 +573,20 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHoverColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsPressed" Value="True">
|
<Trigger Property="IsPressed" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonPressed}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonPressedColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsChecked" Value="True">
|
<Trigger Property="IsChecked" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHoverColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
</ToggleButton.Style>
|
</ToggleButton.Style>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="0,1,6,0"/>
|
||||||
<TextBlock Text="Quick Select" FontSize="13" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
<TextBlock Text="Quick Select" FontSize="13" VerticalAlignment="Center" Margin="0,0,6,1"/>
|
||||||
<TextBlock x:Name="PresetsArrow" Text="" FontFamily="Segoe Fluent Icons" FontSize="10" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
|
<TextBlock x:Name="PresetsArrow" Text="" FontFamily="Segoe Fluent Icons" FontSize="10" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
|
||||||
<TextBlock.RenderTransform>
|
<TextBlock.RenderTransform>
|
||||||
<RotateTransform x:Name="PresetsArrowRotation" Angle="0"/>
|
<RotateTransform x:Name="PresetsArrowRotation" Angle="0"/>
|
||||||
@@ -626,47 +596,42 @@
|
|||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
<Button x:Name="ClearAppSelectionBtn" ToolTip="Clear all selected apps" Style="{DynamicResource SecondaryButtonStyle}" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Clear Selection">
|
<Button x:Name="ClearAppSelectionBtn" ToolTip="Clear all selected apps" Style="{DynamicResource SecondaryButtonStyle}" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Clear Selection">
|
||||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="15" VerticalAlignment="Center" Margin="0,3,6,0"/>
|
||||||
<TextBlock Text="Clear Selection" FontSize="13" VerticalAlignment="Center" Margin="0,0,0,1"/>
|
<TextBlock Text="Clear Selection" FontSize="13" VerticalAlignment="Center" Margin="0,0,0,1"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
<Popup x:Name="PresetsPopup" PlacementTarget="{Binding ElementName=PresetsBtn}" Placement="Bottom" StaysOpen="True" AllowsTransparency="True" VerticalOffset="2">
|
<Popup x:Name="PresetsPopup" PlacementTarget="{Binding ElementName=PresetsBtn}" Placement="Bottom" StaysOpen="True" AllowsTransparency="True" VerticalOffset="2">
|
||||||
<Border Background="{DynamicResource CardBgColor}" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="6" Padding="4,6" Margin="12">
|
<Border Background="{DynamicResource CardBgColor}" BorderBrush="{DynamicResource AppBorderColor}" BorderThickness="1" CornerRadius="6" Padding="4,6" Margin="12">
|
||||||
<Border.Effect>
|
<Border.Effect>
|
||||||
<DropShadowEffect BlurRadius="12" Opacity="0.25" ShadowDepth="4"/>
|
<DropShadowEffect BlurRadius="12" Opacity="0.25" ShadowDepth="4"/>
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
<StackPanel x:Name="PresetsPanel" MinWidth="220">
|
<StackPanel x:Name="PresetsPanel" MinWidth="220">
|
||||||
<CheckBox x:Name="PresetDefaultApps" Content="Default apps" IsThreeState="True" ToolTip="Select the apps that are safe to remove for most users" Foreground="{DynamicResource FgColor}" Margin="8,4" AutomationProperties.Name="Default selection"/>
|
<CheckBox x:Name="PresetDefaultApps" Content="Default apps" IsThreeState="True" ToolTip="Select the apps that are safe to remove for most users" Foreground="{DynamicResource AppFgColor}" Margin="8,4" AutomationProperties.Name="Default selection"/>
|
||||||
<CheckBox x:Name="PresetLastUsed" Content="Last used apps" IsThreeState="True" ToolTip="Select the apps that were removed the last time Win11Debloat was run" Foreground="{DynamicResource FgColor}" Margin="8,4" AutomationProperties.Name="Last used selection"/>
|
<CheckBox x:Name="PresetLastUsed" Content="Previously selected apps" IsThreeState="True" ToolTip="Select the apps that were removed the last time Win11Debloat was run" Foreground="{DynamicResource AppFgColor}" Margin="8,4" AutomationProperties.Name="Previously selected apps"/>
|
||||||
<Separator Margin="4,6" Background="{DynamicResource BorderColor}"/>
|
<Separator Margin="4,6" Background="{DynamicResource AppBorderColor}"/>
|
||||||
<StackPanel x:Name="JsonPresetsPanel"/>
|
<StackPanel x:Name="JsonPresetsPanel"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Popup>
|
</Popup>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<CheckBox x:Name="OnlyInstalledAppsBox" Grid.Column="2" Content="Only show installed apps" IsChecked="False" Foreground="{DynamicResource FgColor}" VerticalAlignment="Center" AutomationProperties.Name="Only show installed apps"/>
|
<CheckBox x:Name="OnlyInstalledAppsBox" Grid.Column="2" Content="Only show installed apps" ToolTip="Only show applications that are currently installed on this system" IsChecked="False" Foreground="{DynamicResource AppFgColor}" VerticalAlignment="Center" AutomationProperties.Name="Only show installed apps"/>
|
||||||
|
|
||||||
<Border x:Name="AppSearchBorder" Grid.Column="4">
|
<Border x:Name="AppSearchBorder" Grid.Column="4" Width="300">
|
||||||
<Border.Style>
|
<Border Style="{DynamicResource TextBoxBorderStyle}">
|
||||||
<Style TargetType="Border" BasedOn="{StaticResource SearchBoxBorderStyle}">
|
<Border Style="{DynamicResource TextBoxBottomBorderStyle}">
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding ElementName=AppSearchBox, Path=IsFocused}" Value="True">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource InputFocusColor}"/>
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</Border.Style>
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Column="0" Text="" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock x:Name="AppSearchPlaceholder" Grid.Column="0" Text="Search apps..." Foreground="{DynamicResource AppFgColor}" Opacity="0.7" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
|
||||||
<TextBlock x:Name="AppSearchPlaceholder" Grid.Column="1" Text="Search app" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
|
<TextBox x:Name="AppSearchBox" Grid.Column="0" Style="{DynamicResource TextBoxInputStyle}" Text="" AutomationProperties.Name="Search app"/>
|
||||||
<TextBox x:Name="AppSearchBox" Grid.Column="1" Background="Transparent" Foreground="{DynamicResource FgColor}" BorderThickness="0" FontSize="13" Margin="1,0,0,1" VerticalAlignment="Center" Text="" AutomationProperties.Name="Search app"/>
|
<TextBlock Grid.Column="1" Text="" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="8,0,4,0" Foreground="{DynamicResource AppFgColor}" Opacity="0.7"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
</Border>
|
||||||
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
@@ -683,7 +648,7 @@
|
|||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<!-- Column Headers -->
|
<!-- Column Headers -->
|
||||||
<Border Grid.Row="0" Background="{DynamicResource TableHeaderColor}" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1,1,1,0" CornerRadius="4,4,0,0">
|
<Border Grid.Row="0" Background="{DynamicResource TableHeaderColor}" BorderBrush="{DynamicResource AppBorderColor}" BorderThickness="1,1,1,0" CornerRadius="4,4,0,0">
|
||||||
<Grid Margin="42,6,23,8">
|
<Grid Margin="42,6,23,8">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="{StaticResource AppTableDotColWidth}"/>
|
<ColumnDefinition Width="{StaticResource AppTableDotColWidth}"/>
|
||||||
@@ -692,34 +657,34 @@
|
|||||||
<ColumnDefinition Width="{StaticResource AppTableIdColWidth}"/>
|
<ColumnDefinition Width="{StaticResource AppTableIdColWidth}"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<StackPanel x:Name="HeaderNameBtn" Grid.Column="1" Orientation="Horizontal" Cursor="Hand" VerticalAlignment="Center" Style="{StaticResource SortHeaderBtnStyle}">
|
<StackPanel x:Name="HeaderNameBtn" Grid.Column="1" Orientation="Horizontal" Cursor="Hand" VerticalAlignment="Center" Style="{StaticResource SortHeaderBtnStyle}">
|
||||||
<TextBlock Text="Name" FontWeight="SemiBold" FontSize="16" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock Text="Name" FontWeight="SemiBold" FontSize="16" Foreground="{DynamicResource AppFgColor}"/>
|
||||||
<TextBlock x:Name="SortArrowName" Text="" FontFamily="Segoe Fluent Icons" FontSize="11" Foreground="{DynamicResource FgColor}" VerticalAlignment="Center" Margin="5,1,0,0" Opacity="0.3" RenderTransformOrigin="0.5,0.5">
|
<TextBlock x:Name="SortArrowName" Text="" FontFamily="Segoe Fluent Icons" FontSize="11" Foreground="{DynamicResource AppFgColor}" VerticalAlignment="Center" Margin="5,1,0,0" Opacity="0.3" RenderTransformOrigin="0.5,0.5">
|
||||||
<TextBlock.RenderTransform><RotateTransform Angle="0"/></TextBlock.RenderTransform>
|
<TextBlock.RenderTransform><RotateTransform Angle="0"/></TextBlock.RenderTransform>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel x:Name="HeaderDescriptionBtn" Grid.Column="2" Orientation="Horizontal" Cursor="Hand" VerticalAlignment="Center" Margin="8,0,0,0" Style="{StaticResource SortHeaderBtnStyle}">
|
<StackPanel x:Name="HeaderDescriptionBtn" Grid.Column="2" Orientation="Horizontal" Cursor="Hand" VerticalAlignment="Center" Margin="8,0,0,0" Style="{StaticResource SortHeaderBtnStyle}">
|
||||||
<TextBlock Text="Description" FontWeight="SemiBold" FontSize="16" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock Text="Description" FontWeight="SemiBold" FontSize="16" Foreground="{DynamicResource AppFgColor}"/>
|
||||||
<TextBlock x:Name="SortArrowDescription" Text="" FontFamily="Segoe Fluent Icons" FontSize="11" Foreground="{DynamicResource FgColor}" VerticalAlignment="Center" Margin="5,1,0,0" Opacity="0.3" RenderTransformOrigin="0.5,0.5">
|
<TextBlock x:Name="SortArrowDescription" Text="" FontFamily="Segoe Fluent Icons" FontSize="11" Foreground="{DynamicResource AppFgColor}" VerticalAlignment="Center" Margin="5,1,0,0" Opacity="0.3" RenderTransformOrigin="0.5,0.5">
|
||||||
<TextBlock.RenderTransform><RotateTransform Angle="0"/></TextBlock.RenderTransform>
|
<TextBlock.RenderTransform><RotateTransform Angle="0"/></TextBlock.RenderTransform>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel x:Name="HeaderAppIdBtn" Grid.Column="3" Orientation="Horizontal" Cursor="Hand" VerticalAlignment="Center" Style="{StaticResource SortHeaderBtnStyle}">
|
<StackPanel x:Name="HeaderAppIdBtn" Grid.Column="3" Orientation="Horizontal" Cursor="Hand" VerticalAlignment="Center" Style="{StaticResource SortHeaderBtnStyle}">
|
||||||
<TextBlock Text="App ID" FontWeight="SemiBold" FontSize="16" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock Text="App ID" FontWeight="SemiBold" FontSize="16" Foreground="{DynamicResource AppFgColor}"/>
|
||||||
<TextBlock x:Name="SortArrowAppId" Text="" FontFamily="Segoe Fluent Icons" FontSize="11" Foreground="{DynamicResource FgColor}" VerticalAlignment="Center" Margin="5,1,0,0" Opacity="0.3" RenderTransformOrigin="0.5,0.5">
|
<TextBlock x:Name="SortArrowAppId" Text="" FontFamily="Segoe Fluent Icons" FontSize="11" Foreground="{DynamicResource AppFgColor}" VerticalAlignment="Center" Margin="5,1,0,0" Opacity="0.3" RenderTransformOrigin="0.5,0.5">
|
||||||
<TextBlock.RenderTransform><RotateTransform Angle="0"/></TextBlock.RenderTransform>
|
<TextBlock.RenderTransform><RotateTransform Angle="0"/></TextBlock.RenderTransform>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
<!-- Apps content -->
|
<!-- Apps content -->
|
||||||
<Border Grid.Row="1" BorderBrush="{DynamicResource BorderColor}" CornerRadius="0,0,4,4" BorderThickness="1" Background="{DynamicResource CardBgColor}" Padding="0,1,1,1">
|
<Border Grid.Row="1" BorderBrush="{DynamicResource AppBorderColor}" CornerRadius="0,0,4,4" BorderThickness="1" Background="{DynamicResource CardBgColor}" Padding="0,1,1,1">
|
||||||
<Grid>
|
<Grid>
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Visible">
|
<ScrollViewer VerticalScrollBarVisibility="Visible">
|
||||||
<StackPanel x:Name="AppSelectionPanel" Margin="10,4,0,4"/>
|
<StackPanel x:Name="AppSelectionPanel" Margin="10,4,0,4"/>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
<Border x:Name="LoadingAppsIndicator" CornerRadius="0,0,4,4" Background="{DynamicResource CardBgColor}" Opacity="0.8" Visibility="Collapsed">
|
<Border x:Name="LoadingAppsIndicator" CornerRadius="0,0,4,4" Background="{DynamicResource CardBgColor}" Opacity="0.8" Visibility="Collapsed">
|
||||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="28" Foreground="{DynamicResource FgColor}" HorizontalAlignment="Center" Margin="0,0,0,8" RenderTransformOrigin="0.5,0.5">
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="28" Foreground="{DynamicResource AppFgColor}" HorizontalAlignment="Center" Margin="0,0,0,8" RenderTransformOrigin="0.5,0.5">
|
||||||
<TextBlock.RenderTransform>
|
<TextBlock.RenderTransform>
|
||||||
<RotateTransform Angle="0"/>
|
<RotateTransform Angle="0"/>
|
||||||
</TextBlock.RenderTransform>
|
</TextBlock.RenderTransform>
|
||||||
@@ -736,17 +701,39 @@
|
|||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
</TextBlock.Triggers>
|
</TextBlock.Triggers>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Text="Loading apps..." FontSize="16" FontWeight="SemiBold" Foreground="{DynamicResource FgColor}" HorizontalAlignment="Center"/>
|
<TextBlock Text="Loading apps..." FontSize="16" FontWeight="SemiBold" Foreground="{DynamicResource AppFgColor}" HorizontalAlignment="Center"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- Status Info -->
|
<!-- Status Info & Color Legend -->
|
||||||
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="20,0,20,0">
|
<Grid Grid.Row="1" Margin="20,0">
|
||||||
<TextBlock x:Name="AppSelectionStatus" Text="" Foreground="{DynamicResource FgColor}" Margin="10,0,0,5" HorizontalAlignment="Left"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock x:Name="AppSelectionStatus" Grid.Column="0" Text="" Foreground="{DynamicResource AppFgColor}" Margin="10,0,0,5" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
|
||||||
|
<StackPanel x:Name="AppColorLegend" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,10,5">
|
||||||
|
<TextBlock Text="Legend:" Foreground="{DynamicResource AppFgColor}" FontSize="12" FontWeight="SemiBold" VerticalAlignment="Center" Margin="0,0,10,0" Opacity="0.8"/>
|
||||||
|
<!-- Recommended (safe) -->
|
||||||
|
<StackPanel Orientation="Horizontal" Margin="0,0,16,0" ToolTip="[Recommended] Safe to remove for most users">
|
||||||
|
<Ellipse Width="9" Height="9" Fill="{DynamicResource AppRecommendationSafeColor}" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
||||||
|
<TextBlock Text="Recommended" Foreground="{DynamicResource AppFgColor}" FontSize="12" VerticalAlignment="Center" Opacity="0.8"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<!-- Optional (default) -->
|
||||||
|
<StackPanel Orientation="Horizontal" Margin="0,0,16,0" ToolTip="[Optional] Can be safely removed if you don't need this app">
|
||||||
|
<Ellipse Width="9" Height="9" Fill="{DynamicResource AppRecommendationOptionalColor}" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
||||||
|
<TextBlock Text="Optional" Foreground="{DynamicResource AppFgColor}" FontSize="12" VerticalAlignment="Center" Opacity="0.8"/>
|
||||||
|
</StackPanel>
|
||||||
|
<!-- Not Recommended (unsafe) -->
|
||||||
|
<StackPanel Orientation="Horizontal" ToolTip="[Not Recommended] Only remove if you know what you are doing">
|
||||||
|
<Ellipse Width="9" Height="9" Fill="{DynamicResource AppRecommendationUnsafeColor}" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
||||||
|
<TextBlock Text="Not Recommended" Foreground="{DynamicResource AppFgColor}" FontSize="12" VerticalAlignment="Center" Opacity="0.8"/>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -754,10 +741,10 @@
|
|||||||
<!-- Tweaks Tab -->
|
<!-- Tweaks Tab -->
|
||||||
<TabItem Header="Tweaks">
|
<TabItem Header="Tweaks">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<Border DockPanel.Dock="Top" Padding="20,10,20,0" Background="{DynamicResource BgColor}">
|
<Border DockPanel.Dock="Top" Padding="20,4,20,0" Background="{DynamicResource AppBgColor}">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="System Tweaks" FontWeight="Bold" FontSize="20" Margin="0,0,0,5" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock Text="System Tweaks" FontWeight="SemiBold" FontSize="24" Foreground="{DynamicResource AppFgColor}"/>
|
||||||
<TextBlock Text="Select which tweaks you want to apply to your system, hover over settings for more information" FontSize="13" Margin="0,0,0,20" Foreground="{DynamicResource FgColor}" TextWrapping="Wrap"/>
|
<TextBlock Text="Select what changes you want to make, you can hover over settings for more information" FontSize="14" Margin="0,5,0,20" Foreground="{DynamicResource AppFgColor}" TextWrapping="Wrap"/>
|
||||||
|
|
||||||
<!-- Filter Options -->
|
<!-- Filter Options -->
|
||||||
<Grid Margin="0,0,0,12">
|
<Grid Margin="0,0,0,12">
|
||||||
@@ -770,11 +757,11 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||||
<ToggleButton x:Name="TweaksPresetsBtn" ToolTip="Select tweak presets" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Tweak Presets">
|
<ToggleButton x:Name="TweaksPresetsBtn" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Tweak Presets">
|
||||||
<ToggleButton.Style>
|
<ToggleButton.Style>
|
||||||
<Style TargetType="ToggleButton">
|
<Style TargetType="ToggleButton">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonBg}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonBgColor}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
<Setter Property="FontSize" Value="14"/>
|
<Setter Property="FontSize" Value="14"/>
|
||||||
@@ -790,20 +777,20 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHoverColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsPressed" Value="True">
|
<Trigger Property="IsPressed" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonPressed}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonPressedColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsChecked" Value="True">
|
<Trigger Property="IsChecked" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHoverColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
</ToggleButton.Style>
|
</ToggleButton.Style>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="0,1,6,0"/>
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="0,1,6,0"/>
|
||||||
<TextBlock Text="Quick Select" FontSize="13" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
<TextBlock Text="Quick Select" FontSize="13" VerticalAlignment="Center" Margin="0,0,6,1"/>
|
||||||
<TextBlock x:Name="TweaksPresetsArrow" Text="" FontFamily="Segoe Fluent Icons" FontSize="10" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
|
<TextBlock x:Name="TweaksPresetsArrow" Text="" FontFamily="Segoe Fluent Icons" FontSize="10" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
|
||||||
<TextBlock.RenderTransform>
|
<TextBlock.RenderTransform>
|
||||||
<RotateTransform Angle="0"/>
|
<RotateTransform Angle="0"/>
|
||||||
@@ -813,48 +800,43 @@
|
|||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
<Button x:Name="ClearAllTweaksBtn" ToolTip="Clear all selected tweaks" Style="{DynamicResource SecondaryButtonStyle}" Padding="10,0" Height="32" Margin="0,0,10,0" AutomationProperties.Name="Clear Selection">
|
<Button x:Name="ClearAllTweaksBtn" ToolTip="Clear all selected tweaks" Style="{DynamicResource SecondaryButtonStyle}" Padding="10,0" Height="32" Margin="0,0,10,0" AutomationProperties.Name="Clear Selection">
|
||||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="0,0,6,0"/>
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="15" VerticalAlignment="Center" Margin="0,3,6,0"/>
|
||||||
<TextBlock Text="Clear Selection" FontSize="13" VerticalAlignment="Center" Margin="0,0,0,1"/>
|
<TextBlock Text="Clear Selection" FontSize="13" VerticalAlignment="Center" Margin="0,0,0,1"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
<Popup x:Name="TweaksPresetsPopup" PlacementTarget="{Binding ElementName=TweaksPresetsBtn}" Placement="Bottom" StaysOpen="True" AllowsTransparency="True" VerticalOffset="2">
|
<Popup x:Name="TweaksPresetsPopup" PlacementTarget="{Binding ElementName=TweaksPresetsBtn}" Placement="Bottom" StaysOpen="True" AllowsTransparency="True" VerticalOffset="2">
|
||||||
<Border Background="{DynamicResource CardBgColor}" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="6" Padding="4,6" Margin="12">
|
<Border Background="{DynamicResource CardBgColor}" BorderBrush="{DynamicResource AppBorderColor}" BorderThickness="1" CornerRadius="6" Padding="4,6" Margin="12">
|
||||||
<Border.Effect>
|
<Border.Effect>
|
||||||
<DropShadowEffect BlurRadius="12" Opacity="0.25" ShadowDepth="4"/>
|
<DropShadowEffect BlurRadius="12" Opacity="0.25" ShadowDepth="4"/>
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
<StackPanel MinWidth="220">
|
<StackPanel MinWidth="220">
|
||||||
<CheckBox x:Name="PresetDefaultTweaksBtn" Content="Default settings" IsThreeState="True" ToolTip="Select the settings that are recommended for most people" Foreground="{DynamicResource FgColor}" Style="{DynamicResource PresetCheckBoxStyle}" AutomationProperties.Name="Default settings"/>
|
<CheckBox x:Name="PresetDefaultTweaksBtn" Content="Default settings" IsThreeState="True" ToolTip="Select the settings that are recommended for most people" Foreground="{DynamicResource AppFgColor}" Style="{DynamicResource PresetCheckBoxStyle}" AutomationProperties.Name="Default settings"/>
|
||||||
<CheckBox x:Name="PresetLastUsedTweaksBtn" Content="Last used settings" IsThreeState="True" ToolTip="Select the settings that were used the last time Win11Debloat was run" Foreground="{DynamicResource FgColor}" Style="{DynamicResource PresetCheckBoxStyle}" AutomationProperties.Name="Last used settings"/>
|
<CheckBox x:Name="PresetLastUsedTweaksBtn" Content="Previously selected settings" IsThreeState="True" ToolTip="Select the settings that were applied the last time Win11Debloat was run" Foreground="{DynamicResource AppFgColor}" Style="{DynamicResource PresetCheckBoxStyle}" AutomationProperties.Name="Previously selected settings"/>
|
||||||
<Separator Margin="4,6" Background="{DynamicResource BorderColor}"/>
|
<Separator Margin="4,6" Background="{DynamicResource AppBorderColor}"/>
|
||||||
<CheckBox x:Name="PresetPrivacyTweaksBtn" Content="Privacy & Suggested Content" IsThreeState="True" ToolTip="Select all Privacy & Suggested Content tweaks" Foreground="{DynamicResource FgColor}" Style="{DynamicResource PresetCheckBoxStyle}" AutomationProperties.Name="All Privacy and Suggested Content"/>
|
<CheckBox x:Name="PresetPrivacyTweaksBtn" Content="Privacy & suggested content" IsThreeState="True" ToolTip="Select all tweaks related to privacy & suggested content" Foreground="{DynamicResource AppFgColor}" Style="{DynamicResource PresetCheckBoxStyle}" AutomationProperties.Name="All Privacy and Suggested Content"/>
|
||||||
<CheckBox x:Name="PresetAITweaksBtn" Content="AI features" IsThreeState="True" ToolTip="Select all AI feature tweaks" Foreground="{DynamicResource FgColor}" Style="{DynamicResource PresetCheckBoxStyle}" AutomationProperties.Name="All AI features"/>
|
<CheckBox x:Name="PresetAITweaksBtn" Content="AI features" IsThreeState="True" ToolTip="Select all AI related tweaks" Foreground="{DynamicResource AppFgColor}" Style="{DynamicResource PresetCheckBoxStyle}" AutomationProperties.Name="All AI features"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Popup>
|
</Popup>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<CheckBox x:Name="ShowCurrentlyAppliedTweaksCheckBox" Grid.Column="2" Content="Detect applied tweaks" IsChecked="True" Foreground="{DynamicResource FgColor}" VerticalAlignment="Center" AutomationProperties.Name="Detect applied tweaks" ToolTip="Detect all tweaks currently applied for the current user."/>
|
<CheckBox x:Name="ShowCurrentlyAppliedTweaksCheckBox" Grid.Column="2" Content="Detect applied tweaks" IsChecked="True" Foreground="{DynamicResource AppFgColor}" VerticalAlignment="Center" AutomationProperties.Name="Detect applied tweaks" ToolTip="Detect all tweaks currently applied for the current user"/>
|
||||||
|
|
||||||
<Border x:Name="TweakSearchBorder" Grid.Column="4">
|
<Border x:Name="TweakSearchBorder" Grid.Column="4" Width="300">
|
||||||
<Border.Style>
|
<Border Style="{DynamicResource TextBoxBorderStyle}">
|
||||||
<Style TargetType="Border" BasedOn="{StaticResource SearchBoxBorderStyle}">
|
<Border Style="{DynamicResource TextBoxBottomBorderStyle}">
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding ElementName=TweakSearchBox, Path=IsFocused}" Value="True">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource InputFocusColor}"/>
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</Border.Style>
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Column="0" Text="" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock x:Name="TweakSearchPlaceholder" Grid.Column="0" Text="Search tweaks..." Foreground="{DynamicResource AppFgColor}" Opacity="0.7" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
|
||||||
<TextBlock x:Name="TweakSearchPlaceholder" Grid.Column="1" Text="Search setting" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
|
<TextBox x:Name="TweakSearchBox" Grid.Column="0" Style="{DynamicResource TextBoxInputStyle}" Text="" AutomationProperties.Name="Search tweaks"/>
|
||||||
<TextBox x:Name="TweakSearchBox" Grid.Column="1" Background="Transparent" Foreground="{DynamicResource FgColor}" BorderThickness="0" FontSize="13" Margin="1,0,0,1" VerticalAlignment="Center" Text=""/>
|
<TextBlock Grid.Column="1" Text="" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="8,0,4,0" Foreground="{DynamicResource AppFgColor}" Opacity="0.7"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
</Border>
|
||||||
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
@@ -878,7 +860,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
<!-- Top fade gradient -->
|
<!-- Top fade gradient -->
|
||||||
<Border IsHitTestVisible="False" VerticalAlignment="Top" Height="10" Margin="0,-12,20,0" Background="{DynamicResource BgColor}">
|
<Border IsHitTestVisible="False" VerticalAlignment="Top" Height="10" Margin="0,-12,20,0" Background="{DynamicResource AppBgColor}">
|
||||||
<Border.OpacityMask>
|
<Border.OpacityMask>
|
||||||
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
||||||
<GradientStop Color="Black" Offset="0"/>
|
<GradientStop Color="Black" Offset="0"/>
|
||||||
@@ -888,7 +870,7 @@
|
|||||||
</Border.OpacityMask>
|
</Border.OpacityMask>
|
||||||
</Border>
|
</Border>
|
||||||
<!-- Bottom fade gradient -->
|
<!-- Bottom fade gradient -->
|
||||||
<Border IsHitTestVisible="False" VerticalAlignment="Bottom" Height="20" Margin="0,0,20,0" Background="{DynamicResource BgColor}">
|
<Border IsHitTestVisible="False" VerticalAlignment="Bottom" Height="20" Margin="0,0,20,0" Background="{DynamicResource AppBgColor}">
|
||||||
<Border.OpacityMask>
|
<Border.OpacityMask>
|
||||||
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
||||||
<GradientStop Color="Transparent" Offset="0"/>
|
<GradientStop Color="Transparent" Offset="0"/>
|
||||||
@@ -903,10 +885,10 @@
|
|||||||
<!-- Deployment Settings Tab -->
|
<!-- Deployment Settings Tab -->
|
||||||
<TabItem Header="Deployment Settings" x:Name="DeploymentSettingsTab">
|
<TabItem Header="Deployment Settings" x:Name="DeploymentSettingsTab">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<Border DockPanel.Dock="Top" Padding="20,10,20,0">
|
<Border DockPanel.Dock="Top" Padding="20,4,20,0">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Deployment Settings" FontWeight="Bold" FontSize="20" Margin="0,0,0,5" Foreground="{DynamicResource FgColor}"/>
|
<TextBlock Text="Deployment Settings" FontWeight="SemiBold" FontSize="24" Foreground="{DynamicResource AppFgColor}"/>
|
||||||
<TextBlock Text="Configure how your changes will be applied and more" FontSize="13" Margin="0,0,0,20" Foreground="{DynamicResource FgColor}" TextWrapping="Wrap"/>
|
<TextBlock Text="Configure how the selected changes will be applied to your system" FontSize="14" Margin="0,5,0,20" Foreground="{DynamicResource AppFgColor}" TextWrapping="Wrap"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
@@ -926,15 +908,15 @@
|
|||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Apply Changes To -->
|
<!-- Apply Changes To -->
|
||||||
<Border Grid.Row="0" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Margin="0,0,0,16">
|
<Border Grid.Row="0" BorderBrush="{DynamicResource AppBorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Margin="0,0,0,16">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Changes will be applied to" Style="{StaticResource CategoryHeaderTextBlock}"/>
|
<TextBlock Text="Changes will be applied to" Style="{StaticResource CategoryHeaderTextBlock}"/>
|
||||||
<TextBlock x:Name="UserSelectionDescription" Text="The currently logged-in user profile." Foreground="{DynamicResource FgColor}" FontSize="12" TextWrapping="Wrap" Margin="0,0,0,3"/>
|
<TextBlock x:Name="UserSelectionDescription" Text="The currently logged-in user profile." Foreground="{DynamicResource AppFgColor}" FontSize="13" TextWrapping="Wrap" Margin="0,-2,0,3"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- App Removal Scope -->
|
<!-- App Removal Scope -->
|
||||||
<Border Grid.Row="1" x:Name="AppRemovalScopeSection" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Margin="0,0,0,16">
|
<Border Grid.Row="1" x:Name="AppRemovalScopeSection" BorderBrush="{DynamicResource AppBorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Margin="0,0,0,16">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Apps will be removed for" Style="{StaticResource CategoryHeaderTextBlock}"/>
|
<TextBlock Text="Apps will be removed for" Style="{StaticResource CategoryHeaderTextBlock}"/>
|
||||||
<ComboBox x:Name="AppRemovalScopeCombo" Margin="0,0,0,6" AutomationProperties.Name="App Removal Scope">
|
<ComboBox x:Name="AppRemovalScopeCombo" Margin="0,0,0,6" AutomationProperties.Name="App Removal Scope">
|
||||||
@@ -942,12 +924,12 @@
|
|||||||
<ComboBoxItem x:Name="AppRemovalScopeCurrentUser" Content="Current user only"/>
|
<ComboBoxItem x:Name="AppRemovalScopeCurrentUser" Content="Current user only"/>
|
||||||
<ComboBoxItem x:Name="AppRemovalScopeTargetUser" Content="Target user only" Visibility="Collapsed"/>
|
<ComboBoxItem x:Name="AppRemovalScopeTargetUser" Content="Target user only" Visibility="Collapsed"/>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
<TextBlock x:Name="AppRemovalScopeDescription" Text="Apps will be removed for all users and from the Windows image to prevent reinstallation for new users." Foreground="{DynamicResource FgColor}" FontSize="12" TextWrapping="Wrap" Margin="0,6,0,3"/>
|
<TextBlock x:Name="AppRemovalScopeDescription" Text="Apps will be removed for all users and from the Windows image to prevent reinstallation for new users." Foreground="{DynamicResource AppFgColor}" FontSize="13" TextWrapping="Wrap" Margin="0,6,0,3"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- Options -->
|
<!-- Options -->
|
||||||
<Border Grid.Row="2" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12,16,3" Margin="0,0,0,16">
|
<Border Grid.Row="2" BorderBrush="{DynamicResource AppBorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12,16,3" Margin="0,0,0,16">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock Text="Options" Style="{StaticResource CategoryHeaderTextBlock}"/>
|
<TextBlock Text="Options" Style="{StaticResource CategoryHeaderTextBlock}"/>
|
||||||
|
|
||||||
@@ -965,7 +947,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
<!-- Top fade gradient -->
|
<!-- Top fade gradient -->
|
||||||
<Border IsHitTestVisible="False" VerticalAlignment="Top" Height="10" Margin="0,-12,20,0" Background="{DynamicResource BgColor}">
|
<Border IsHitTestVisible="False" VerticalAlignment="Top" Height="10" Margin="0,-12,20,0" Background="{DynamicResource AppBgColor}">
|
||||||
<Border.OpacityMask>
|
<Border.OpacityMask>
|
||||||
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
||||||
<GradientStop Color="Black" Offset="0"/>
|
<GradientStop Color="Black" Offset="0"/>
|
||||||
@@ -975,7 +957,7 @@
|
|||||||
</Border.OpacityMask>
|
</Border.OpacityMask>
|
||||||
</Border>
|
</Border>
|
||||||
<!-- Bottom fade gradient -->
|
<!-- Bottom fade gradient -->
|
||||||
<Border IsHitTestVisible="False" VerticalAlignment="Bottom" Height="20" Margin="0,0,20,0" Background="{DynamicResource BgColor}">
|
<Border IsHitTestVisible="False" VerticalAlignment="Bottom" Height="20" Margin="0,0,20,0" Background="{DynamicResource AppBgColor}">
|
||||||
<Border.OpacityMask>
|
<Border.OpacityMask>
|
||||||
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
||||||
<GradientStop Color="Transparent" Offset="0"/>
|
<GradientStop Color="Transparent" Offset="0"/>
|
||||||
@@ -986,23 +968,23 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- Review & Apply Section -->
|
<!-- Review & Apply Section -->
|
||||||
<StackPanel Grid.Row="1" HorizontalAlignment="Stretch" Background="{DynamicResource BgColor}">
|
<StackPanel Grid.Row="1" HorizontalAlignment="Stretch" Background="{DynamicResource AppBgColor}">
|
||||||
<Button x:Name="ReviewChangesBtn" Background="Transparent" BorderThickness="0" Cursor="Hand" HorizontalAlignment="Center" Margin="0,4,0,10" AutomationProperties.Name="Review selected changes">
|
<Button x:Name="ReviewChangesBtn" Background="Transparent" BorderThickness="0" Cursor="Hand" HorizontalAlignment="Center" Margin="0,4,0,10" AutomationProperties.Name="Review selected changes">
|
||||||
<Button.Template>
|
<Button.Template>
|
||||||
<ControlTemplate TargetType="Button">
|
<ControlTemplate TargetType="Button">
|
||||||
<TextBlock x:Name="LinkText" Text="Review selected changes" FontSize="14" Foreground="{DynamicResource ButtonBg}" FontWeight="SemiBold" HorizontalAlignment="Center"/>
|
<TextBlock x:Name="LinkText" Text="Review selected changes" FontSize="16" Foreground="{DynamicResource ButtonBgColor}" FontWeight="SemiBold" HorizontalAlignment="Center"/>
|
||||||
<ControlTemplate.Triggers>
|
<ControlTemplate.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter TargetName="LinkText" Property="Foreground" Value="{DynamicResource ButtonHover}"/>
|
<Setter TargetName="LinkText" Property="Foreground" Value="{DynamicResource ButtonHoverColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsPressed" Value="True">
|
<Trigger Property="IsPressed" Value="True">
|
||||||
<Setter TargetName="LinkText" Property="Foreground" Value="{DynamicResource ButtonPressed}"/>
|
<Setter TargetName="LinkText" Property="Foreground" Value="{DynamicResource ButtonPressedColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Button.Template>
|
</Button.Template>
|
||||||
</Button>
|
</Button>
|
||||||
<Button x:Name="DeploymentApplyBtn" Style="{DynamicResource PrimaryButtonStyle}" Width="190" Height="44" HorizontalAlignment="Center" AutomationProperties.Name="Apply Changes">
|
<Button x:Name="DeploymentApplyBtn" Style="{DynamicResource PrimaryButtonStyle}" Width="200" Height="44" HorizontalAlignment="Center" AutomationProperties.Name="Apply Changes">
|
||||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="20" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="20" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||||
<TextBlock Text="Apply Changes" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Margin="8,0,0,4"/>
|
<TextBlock Text="Apply Changes" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Margin="8,0,0,4"/>
|
||||||
@@ -1022,17 +1004,17 @@
|
|||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Button x:Name="PreviousBtn" Grid.Column="0" Width="120" Height="36" Style="{DynamicResource SecondaryButtonStyle}" Visibility="Collapsed" Margin="10,0,0,0" AutomationProperties.Name="Back">
|
<Button x:Name="PreviousBtn" Grid.Column="0" Width="120" Height="36" Style="{DynamicResource SecondaryButtonStyle}" Visibility="Collapsed" AutomationProperties.Name="Back">
|
||||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="12" Margin="0,0,8,0" VerticalAlignment="Center"/>
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="12" Margin="0,0,8,0" VerticalAlignment="Center"/>
|
||||||
<TextBlock Text="Back" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,1"/>
|
<TextBlock Text="Back" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,3"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
<Button x:Name="NextBtn" Width="120" Height="36" Margin="0,0,10,0" Style="{DynamicResource PrimaryButtonStyle}" AutomationProperties.Name="Next">
|
<Button x:Name="NextBtn" Width="120" Height="36" Style="{DynamicResource PrimaryButtonStyle}" AutomationProperties.Name="Next">
|
||||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
<TextBlock Text="Next" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,1"/>
|
<TextBlock Text="Next" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,3"/>
|
||||||
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="12" Margin="8,0,0,0" VerticalAlignment="Center"/>
|
<TextBlock Text="" FontFamily="Segoe Fluent Icons" FontSize="12" Margin="8,0,0,0" VerticalAlignment="Center"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
Topmost="False"
|
Topmost="False"
|
||||||
ShowInTaskbar="False">
|
ShowInTaskbar="False">
|
||||||
|
|
||||||
<Border BorderBrush="{DynamicResource BorderColor}"
|
<Border BorderBrush="{DynamicResource AppBorderColor}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
CornerRadius="8"
|
CornerRadius="8"
|
||||||
Background="{DynamicResource CardBgColor}"
|
Background="{DynamicResource CardBgColor}"
|
||||||
@@ -33,14 +33,10 @@
|
|||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Title Bar -->
|
<!-- Title Bar -->
|
||||||
<Grid Grid.Row="0" x:Name="TitleBar" Height="40" Background="Transparent">
|
<Grid Grid.Row="0" x:Name="TitleBar" Style="{DynamicResource ModalTitleBarStyle}">
|
||||||
<TextBlock x:Name="TitleText"
|
<TextBlock x:Name="TitleText"
|
||||||
Text="Message"
|
Text="Message"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Style="{DynamicResource ModalTitleTextStyle}"/>
|
||||||
FontSize="16"
|
|
||||||
FontWeight="SemiBold"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Margin="16,0,0,0"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- Message Content -->
|
<!-- Message Content -->
|
||||||
@@ -55,7 +51,7 @@
|
|||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
FontFamily="Segoe Fluent Icons"
|
FontFamily="Segoe Fluent Icons"
|
||||||
FontSize="24"
|
FontSize="24"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Margin="4,0,14,0"
|
Margin="4,0,14,0"
|
||||||
Visibility="Collapsed"/>
|
Visibility="Collapsed"/>
|
||||||
@@ -67,7 +63,7 @@
|
|||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
FontSize="14"
|
FontSize="14"
|
||||||
LineHeight="20"
|
LineHeight="20"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Margin="0,0,20,0"/>
|
Margin="0,0,20,0"/>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
@@ -75,24 +71,27 @@
|
|||||||
|
|
||||||
<!-- Button Panel -->
|
<!-- Button Panel -->
|
||||||
<Border Grid.Row="2"
|
<Border Grid.Row="2"
|
||||||
Background="{DynamicResource BgColor}"
|
Background="{DynamicResource AppBgColor}"
|
||||||
BorderBrush="{DynamicResource BorderColor}"
|
BorderBrush="{DynamicResource AppBorderColor}"
|
||||||
BorderThickness="0,1,0,0"
|
BorderThickness="0,1,0,0"
|
||||||
Padding="16,12"
|
Padding="16,12"
|
||||||
CornerRadius="0,0,8,8">
|
CornerRadius="0,0,8,8">
|
||||||
<StackPanel x:Name="ButtonPanel"
|
<Grid x:Name="ButtonPanel">
|
||||||
Orientation="Horizontal"
|
<Grid.ColumnDefinitions>
|
||||||
HorizontalAlignment="Right">
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button x:Name="Button1"
|
<Button x:Name="Button1"
|
||||||
|
Grid.Column="0"
|
||||||
Content="OK"
|
Content="OK"
|
||||||
Height="32" MinWidth="80" Margin="4,0"
|
Style="{DynamicResource ModalPrimaryStretchedButtonStyle}"/>
|
||||||
Style="{DynamicResource PrimaryButtonStyle}"/>
|
|
||||||
<Button x:Name="Button2"
|
<Button x:Name="Button2"
|
||||||
|
Grid.Column="1"
|
||||||
Content="Cancel"
|
Content="Cancel"
|
||||||
Height="32" MinWidth="80" Margin="4,0"
|
Style="{DynamicResource ModalSecondaryStretchedButtonStyle}"
|
||||||
Style="{DynamicResource SecondaryButtonStyle}"
|
|
||||||
Visibility="Collapsed"/>
|
Visibility="Collapsed"/>
|
||||||
</StackPanel>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
@@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<Style x:Key="RestoreOptionTileStyle" TargetType="Button">
|
<Style x:Key="RestoreOptionTileStyle" TargetType="Button">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonBg}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonBgColor}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
<Setter Property="Padding" Value="12,10"/>
|
<Setter Property="Padding" Value="12,10"/>
|
||||||
@@ -36,16 +36,16 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonDisabled}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonDisabledColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderColor}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource SecondaryButtonTextDisabled}"/>
|
<Setter Property="Foreground" Value="{DynamicResource SecondaryButtonTextDisabledColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHoverColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsPressed" Value="True">
|
<Trigger Property="IsPressed" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonPressed}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonPressedColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
@@ -84,10 +84,10 @@
|
|||||||
<Button.Style>
|
<Button.Style>
|
||||||
<Style TargetType="Button">
|
<Style TargetType="Button">
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource CloseHover}"/>
|
<Setter Property="Background" Value="{DynamicResource TitleBarCloseHoverColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" Margin="0">
|
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" Margin="0">
|
||||||
<Grid Margin="20,4,20,18">
|
<Grid Margin="20,4,20,16">
|
||||||
|
|
||||||
<TabControl x:Name="RestoreModeTabs"
|
<TabControl x:Name="RestoreModeTabs"
|
||||||
SelectedIndex="0"
|
SelectedIndex="0"
|
||||||
@@ -121,7 +121,7 @@
|
|||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
FontSize="14"
|
FontSize="14"
|
||||||
LineHeight="20"
|
LineHeight="20"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
Text="Choose what changes you want to restore."/>
|
Text="Choose what changes you want to restore."/>
|
||||||
|
|
||||||
<Button x:Name="ChooseRegistryBtn"
|
<Button x:Name="ChooseRegistryBtn"
|
||||||
@@ -203,14 +203,14 @@
|
|||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
FontSize="14"
|
FontSize="14"
|
||||||
LineHeight="20"
|
LineHeight="20"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
Text="This will restore any system registry changes made by Win11Debloat to their previous state. You can review the changes after selecting a backup file. Apps will need to be reinstalled manually."/>
|
Text="This will restore any system registry changes made by Win11Debloat to the previous state. You can review the changes after selecting a backup file. Removed applications will need to be reinstalled manually."/>
|
||||||
|
|
||||||
<TextBlock Grid.Row="1"
|
<TextBlock Grid.Row="1"
|
||||||
Margin="0,12,0,2"
|
Margin="0,12,0,2"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
Opacity="0.75"
|
Opacity="0.75"
|
||||||
Text="Warning: Only use backup files generated by Win11Debloat."/>
|
Text="Warning: Only use backup files generated by Win11Debloat."/>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -247,7 +247,7 @@
|
|||||||
<TextBlock x:Name="BackupTargetText" Grid.Row="2" Grid.Column="1" Text="N/A" Style="{DynamicResource ModalInfoValueTextStyle}" Margin="0"/>
|
<TextBlock x:Name="BackupTargetText" Grid.Row="2" Grid.Column="1" Text="N/A" Style="{DynamicResource ModalInfoValueTextStyle}" Margin="0"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Border Grid.Row="1" Height="1" Background="{DynamicResource BorderColor}" Margin="0,0,0,12"/>
|
<Border Grid.Row="1" Height="1" Background="{DynamicResource AppBorderColor}" Margin="0,0,0,12"/>
|
||||||
|
|
||||||
<Grid x:Name="OverviewFeaturesSection" Grid.Row="2">
|
<Grid x:Name="OverviewFeaturesSection" Grid.Row="2">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@@ -258,7 +258,7 @@
|
|||||||
<TextBlock Grid.Row="0"
|
<TextBlock Grid.Row="0"
|
||||||
Text="The following changes will be reverted:"
|
Text="The following changes will be reverted:"
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
Margin="0,0,0,8"/>
|
Margin="0,0,0,8"/>
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@
|
|||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding DisplayText}" FontSize="12" Foreground="{DynamicResource FgColor}" TextWrapping="Wrap" Margin="0,0,0,6"/>
|
<TextBlock Text="{Binding DisplayText}" FontSize="12" Foreground="{DynamicResource AppFgColor}" TextWrapping="Wrap" Margin="0,0,0,6"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
@@ -279,12 +279,12 @@
|
|||||||
<TextBlock x:Name="OverviewSummaryText"
|
<TextBlock x:Name="OverviewSummaryText"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Visibility="Collapsed"
|
Visibility="Collapsed"
|
||||||
Text="This will restore the Start Menu pinned apps layout for the current user."/>
|
Text="This will restore the Start Menu pinned apps layout for the current user."/>
|
||||||
|
|
||||||
<Border x:Name="ReappliedSeparator" Grid.Row="3" Height="1" Background="{DynamicResource BorderColor}" Margin="0,12,0,12" Visibility="Collapsed"/>
|
<Border x:Name="ReappliedSeparator" Grid.Row="3" Height="1" Background="{DynamicResource AppBorderColor}" Margin="0,12,0,12" Visibility="Collapsed"/>
|
||||||
|
|
||||||
<Grid x:Name="ReappliedPanel" Grid.Row="4" Visibility="Collapsed">
|
<Grid x:Name="ReappliedPanel" Grid.Row="4" Visibility="Collapsed">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@@ -295,7 +295,7 @@
|
|||||||
<TextBlock Grid.Row="0"
|
<TextBlock Grid.Row="0"
|
||||||
Text="The following changes will be re-applied:"
|
Text="The following changes will be re-applied:"
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
Margin="0,0,0,8"/>
|
Margin="0,0,0,8"/>
|
||||||
|
|
||||||
@@ -307,13 +307,13 @@
|
|||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding DisplayText}" FontSize="12" Foreground="{DynamicResource FgColor}" TextWrapping="Wrap" Margin="0,0,0,6"/>
|
<TextBlock Text="{Binding DisplayText}" FontSize="12" Foreground="{DynamicResource AppFgColor}" TextWrapping="Wrap" Margin="0,0,0,6"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Border x:Name="NonRevertibleSeparator" Grid.Row="5" Height="1" Background="{DynamicResource BorderColor}" Margin="0,12,0,12" Visibility="Collapsed"/>
|
<Border x:Name="NonRevertibleSeparator" Grid.Row="5" Height="1" Background="{DynamicResource AppBorderColor}" Margin="0,12,0,12" Visibility="Collapsed"/>
|
||||||
|
|
||||||
<Grid x:Name="NonRevertiblePanel" Grid.Row="6" Visibility="Collapsed">
|
<Grid x:Name="NonRevertiblePanel" Grid.Row="6" Visibility="Collapsed">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@@ -325,7 +325,7 @@
|
|||||||
<TextBlock Grid.Row="0"
|
<TextBlock Grid.Row="0"
|
||||||
Text="The following changes won't be reverted:"
|
Text="The following changes won't be reverted:"
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
Margin="0,0,0,8"/>
|
Margin="0,0,0,8"/>
|
||||||
|
|
||||||
@@ -337,7 +337,7 @@
|
|||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding DisplayText}" FontSize="12" Foreground="{DynamicResource FgColor}" Opacity="0.85" TextWrapping="Wrap" Margin="0,0,0,6"/>
|
<TextBlock Text="{Binding DisplayText}" FontSize="12" Foreground="{DynamicResource AppFgColor}" Opacity="0.85" TextWrapping="Wrap" Margin="0,0,0,6"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
@@ -373,7 +373,7 @@
|
|||||||
FontSize="14"
|
FontSize="14"
|
||||||
LineHeight="20"
|
LineHeight="20"
|
||||||
Margin="0,0,0,12"
|
Margin="0,0,0,12"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
Text="This will restore the Start Menu pinned apps layout for the selected user(s) using a backup that is automatically created by Win11Debloat. Manually created backups can also be used."/>
|
Text="This will restore the Start Menu pinned apps layout for the selected user(s) using a backup that is automatically created by Win11Debloat. Manually created backups can also be used."/>
|
||||||
|
|
||||||
<ComboBox x:Name="StartMenuScopeCombo"
|
<ComboBox x:Name="StartMenuScopeCombo"
|
||||||
@@ -392,7 +392,7 @@
|
|||||||
IsChecked="True"
|
IsChecked="True"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
Margin="0,10,0,0"
|
Margin="0,10,0,0"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
Opacity="0.85"/>
|
Opacity="0.85"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
<!-- Primary Button Style -->
|
<!-- Primary Button Style -->
|
||||||
<Style x:Key="PrimaryButtonStyle" TargetType="Button">
|
<Style x:Key="PrimaryButtonStyle" TargetType="Button">
|
||||||
<Setter Property="Background" Value="{DynamicResource ButtonBg}"/>
|
<Setter Property="Background" Value="{DynamicResource ButtonBgColor}"/>
|
||||||
<Setter Property="Foreground" Value="white"/>
|
<Setter Property="Foreground" Value="white"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBg}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBgColor}"/>
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
<Setter Property="Padding" Value="0"/>
|
<Setter Property="Padding" Value="0"/>
|
||||||
<Setter Property="FontSize" Value="14"/>
|
<Setter Property="FontSize" Value="14"/>
|
||||||
@@ -25,25 +25,25 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
<Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
|
<Setter Property="Background" Value="{DynamicResource ButtonDisabledColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDisabled}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDisabledColor}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
|
<Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabledColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource ButtonHover}"/>
|
<Setter Property="Background" Value="{DynamicResource ButtonHoverColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonHover}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonHoverColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsPressed" Value="True">
|
<Trigger Property="IsPressed" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource ButtonPressed}"/>
|
<Setter Property="Background" Value="{DynamicResource ButtonPressedColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonPressed}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonPressedColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- Secondary Button Style -->
|
<!-- Secondary Button Style -->
|
||||||
<Style x:Key="SecondaryButtonStyle" TargetType="Button">
|
<Style x:Key="SecondaryButtonStyle" TargetType="Button">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonBg}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonBgColor}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
<Setter Property="Padding" Value="0"/>
|
<Setter Property="Padding" Value="0"/>
|
||||||
@@ -64,16 +64,16 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonDisabled}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonDisabledColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderColor}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource SecondaryButtonTextDisabled}"/>
|
<Setter Property="Foreground" Value="{DynamicResource SecondaryButtonTextDisabledColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHoverColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsPressed" Value="True">
|
<Trigger Property="IsPressed" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonPressed}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryButtonPressedColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
@@ -81,11 +81,11 @@
|
|||||||
|
|
||||||
<!-- Hyperlink Style -->
|
<!-- Hyperlink Style -->
|
||||||
<Style x:Key="HyperlinkStyle" TargetType="TextBlock">
|
<Style x:Key="HyperlinkStyle" TargetType="TextBlock">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ButtonBg}"/>
|
<Setter Property="Foreground" Value="{DynamicResource ButtonBgColor}"/>
|
||||||
<Setter Property="Cursor" Value="Hand"/>
|
<Setter Property="Cursor" Value="Hand"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ButtonHover}"/>
|
<Setter Property="Foreground" Value="{DynamicResource ButtonHoverColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
<!-- ProgressBar Style -->
|
<!-- ProgressBar Style -->
|
||||||
<Style x:Key="ApplyProgressBarStyle" TargetType="ProgressBar">
|
<Style x:Key="ApplyProgressBarStyle" TargetType="ProgressBar">
|
||||||
<Setter Property="Background" Value="{DynamicResource ButtonBorderColor}"/>
|
<Setter Property="Background" Value="{DynamicResource ButtonBorderColor}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ButtonBg}"/>
|
<Setter Property="Foreground" Value="{DynamicResource ButtonBgColor}"/>
|
||||||
<Setter Property="Height" Value="6"/>
|
<Setter Property="Height" Value="6"/>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
@@ -109,9 +109,9 @@
|
|||||||
|
|
||||||
<!-- Modal Title Style -->
|
<!-- Modal Title Style -->
|
||||||
<Style x:Key="ModalTitleStyle" TargetType="TextBlock">
|
<Style x:Key="ModalTitleStyle" TargetType="TextBlock">
|
||||||
<Setter Property="FontWeight" Value="Bold"/>
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||||
<Setter Property="FontSize" Value="20"/>
|
<Setter Property="FontSize" Value="20"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||||
<Setter Property="Margin" Value="0,0,0,8"/>
|
<Setter Property="Margin" Value="0,0,0,8"/>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
<!-- Modal Subtext Style -->
|
<!-- Modal Subtext Style -->
|
||||||
<Style x:Key="ModalSubtextStyle" TargetType="TextBlock">
|
<Style x:Key="ModalSubtextStyle" TargetType="TextBlock">
|
||||||
<Setter Property="FontSize" Value="13"/>
|
<Setter Property="FontSize" Value="13"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="Opacity" Value="0.8"/>
|
<Setter Property="Opacity" Value="0.8"/>
|
||||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||||
<Setter Property="TextAlignment" Value="Center"/>
|
<Setter Property="TextAlignment" Value="Center"/>
|
||||||
@@ -127,7 +127,7 @@
|
|||||||
|
|
||||||
<!-- Shared modal window shell styles -->
|
<!-- Shared modal window shell styles -->
|
||||||
<Style x:Key="ModalCardBorderStyle" TargetType="Border">
|
<Style x:Key="ModalCardBorderStyle" TargetType="Border">
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderColor}"/>
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
<Setter Property="CornerRadius" Value="8"/>
|
<Setter Property="CornerRadius" Value="8"/>
|
||||||
<Setter Property="Background" Value="{DynamicResource CardBgColor}"/>
|
<Setter Property="Background" Value="{DynamicResource CardBgColor}"/>
|
||||||
@@ -149,16 +149,16 @@
|
|||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="ModalTitleTextStyle" TargetType="TextBlock">
|
<Style x:Key="ModalTitleTextStyle" TargetType="TextBlock">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="FontSize" Value="16"/>
|
<Setter Property="FontSize" Value="20"/>
|
||||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
<Setter Property="Margin" Value="20,0,0,0"/>
|
<Setter Property="Margin" Value="16,0,0,0"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="ModalFooterBorderStyle" TargetType="Border">
|
<Style x:Key="ModalFooterBorderStyle" TargetType="Border">
|
||||||
<Setter Property="Background" Value="{DynamicResource BgColor}"/>
|
<Setter Property="Background" Value="{DynamicResource AppBgColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderColor}"/>
|
||||||
<Setter Property="BorderThickness" Value="0,1,0,0"/>
|
<Setter Property="BorderThickness" Value="0,1,0,0"/>
|
||||||
<Setter Property="Padding" Value="16,12"/>
|
<Setter Property="Padding" Value="16,12"/>
|
||||||
<Setter Property="CornerRadius" Value="0,0,8,8"/>
|
<Setter Property="CornerRadius" Value="0,0,8,8"/>
|
||||||
@@ -195,20 +195,20 @@
|
|||||||
|
|
||||||
<Style x:Key="ModalInfoLabelTextStyle" TargetType="TextBlock">
|
<Style x:Key="ModalInfoLabelTextStyle" TargetType="TextBlock">
|
||||||
<Setter Property="FontSize" Value="13"/>
|
<Setter Property="FontSize" Value="13"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||||
<Setter Property="Margin" Value="0,0,16,8"/>
|
<Setter Property="Margin" Value="0,0,16,8"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="ModalInfoValueTextStyle" TargetType="TextBlock">
|
<Style x:Key="ModalInfoValueTextStyle" TargetType="TextBlock">
|
||||||
<Setter Property="FontSize" Value="13"/>
|
<Setter Property="FontSize" Value="13"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="Margin" Value="0,0,0,8"/>
|
<Setter Property="Margin" Value="0,0,0,8"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- Shared ComboBox style used across windows -->
|
<!-- Shared ComboBox style used across windows -->
|
||||||
<Style TargetType="ComboBoxItem">
|
<Style TargetType="ComboBoxItem">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
<Setter Property="Padding" Value="10,8"/>
|
<Setter Property="Padding" Value="10,8"/>
|
||||||
<Setter Property="Margin" Value="0,0,0,4"/>
|
<Setter Property="Margin" Value="0,0,0,4"/>
|
||||||
@@ -223,14 +223,15 @@
|
|||||||
Padding="{TemplateBinding Padding}"
|
Padding="{TemplateBinding Padding}"
|
||||||
CornerRadius="4">
|
CornerRadius="4">
|
||||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
|
Margin="0,0,0,1"/>
|
||||||
</Border>
|
</Border>
|
||||||
<Border x:Name="AccentLine"
|
<Border x:Name="AccentLine"
|
||||||
Width="3"
|
Width="3"
|
||||||
Height="15"
|
Height="15"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Background="{DynamicResource ButtonBg}"
|
Background="{DynamicResource ButtonBgColor}"
|
||||||
CornerRadius="1.5"
|
CornerRadius="1.5"
|
||||||
Margin="0"
|
Margin="0"
|
||||||
Visibility="Collapsed"/>
|
Visibility="Collapsed"/>
|
||||||
@@ -238,10 +239,10 @@
|
|||||||
<ControlTemplate.Triggers>
|
<ControlTemplate.Triggers>
|
||||||
<Trigger Property="IsSelected" Value="True">
|
<Trigger Property="IsSelected" Value="True">
|
||||||
<Setter TargetName="AccentLine" Property="Visibility" Value="Visible"/>
|
<Setter TargetName="AccentLine" Property="Visibility" Value="Visible"/>
|
||||||
<Setter TargetName="ItemBorder" Property="Background" Value="{DynamicResource ComboItemSelectedColor}"/>
|
<Setter TargetName="ItemBorder" Property="Background" Value="{DynamicResource ComboBoxItemSelectedColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsHighlighted" Value="True">
|
<Trigger Property="IsHighlighted" Value="True">
|
||||||
<Setter TargetName="ItemBorder" Property="Background" Value="{DynamicResource ComboItemHoverColor}"/>
|
<Setter TargetName="ItemBorder" Property="Background" Value="{DynamicResource ComboBoxItemHoverColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
@@ -250,17 +251,18 @@
|
|||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style TargetType="ComboBox">
|
<Style TargetType="ComboBox">
|
||||||
<Setter Property="Background" Value="{DynamicResource ComboBgColor}"/>
|
<Setter Property="Background" Value="{DynamicResource ComboBoxBgColor}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderColor}"/>
|
||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
|
<Setter Property="FontSize" Value="13"/>
|
||||||
<Setter Property="Margin" Value="0,4,0,12"/>
|
<Setter Property="Margin" Value="0,4,0,12"/>
|
||||||
<Setter Property="MinHeight" Value="33"/>
|
<Setter Property="MinHeight" Value="33"/>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="ComboBox">
|
<ControlTemplate TargetType="ComboBox">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Border x:Name="ClosedAccentLine" Width="3" Height="18" HorizontalAlignment="Left" VerticalAlignment="Stretch" Background="{DynamicResource ButtonBg}" CornerRadius="1.5" Panel.ZIndex="2"/>
|
<Border x:Name="ClosedAccentLine" Width="3" Height="18" HorizontalAlignment="Left" VerticalAlignment="Stretch" Background="{DynamicResource ButtonBgColor}" CornerRadius="1.5" Panel.ZIndex="2"/>
|
||||||
<ToggleButton x:Name="ToggleButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Focusable="False" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press">
|
<ToggleButton x:Name="ToggleButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Focusable="False" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press">
|
||||||
<ToggleButton.Style>
|
<ToggleButton.Style>
|
||||||
<Style TargetType="ToggleButton">
|
<Style TargetType="ToggleButton">
|
||||||
@@ -275,7 +277,7 @@
|
|||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Margin="0,0,8,0"
|
Margin="0,0,8,0"
|
||||||
Foreground="{DynamicResource FgColor}"
|
Foreground="{DynamicResource AppFgColor}"
|
||||||
RenderTransformOrigin="0.5,0.5">
|
RenderTransformOrigin="0.5,0.5">
|
||||||
<TextBlock.RenderTransform>
|
<TextBlock.RenderTransform>
|
||||||
<RotateTransform Angle="0"/>
|
<RotateTransform Angle="0"/>
|
||||||
@@ -284,7 +286,7 @@
|
|||||||
</Border>
|
</Border>
|
||||||
<ControlTemplate.Triggers>
|
<ControlTemplate.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ComboHoverColor}"/>
|
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ComboBoxHoverColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsChecked" Value="True">
|
<Trigger Property="IsChecked" Value="True">
|
||||||
<Trigger.EnterActions>
|
<Trigger.EnterActions>
|
||||||
@@ -319,7 +321,7 @@
|
|||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
<ContentPresenter x:Name="ContentPresenter"
|
<ContentPresenter x:Name="ContentPresenter"
|
||||||
IsHitTestVisible="False"
|
IsHitTestVisible="False"
|
||||||
Margin="10,0,20,0"
|
Margin="10,0,20,2"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Content="{TemplateBinding SelectionBoxItem}"
|
Content="{TemplateBinding SelectionBoxItem}"
|
||||||
@@ -337,8 +339,8 @@
|
|||||||
HorizontalOffset="0">
|
HorizontalOffset="0">
|
||||||
<Grid x:Name="DropDown" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}" Margin="12">
|
<Grid x:Name="DropDown" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}" Margin="12">
|
||||||
<Border x:Name="DropDownBorder"
|
<Border x:Name="DropDownBorder"
|
||||||
Background="{DynamicResource ComboItemBgColor}"
|
Background="{DynamicResource ComboBoxItemBgColor}"
|
||||||
BorderBrush="{DynamicResource BorderColor}"
|
BorderBrush="{DynamicResource AppBorderColor}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
CornerRadius="4"
|
CornerRadius="4"
|
||||||
Padding="5,4,5,1">
|
Padding="5,4,5,1">
|
||||||
@@ -363,9 +365,9 @@
|
|||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
<Setter TargetName="ClosedAccentLine" Property="Visibility" Value="Collapsed"/>
|
<Setter TargetName="ClosedAccentLine" Property="Visibility" Value="Collapsed"/>
|
||||||
<Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
|
<Setter Property="Background" Value="{DynamicResource ButtonDisabledColor}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderColor}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
|
<Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabledColor}"/>
|
||||||
<Setter Property="Opacity" Value="0.6"/>
|
<Setter Property="Opacity" Value="0.6"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
@@ -376,8 +378,9 @@
|
|||||||
|
|
||||||
<!-- Base CheckBox style used across windows -->
|
<!-- Base CheckBox style used across windows -->
|
||||||
<Style TargetType="CheckBox">
|
<Style TargetType="CheckBox">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
|
<Setter Property="FontSize" Value="13"/>
|
||||||
<Setter Property="Padding" Value="4,2"/>
|
<Setter Property="Padding" Value="4,2"/>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
@@ -388,16 +391,16 @@
|
|||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Border x:Name="CheckBoxBorder" Grid.Column="0" Width="18" Height="18" Background="{DynamicResource CheckBoxBgColor}" BorderBrush="{DynamicResource CheckBoxBorderColor}" BorderThickness="1" CornerRadius="4" Margin="0,0,8,0">
|
<Border x:Name="CheckBoxBorder" Grid.Column="0" Width="20" Height="20" Background="{DynamicResource CheckBoxBgColor}" BorderBrush="{DynamicResource CheckBoxBorderColor}" BorderThickness="1" CornerRadius="4" Margin="0,0,8,0">
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextBlock x:Name="CheckMark" Text="" FontFamily="Segoe Fluent Icons" FontSize="12" Foreground="{DynamicResource ButtonBg}" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0">
|
<TextBlock x:Name="CheckMark" Text="" FontFamily="Segoe Fluent Icons" FontSize="13" FontWeight="SemiBold" Foreground="{DynamicResource ButtonBgColor}" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0">
|
||||||
<TextBlock.Clip>
|
<TextBlock.Clip>
|
||||||
<RectangleGeometry x:Name="CheckMarkClip" Rect="0,0,0,16"/>
|
<RectangleGeometry x:Name="CheckMarkClip" Rect="0,0,0,16"/>
|
||||||
</TextBlock.Clip>
|
</TextBlock.Clip>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock x:Name="IndeterminateMark" Text="" FontFamily="Segoe Fluent Icons" FontSize="11" Foreground="{DynamicResource ButtonBg}" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0" Margin="1,1,0,0">
|
<TextBlock x:Name="IndeterminateMark" Text="" FontFamily="Segoe Fluent Icons" FontSize="13" FontWeight="Bold" Foreground="{DynamicResource ButtonBgColor}" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0" Margin="1,0,0,1">
|
||||||
<TextBlock.Clip>
|
<TextBlock.Clip>
|
||||||
<RectangleGeometry x:Name="IndeterminateMarkClip" Rect="0,0,0,16"/>
|
<RectangleGeometry x:Name="IndeterminateMarkClip" Rect="0,0,0,12"/>
|
||||||
</TextBlock.Clip>
|
</TextBlock.Clip>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -410,8 +413,8 @@
|
|||||||
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource CheckBoxHoverColor}"/>
|
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource CheckBoxHoverColor}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsChecked" Value="True">
|
<Trigger Property="IsChecked" Value="True">
|
||||||
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource ButtonBg}"/>
|
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource ButtonBgColor}"/>
|
||||||
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource ButtonBg}"/>
|
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource ButtonBgColor}"/>
|
||||||
<Setter TargetName="CheckMark" Property="Foreground" Value="White"/>
|
<Setter TargetName="CheckMark" Property="Foreground" Value="White"/>
|
||||||
<Setter TargetName="CheckMark" Property="Opacity" Value="1"/>
|
<Setter TargetName="CheckMark" Property="Opacity" Value="1"/>
|
||||||
<Setter TargetName="IndeterminateMark" Property="Opacity" Value="0"/>
|
<Setter TargetName="IndeterminateMark" Property="Opacity" Value="0"/>
|
||||||
@@ -433,9 +436,8 @@
|
|||||||
</Trigger.ExitActions>
|
</Trigger.ExitActions>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsChecked" Value="{x:Null}">
|
<Trigger Property="IsChecked" Value="{x:Null}">
|
||||||
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource ButtonBg}"/>
|
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource ButtonBgColor}"/>
|
||||||
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource ButtonBg}"/>
|
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource ButtonBgColor}"/>
|
||||||
<Setter TargetName="CheckBoxBorder" Property="Opacity" Value="0.8"/>
|
|
||||||
<Setter TargetName="IndeterminateMark" Property="Foreground" Value="White"/>
|
<Setter TargetName="IndeterminateMark" Property="Foreground" Value="White"/>
|
||||||
<Setter TargetName="IndeterminateMark" Property="Opacity" Value="1"/>
|
<Setter TargetName="IndeterminateMark" Property="Opacity" Value="1"/>
|
||||||
<Setter TargetName="CheckMark" Property="Opacity" Value="0"/>
|
<Setter TargetName="CheckMark" Property="Opacity" Value="0"/>
|
||||||
@@ -461,8 +463,8 @@
|
|||||||
<Setter TargetName="IndeterminateMark" Property="Opacity" Value="0"/>
|
<Setter TargetName="IndeterminateMark" Property="Opacity" Value="0"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource ButtonDisabled}"/>
|
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource ButtonDisabledColor}"/>
|
||||||
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
|
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource AppBorderColor}"/>
|
||||||
<Setter Property="Opacity" Value="0.4"/>
|
<Setter Property="Opacity" Value="0.4"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<MultiTrigger>
|
<MultiTrigger>
|
||||||
@@ -470,16 +472,16 @@
|
|||||||
<Condition Property="IsMouseOver" Value="True"/>
|
<Condition Property="IsMouseOver" Value="True"/>
|
||||||
<Condition Property="IsChecked" Value="True"/>
|
<Condition Property="IsChecked" Value="True"/>
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource ButtonHover}"/>
|
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource ButtonHoverColor}"/>
|
||||||
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource ButtonHover}"/>
|
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource ButtonHoverColor}"/>
|
||||||
</MultiTrigger>
|
</MultiTrigger>
|
||||||
<MultiTrigger>
|
<MultiTrigger>
|
||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsMouseOver" Value="True"/>
|
<Condition Property="IsMouseOver" Value="True"/>
|
||||||
<Condition Property="IsChecked" Value="{x:Null}"/>
|
<Condition Property="IsChecked" Value="{x:Null}"/>
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource ButtonHover}"/>
|
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource ButtonHoverColor}"/>
|
||||||
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource ButtonHover}"/>
|
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource ButtonHoverColor}"/>
|
||||||
<Setter TargetName="CheckBoxBorder" Property="Opacity" Value="0.8"/>
|
<Setter TargetName="CheckBoxBorder" Property="Opacity" Value="0.8"/>
|
||||||
</MultiTrigger>
|
</MultiTrigger>
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
@@ -543,4 +545,47 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<!-- TextBox outer border: side/top borders in side color, background with hover/focus states -->
|
||||||
|
<Style x:Key="TextBoxBorderStyle" TargetType="Border">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource TextBoxBgColor}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxSideBorderColor}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="1,1,1,0"/>
|
||||||
|
<Setter Property="CornerRadius" Value="4"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource TextBoxHoverColor}"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsKeyboardFocusWithin" Value="True">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource TextBoxFocusColor}"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- TextBox inner border: bottom accent line that thickens and changes color on focus -->
|
||||||
|
<Style x:Key="TextBoxBottomBorderStyle" TargetType="Border">
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderColor}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="0,0,0,1"/>
|
||||||
|
<Setter Property="Padding" Value="8,6"/>
|
||||||
|
<Setter Property="CornerRadius" Value="0,0,4,4"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsKeyboardFocusWithin" Value="True">
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBgColor}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="0,0,0,2"/>
|
||||||
|
<Setter Property="Padding" Value="8,6,8,5"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- TextBox input (transparent, used inside TextBoxBorderStyle) -->
|
||||||
|
<Style x:Key="TextBoxInputStyle" TargetType="TextBox">
|
||||||
|
<Setter Property="CaretBrush" Value="{DynamicResource AppFgColor}"/>
|
||||||
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppFgColor}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
|
<Setter Property="FontSize" Value="13"/>
|
||||||
|
<Setter Property="Margin" Value="1,0,0,1"/>
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="Padding" Value="0"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
@@ -1,6 +1,22 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Returns a list of installed apps from winget as structured objects.
|
||||||
|
|
||||||
# Run winget list and return installed apps.
|
.DESCRIPTION
|
||||||
# Use -NonBlocking to keep the UI responsive (GUI mode) via Invoke-NonBlocking.
|
Runs `winget list` and parses the output into PSCustomObject arrays.
|
||||||
|
Use -NonBlocking to keep the UI responsive in GUI mode; otherwise
|
||||||
|
runs synchronously with an optional timeout.
|
||||||
|
|
||||||
|
.PARAMETER TimeOut
|
||||||
|
Maximum seconds to wait for winget to complete. Default is 10.
|
||||||
|
|
||||||
|
.PARAMETER NonBlocking
|
||||||
|
When set, runs via Invoke-NonBlocking so the GUI thread stays responsive.
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
PSCustomObject[] with Name and Id properties. Returns $null on
|
||||||
|
failure, or an empty array when winget succeeds but lists no apps.
|
||||||
|
#>
|
||||||
function GetInstalledAppsViaWinget {
|
function GetInstalledAppsViaWinget {
|
||||||
param (
|
param (
|
||||||
[int]$TimeOut = 10,
|
[int]$TimeOut = 10,
|
||||||
@@ -11,13 +27,76 @@ function GetInstalledAppsViaWinget {
|
|||||||
|
|
||||||
$fetchBlock = {
|
$fetchBlock = {
|
||||||
param($timeOut)
|
param($timeOut)
|
||||||
$job = Start-Job { return winget list --accept-source-agreements --disable-interactivity }
|
$job = Start-Job {
|
||||||
|
$rawOutput = $null
|
||||||
|
try {
|
||||||
|
$originalEncoding = [Console]::OutputEncoding
|
||||||
|
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()
|
||||||
|
try {
|
||||||
|
$rawOutput = winget list --accept-source-agreements --disable-interactivity
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
[Console]::OutputEncoding = $originalEncoding
|
||||||
|
}
|
||||||
|
return $rawOutput
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return $null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$done = $job | Wait-Job -Timeout $timeOut
|
$done = $job | Wait-Job -Timeout $timeOut
|
||||||
if ($done) {
|
if ($done) {
|
||||||
$result = Receive-Job -Job $job
|
$result = Receive-Job -Job $job
|
||||||
Remove-Job -Job $job -ErrorAction SilentlyContinue
|
Remove-Job -Job $job -ErrorAction SilentlyContinue
|
||||||
return $result
|
|
||||||
|
if (-not $result) { return $null }
|
||||||
|
|
||||||
|
# winget list outputs:
|
||||||
|
# [progress line] / [blank] / header / --- separator / data rows
|
||||||
|
$textOutput = $result -join "`n"
|
||||||
|
$lines = $textOutput -split "`r`n|`n"
|
||||||
|
|
||||||
|
# Find the separator line to know where data starts
|
||||||
|
$dataStart = -1
|
||||||
|
for ($i = 0; $i -lt $lines.Count; $i++) {
|
||||||
|
if ($lines[$i] -match '^-{3,}') {
|
||||||
|
$dataStart = $i + 1
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($dataStart -lt 0 -or $dataStart -ge $lines.Count) { return @() }
|
||||||
|
|
||||||
|
$apps = [System.Collections.Generic.List[object]]::new()
|
||||||
|
|
||||||
|
for ($i = $dataStart; $i -lt $lines.Count; $i++) {
|
||||||
|
$line = $lines[$i]
|
||||||
|
if ($line.Trim() -eq '') { continue }
|
||||||
|
|
||||||
|
try {
|
||||||
|
# Split on 2+ spaces; extract Name and Id columns.
|
||||||
|
$fields = [regex]::Split($line.Trim(), '\s{2,}')
|
||||||
|
if ($fields.Count -lt 2) { continue }
|
||||||
|
|
||||||
|
$name = $fields[0].Trim()
|
||||||
|
$id = $fields[1].Trim()
|
||||||
|
|
||||||
|
if (-not $id) { continue }
|
||||||
|
|
||||||
|
$null = $apps.Add([PSCustomObject]@{
|
||||||
|
Name = $name
|
||||||
|
Id = $id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
# Skip lines that can't be parsed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return @($apps)
|
||||||
|
}
|
||||||
|
|
||||||
Remove-Job -Job $job -Force -ErrorAction SilentlyContinue
|
Remove-Job -Job $job -Force -ErrorAction SilentlyContinue
|
||||||
return $null
|
return $null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,104 +1,200 @@
|
|||||||
# Removes apps specified during function call based on the target scope.
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Removes one or more Windows app packages based on the target scope.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Iterates over the provided list of app identifiers and removes each one.
|
||||||
|
The removal method (winget vs. Appx cmdlets) is determined per-app from
|
||||||
|
Apps.json. Microsoft Edge is deferred to the end of the loop so that all
|
||||||
|
winget attempts run before any force-remove prompt. A scheduled task is
|
||||||
|
only created when the User or Sysprep parameter was passed.
|
||||||
|
After each winget removal, the system is checked to confirm whether the
|
||||||
|
app is still installed before reporting an error.
|
||||||
|
|
||||||
|
.PARAMETER appsList
|
||||||
|
An array of app package identifiers to remove (e.g. 'Microsoft.BingNews').
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
RemoveApps @('Microsoft.BingNews', 'Microsoft.BingWeather')
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
RemoveApps -appsList (GenerateAppsList)
|
||||||
|
#>
|
||||||
function RemoveApps {
|
function RemoveApps {
|
||||||
param (
|
param (
|
||||||
$appslist
|
$appslist
|
||||||
)
|
)
|
||||||
|
|
||||||
# Determine target from script-level params, defaulting to AllUsers
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
$targetUser = GetTargetUserForAppRemoval
|
foreach ($app in $appslist) {
|
||||||
|
Write-Host "[WhatIf] Remove App Package: $app" -ForegroundColor Cyan
|
||||||
|
}
|
||||||
|
|
||||||
$appIndex = 0
|
Write-Host ""
|
||||||
$appCount = @($appsList).Count
|
|
||||||
$edgeIds = @('Microsoft.Edge', 'XPFFTQ037JWMHS')
|
|
||||||
$edgeUninstallSucceeded = $false
|
|
||||||
$edgeScheduledTaskAdded = $false
|
|
||||||
|
|
||||||
Foreach ($app in $appsList) {
|
|
||||||
if ($script:CancelRequested) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$targetUser = GetTargetUserForAppRemoval
|
||||||
|
$appCount = @($appsList).Count
|
||||||
|
$appIndex = 0
|
||||||
|
|
||||||
|
$edgeIds = @('Microsoft.Edge', 'XPFFTQ037JWMHS')
|
||||||
|
$edgeAppsInList = @()
|
||||||
|
$wingetRemovedApps = @()
|
||||||
|
|
||||||
|
Foreach ($app in $appsList) {
|
||||||
|
if ($script:CancelRequested) { return }
|
||||||
|
|
||||||
$appIndex++
|
$appIndex++
|
||||||
|
|
||||||
# Update step name and sub-progress to show which app is being removed (only for bulk removal)
|
|
||||||
if ($script:ApplySubStepCallback -and $appCount -gt 1) {
|
if ($script:ApplySubStepCallback -and $appCount -gt 1) {
|
||||||
& $script:ApplySubStepCallback "Removing apps ($appIndex/$appCount)" $appIndex $appCount
|
& $script:ApplySubStepCallback "Removing apps ($appIndex/$appCount)" $appIndex $appCount
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "Attempting to remove $app..."
|
# Microsoft Edge is handled after the loop to avoid duplicate scheduled tasks and allow fallback if winget fails
|
||||||
|
if ($edgeIds -contains $app) {
|
||||||
# Use WinGet only to remove OneDrive and Edge
|
$edgeAppsInList += $app
|
||||||
if (($app -eq "Microsoft.OneDrive") -or ($edgeIds -contains $app)) {
|
|
||||||
if ($script:WingetInstalled -eq $false) {
|
|
||||||
Write-Host "WinGet is either not installed or is outdated, $app could not be removed" -ForegroundColor Red
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
$isEdgeId = $edgeIds -contains $app
|
Write-Host "Removing $app"
|
||||||
$appName = if ($isEdgeId) { 'Microsoft_Edge' } else { $app -replace '\.', '_' }
|
|
||||||
|
|
||||||
# Uninstall app via WinGet, or create a scheduled task to uninstall it later
|
if ((Get-AppRemovalMethod $app) -eq 'WinGet') {
|
||||||
if ($script:Params.ContainsKey("User")) {
|
Remove-WinGetApp -app $app
|
||||||
if (-not ($isEdgeId -and $edgeScheduledTaskAdded)) {
|
$wingetRemovedApps += $app
|
||||||
ImportRegistryFile "Adding scheduled task to uninstall $app for user $(GetUserName)..." "Uninstall_$($appName).reg"
|
|
||||||
if ($isEdgeId) { $edgeScheduledTaskAdded = $true }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elseif ($script:Params.ContainsKey("Sysprep")) {
|
|
||||||
if (-not ($isEdgeId -and $edgeScheduledTaskAdded)) {
|
|
||||||
ImportRegistryFile "Adding scheduled task to uninstall $app after for new users..." "Uninstall_$($appName).reg"
|
|
||||||
if ($isEdgeId) { $edgeScheduledTaskAdded = $true }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# Uninstall app via WinGet
|
Remove-AppxApp -app $app -targetUser $targetUser
|
||||||
$wingetOutput = Invoke-NonBlocking -ScriptBlock {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Remove Microsoft Edge
|
||||||
|
if ($edgeAppsInList.Count -gt 0) {
|
||||||
|
Remove-EdgeApp -edgeAppsInList $edgeAppsInList
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check whether any winget-removed apps are still present, and report errors for each one.
|
||||||
|
if ($wingetRemovedApps.Count -gt 0 -or $edgeAppsInList.Count -gt 0) {
|
||||||
|
$postRemovalList = if ($script:WingetInstalled) { GetInstalledAppsViaWinget -TimeOut 10 -NonBlocking } else { $null }
|
||||||
|
foreach ($app in $wingetRemovedApps) {
|
||||||
|
if (Test-AppStillInstalled -appId $app -InstalledList $postRemovalList) {
|
||||||
|
Write-Host "Unable to uninstall $app via WinGet" -ForegroundColor Red
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Verify Edge separately (triggers its own force-remove path if still installed)
|
||||||
|
$edgeStillInstalled = $false
|
||||||
|
foreach ($edgeApp in $edgeAppsInList) {
|
||||||
|
if (Test-AppStillInstalled -appId $edgeApp -InstalledList $postRemovalList) {
|
||||||
|
$edgeStillInstalled = $true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($edgeStillInstalled) {
|
||||||
|
Write-Host "Unable to uninstall Microsoft Edge via WinGet" -ForegroundColor Red
|
||||||
|
Request-EdgeForceRemove
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host ""
|
||||||
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Uninstalls a non-Edge app via WinGet and/or schedules its removal.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Runs winget uninstall for a single app. If the User or Sysprep
|
||||||
|
parameter was passed, also schedules removal for future logins.
|
||||||
|
After uninstall, the system is checked to confirm whether the app
|
||||||
|
is still present — winget output is not trusted on its
|
||||||
|
own, as it sometimes reports failure after a successful removal.
|
||||||
|
Edge apps are handled separately after the main loop.
|
||||||
|
|
||||||
|
.PARAMETER app
|
||||||
|
The WinGet package ID to uninstall (e.g. 'Microsoft.BingNews').
|
||||||
|
#>
|
||||||
|
function Remove-WinGetApp {
|
||||||
|
param([string]$app)
|
||||||
|
|
||||||
|
if (-not $script:WingetInstalled) {
|
||||||
|
Write-Host "ERROR: WinGet is either not installed or is outdated, $app could not be removed" -ForegroundColor Red
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($script:Params.ContainsKey("User")) {
|
||||||
|
Write-Host "Adding scheduled task to uninstall $app for user $(GetUserName)..."
|
||||||
|
Set-RunOnceWingetTask -appId $app
|
||||||
|
}
|
||||||
|
elseif ($script:Params.ContainsKey("Sysprep")) {
|
||||||
|
Write-Host "Adding scheduled task to uninstall $app for new users..."
|
||||||
|
Set-RunOnceWingetTask -appId $app
|
||||||
|
}
|
||||||
|
|
||||||
|
Invoke-NonBlocking -ScriptBlock {
|
||||||
param($appId)
|
param($appId)
|
||||||
winget uninstall --accept-source-agreements --disable-interactivity --id $appId
|
winget uninstall --accept-source-agreements --disable-interactivity --id $appId
|
||||||
} -ArgumentList $app
|
} -ArgumentList $app
|
||||||
|
}
|
||||||
|
|
||||||
$wingetFailed = Select-String -InputObject $wingetOutput -Pattern "Uninstall failed with exit code|No installed package found matching input criteria|No package found matching input criteria" -SimpleMatch:$false
|
<#
|
||||||
if ($isEdgeId) {
|
.SYNOPSIS
|
||||||
if (-not $wingetFailed) {
|
Removes Microsoft Edge via WinGet (both AppIds), with fallback to force-remove.
|
||||||
$edgeUninstallSucceeded = $true
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Edge has multiple package IDs. Runs winget uninstall for each one,
|
||||||
|
then creates a single scheduled task if the User or Sysprep parameter
|
||||||
|
was passed. After all attempts, the system is checked to confirm
|
||||||
|
whether Edge is still present. The force-remove prompt only
|
||||||
|
appears if Edge remains installed — winget false positives are ignored.
|
||||||
|
|
||||||
|
.PARAMETER edgeAppsInList
|
||||||
|
The Edge AppIds that appear in the removal list (one or both).
|
||||||
|
#>
|
||||||
|
function Remove-EdgeApp {
|
||||||
|
param([string[]]$edgeAppsInList)
|
||||||
|
|
||||||
|
if (-not $script:WingetInstalled) {
|
||||||
|
Write-Host "ERROR: WinGet is either not installed or is outdated, Microsoft Edge could not be removed" -ForegroundColor Red
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
# Prompt immediately after the final selected Edge ID attempt (if all attempts failed)
|
if ($script:Params.ContainsKey("User")) {
|
||||||
$hasRemainingEdgeIds = $false
|
Write-Host "Adding scheduled task to uninstall Microsoft Edge for user $(GetUserName)..."
|
||||||
if ($appIndex -lt $appCount) {
|
Set-RunOnceWingetTask -appId 'Microsoft.Edge'
|
||||||
$remainingApps = @($appsList)[($appIndex)..($appCount - 1)]
|
}
|
||||||
$hasRemainingEdgeIds = @($remainingApps | Where-Object { $edgeIds -contains $_ }).Count -gt 0
|
elseif ($script:Params.ContainsKey("Sysprep")) {
|
||||||
|
Write-Host "Adding scheduled task to uninstall Microsoft Edge for new users..."
|
||||||
|
Set-RunOnceWingetTask -appId 'Microsoft.Edge'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not $hasRemainingEdgeIds -and -not $edgeUninstallSucceeded) {
|
foreach ($edgeApp in $edgeAppsInList) {
|
||||||
Write-Host "Unable to uninstall Microsoft Edge via WinGet" -ForegroundColor Red
|
Write-Host "Removing $edgeApp"
|
||||||
|
Invoke-NonBlocking -ScriptBlock {
|
||||||
|
param($appId)
|
||||||
|
winget uninstall --accept-source-agreements --disable-interactivity --id $appId
|
||||||
|
} -ArgumentList $edgeApp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($script:GuiWindow) {
|
<#
|
||||||
$result = Show-MessageBox -Message 'Unable to uninstall Microsoft Edge via WinGet. Would you like to forcefully uninstall it? NOT RECOMMENDED!' -Title 'Force Uninstall Microsoft Edge?' -Button 'YesNo' -Icon 'Warning'
|
.SYNOPSIS
|
||||||
|
Removes an app via Remove-AppxPackage / Remove-ProvisionedAppxPackage.
|
||||||
|
|
||||||
if ($result -eq 'Yes') {
|
.PARAMETER app
|
||||||
Write-Host ""
|
The package identifier to remove (e.g. 'Clipchamp.Clipchamp').
|
||||||
ForceRemoveEdge
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elseif ($( Read-Host -Prompt "Would you like to forcefully uninstall Microsoft Edge? NOT RECOMMENDED! (y/n)" ) -eq 'y') {
|
|
||||||
Write-Host ""
|
|
||||||
ForceRemoveEdge
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
continue
|
.PARAMETER targetUser
|
||||||
}
|
Target scope: "AllUsers", "CurrentUser", or a specific username.
|
||||||
|
#>
|
||||||
|
function Remove-AppxApp {
|
||||||
|
param([string]$app, [string]$targetUser)
|
||||||
|
|
||||||
# Use Remove-AppxPackage to remove all other apps
|
|
||||||
$appPattern = '*' + $app + '*'
|
$appPattern = '*' + $app + '*'
|
||||||
|
|
||||||
try {
|
try {
|
||||||
switch ($targetUser) {
|
switch ($targetUser) {
|
||||||
"AllUsers" {
|
"AllUsers" {
|
||||||
# Remove installed app for all existing users, and from OS image
|
|
||||||
Invoke-NonBlocking -ScriptBlock {
|
Invoke-NonBlocking -ScriptBlock {
|
||||||
param($pattern)
|
param($pattern)
|
||||||
Get-AppxPackage -Name $pattern -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction Continue
|
Get-AppxPackage -Name $pattern -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction Continue
|
||||||
@@ -106,14 +202,12 @@ function RemoveApps {
|
|||||||
} -ArgumentList $appPattern
|
} -ArgumentList $appPattern
|
||||||
}
|
}
|
||||||
"CurrentUser" {
|
"CurrentUser" {
|
||||||
# Remove installed app for current user only
|
|
||||||
Invoke-NonBlocking -ScriptBlock {
|
Invoke-NonBlocking -ScriptBlock {
|
||||||
param($pattern)
|
param($pattern)
|
||||||
Get-AppxPackage -Name $pattern | Remove-AppxPackage -ErrorAction Continue
|
Get-AppxPackage -Name $pattern | Remove-AppxPackage -ErrorAction Continue
|
||||||
} -ArgumentList $appPattern
|
} -ArgumentList $appPattern
|
||||||
}
|
}
|
||||||
default {
|
default {
|
||||||
# Target is a specific username - remove app for that user only
|
|
||||||
Invoke-NonBlocking -ScriptBlock {
|
Invoke-NonBlocking -ScriptBlock {
|
||||||
param($pattern, $user)
|
param($pattern, $user)
|
||||||
$userAccount = New-Object System.Security.Principal.NTAccount($user)
|
$userAccount = New-Object System.Security.Principal.NTAccount($user)
|
||||||
@@ -126,7 +220,173 @@ function RemoveApps {
|
|||||||
catch {
|
catch {
|
||||||
Write-Verbose "Something went wrong while trying to remove $($app): $_"
|
Write-Verbose "Something went wrong while trying to remove $($app): $_"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Checks whether an app package is still installed after a removal attempt.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Checks Get-AppxPackage across all users first (fast, no process launch),
|
||||||
|
then falls back to a pre-fetched or live winget list for non-Appx packages.
|
||||||
|
Uses Test-AppInWingetList which provides exact-match-first with substring
|
||||||
|
fallback against the parsed winget objects.
|
||||||
|
Returns $true if the app is still present, $false otherwise.
|
||||||
|
|
||||||
|
.PARAMETER appId
|
||||||
|
The package identifier to check (e.g. 'Microsoft.BingNews').
|
||||||
|
|
||||||
|
.PARAMETER InstalledList
|
||||||
|
Optional pre-fetched array of winget objects from GetInstalledAppsViaWinget.
|
||||||
|
When provided, used directly; otherwise a live winget call is made.
|
||||||
|
#>
|
||||||
|
function Test-AppStillInstalled {
|
||||||
|
param(
|
||||||
|
[string]$appId,
|
||||||
|
[object[]]$InstalledList
|
||||||
|
)
|
||||||
|
|
||||||
|
# Check Get-AppxPackage for all users first (fast, covers all Store apps).
|
||||||
|
if (Get-AppxPackage -Name "$appId" -AllUsers -ErrorAction SilentlyContinue) {
|
||||||
|
return $true
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host ""
|
# Use the pre-fetched list if provided; otherwise fall back to a live winget call.
|
||||||
|
if ($InstalledList) {
|
||||||
|
return (Test-AppInWingetList -appId $appId -InstalledList $InstalledList)
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($script:WingetInstalled) {
|
||||||
|
$liveList = GetInstalledAppsViaWinget -TimeOut 10 -NonBlocking
|
||||||
|
if (Test-AppInWingetList -appId $appId -InstalledList $liveList) {
|
||||||
|
return $true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Warning "Unable to verify whether '$appId' is still installed (WinGet is unavailable)"
|
||||||
|
}
|
||||||
|
|
||||||
|
return $false
|
||||||
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Returns the removal method for an app identifier.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Parses Apps.json once (cached in script scope) to build a lookup of
|
||||||
|
AppId -> RemovalMethod. Returns 'WinGet' if the app should be removed
|
||||||
|
via winget, or 'Appx' if via Remove-AppxPackage. Defaults to 'Appx'
|
||||||
|
for unknown IDs.
|
||||||
|
|
||||||
|
.PARAMETER appId
|
||||||
|
The package identifier (e.g. 'Clipchamp.Clipchamp').
|
||||||
|
#>
|
||||||
|
function Get-AppRemovalMethod {
|
||||||
|
param([string]$appId)
|
||||||
|
|
||||||
|
if (-not $script:AppRemovalMethodCache) {
|
||||||
|
$script:AppRemovalMethodCache = @{}
|
||||||
|
try {
|
||||||
|
if (Test-Path $script:AppsListFilePath) {
|
||||||
|
$appsJson = Get-Content -Path $script:AppsListFilePath -Raw | ConvertFrom-Json
|
||||||
|
foreach ($appData in $appsJson.Apps) {
|
||||||
|
$rawMethod = $appData.RemovalMethod
|
||||||
|
$method = if ($rawMethod -and $rawMethod -eq 'WinGet') { 'WinGet' } else { 'Appx' }
|
||||||
|
if ($appData.AppId -is [array]) {
|
||||||
|
foreach ($id in $appData.AppId) { $script:AppRemovalMethodCache[$id.Trim()] = $method }
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$script:AppRemovalMethodCache[$appData.AppId.Trim()] = $method
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
Write-Warning "Failed to load app removal methods from '$script:AppsListFilePath'. Defaulting unknown apps to Appx. Error: $_"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($script:AppRemovalMethodCache.ContainsKey($appId)) {
|
||||||
|
return $script:AppRemovalMethodCache[$appId]
|
||||||
|
}
|
||||||
|
return 'Appx'
|
||||||
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Prompts the user to forcefully remove Microsoft Edge when winget cannot uninstall it.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Only invoked after it has been confirmed that Edge is still present
|
||||||
|
following all winget uninstall attempts. In GUI mode, displays a
|
||||||
|
warning message box; in CLI mode, prompts via Read-Host. On
|
||||||
|
confirmation, performs a force-remove of the Edge package.
|
||||||
|
#>
|
||||||
|
function Request-EdgeForceRemove {
|
||||||
|
if ($script:GuiWindow) {
|
||||||
|
$result = Show-MessageBox -Message 'Unable to uninstall Microsoft Edge via WinGet. Would you like to forcefully uninstall it? NOT RECOMMENDED!' -Title 'Force Uninstall Microsoft Edge?' -Button 'YesNo' -Icon 'Warning'
|
||||||
|
if ($result -eq 'Yes') {
|
||||||
|
Write-Host ""
|
||||||
|
ForceRemoveEdge
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ($(Read-Host -Prompt "Would you like to forcefully uninstall Microsoft Edge? NOT RECOMMENDED! (y/n)") -eq 'y') {
|
||||||
|
Write-Host ""
|
||||||
|
ForceRemoveEdge
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Dynamically sets a RunOnce registry key to schedule a winget uninstall.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Writes directly to HKEY_USERS\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
|
||||||
|
via the PowerShell registry API within Invoke-WithTargetUserHive,
|
||||||
|
which handles hive loading and HKEY_USERS\Default → SID remapping.
|
||||||
|
Used instead of static .reg files to avoid file dependency for each WinGet app.
|
||||||
|
|
||||||
|
The winget command is Base64-encoded and invoked via powershell.exe -EncodedCommand
|
||||||
|
rather than interpolated directly into cmd.exe /c. This prevents shell metacharacters
|
||||||
|
(such as &, |, <, >, ^, ") in the app ID from being interpreted as command syntax,
|
||||||
|
even if future catalog updates introduce IDs containing those characters.
|
||||||
|
|
||||||
|
.PARAMETER appId
|
||||||
|
The winget package ID to schedule for uninstall (e.g. 'XP9CXNGPPJ97XX').
|
||||||
|
#>
|
||||||
|
function Set-RunOnceWingetTask {
|
||||||
|
param([string]$appId)
|
||||||
|
|
||||||
|
$targetUserName = if ($script:Params.ContainsKey("Sysprep")) { "Default" } else { $script:Params.Item("User") }
|
||||||
|
|
||||||
|
# Sanitize appId for use in registry value names (backslashes are path separators)
|
||||||
|
$safeAppId = $appId.Replace('\', '_')
|
||||||
|
|
||||||
|
$taskName = "Uninstall_$safeAppId"
|
||||||
|
|
||||||
|
# Escape single quotes in appId, then wrap in single quotes so cmd/pwsh metacharacters
|
||||||
|
# like & | < > ^ " are treated as literals. Base64-encode the whole command so the
|
||||||
|
# RunOnce value contains only [A-Za-z0-9+/=] — safe in any shell parser.
|
||||||
|
$escapedAppId = $appId.Replace("'", "''")
|
||||||
|
$wingetCommand = "winget uninstall --accept-source-agreements --disable-interactivity --id '$escapedAppId'"
|
||||||
|
$encodedWingetCommand = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($wingetCommand))
|
||||||
|
|
||||||
|
$operation = [PSCustomObject]@{
|
||||||
|
KeyPath = 'HKEY_USERS\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce'
|
||||||
|
ValueName = $taskName
|
||||||
|
ValueType = 'String'
|
||||||
|
ValueData = "powershell.exe -NoProfile -EncodedCommand $encodedWingetCommand"
|
||||||
|
OperationType = 'SetValue'
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
Invoke-WithTargetUserHive -TargetUserName $targetUserName -ScriptBlock {
|
||||||
|
param($op)
|
||||||
|
Invoke-RegistryOperation -Operation $op -RegFilePath '<dynamic>'
|
||||||
|
} -ArgumentObject $operation
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
Write-Host "Failed to schedule uninstall task for $($appId): $_" -ForegroundColor Red
|
||||||
|
}
|
||||||
}
|
}
|
||||||
43
Scripts/AppRemoval/Test-AppInWingetList.ps1
Normal file
43
Scripts/AppRemoval/Test-AppInWingetList.ps1
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Checks whether an app ID appears in a parsed winget installed list.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Tries an exact match against the .Id property first. When that
|
||||||
|
fails, falls back to a substring search guarded by a word-boundary
|
||||||
|
regex so that short IDs don't accidentally match longer ones
|
||||||
|
(e.g. 'Microsoft.Edge' will not match 'Microsoft.EdgeDev').
|
||||||
|
|
||||||
|
.PARAMETER appId
|
||||||
|
The identifier to search for (e.g. 'Microsoft.Copilot').
|
||||||
|
|
||||||
|
.PARAMETER InstalledList
|
||||||
|
An array of PSCustomObject from GetInstalledAppsViaWinget.
|
||||||
|
#>
|
||||||
|
function Test-AppInWingetList {
|
||||||
|
param(
|
||||||
|
[string]$appId,
|
||||||
|
[object[]]$InstalledList
|
||||||
|
)
|
||||||
|
|
||||||
|
if (-not $InstalledList) { return $false }
|
||||||
|
|
||||||
|
# Normalize to array
|
||||||
|
$list = @($InstalledList)
|
||||||
|
|
||||||
|
# Exact match first (fast and precise)
|
||||||
|
if ($list.Id -contains $appId) {
|
||||||
|
return $true
|
||||||
|
}
|
||||||
|
|
||||||
|
# Substring fallback with word-boundary guard
|
||||||
|
$boundaryPattern = '(?<![a-zA-Z0-9])' + [regex]::Escape($appId) + '(?![a-zA-Z0-9])'
|
||||||
|
|
||||||
|
foreach ($entry in $list) {
|
||||||
|
if ($entry.Id -like "*$appId*" -and $entry.Id -match $boundaryPattern) {
|
||||||
|
return $true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $false
|
||||||
|
}
|
||||||
@@ -1,4 +1,17 @@
|
|||||||
# Prints all pending changes that will be made by the script
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Prints a summary of all pending changes to the console for the user to review.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Iterates over every non-control parameter in $script:Params and emits a
|
||||||
|
human-readable line for each change that will be applied. For the
|
||||||
|
'RemoveApps' parameter the list of targeted app names is displayed
|
||||||
|
inline. Feature labels are resolved from Features.json when available;
|
||||||
|
otherwise the raw parameter name is used as a fallback.
|
||||||
|
|
||||||
|
After printing the summary the function pauses until the user presses
|
||||||
|
Enter, giving them an opportunity to review and cancel via Ctrl+C.
|
||||||
|
#>
|
||||||
function PrintPendingChanges {
|
function PrintPendingChanges {
|
||||||
Write-Output "Win11Debloat will make the following changes:"
|
Write-Output "Win11Debloat will make the following changes:"
|
||||||
|
|
||||||
@@ -31,28 +44,9 @@ function PrintPendingChanges {
|
|||||||
Write-Host $appsList -ForegroundColor DarkGray
|
Write-Host $appsList -ForegroundColor DarkGray
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
'RemoveAppsCustom' {
|
|
||||||
$appsList = LoadAppsFromFile $script:CustomAppsListFilePath
|
|
||||||
|
|
||||||
if ($appsList.Count -eq 0) {
|
|
||||||
Write-Host "No valid apps were selected for removal" -ForegroundColor Yellow
|
|
||||||
Write-Output ""
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Output "- Remove $($appsList.Count) apps:"
|
|
||||||
Write-Host $appsList -ForegroundColor DarkGray
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
default {
|
default {
|
||||||
if ($script:Features -and $script:Features.ContainsKey($parameterName)) {
|
|
||||||
$message = $script:Features[$parameterName].Label
|
$message = $script:Features[$parameterName].Label
|
||||||
Write-Output "- $message"
|
Write-Output "- $message"
|
||||||
}
|
|
||||||
else {
|
|
||||||
# Fallback: show the parameter name if no feature description is available
|
|
||||||
Write-Output "- $parameterName"
|
|
||||||
}
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ function ShowCLIAppRemoval {
|
|||||||
|
|
||||||
if ($result -eq $true) {
|
if ($result -eq $true) {
|
||||||
Write-Output "You have selected $($script:SelectedApps.Count) apps for removal"
|
Write-Output "You have selected $($script:SelectedApps.Count) apps for removal"
|
||||||
AddParameter 'RemoveAppsCustom'
|
AddParameter 'RemoveApps'
|
||||||
|
AddParameter 'Apps' ($script:SelectedApps -join ',')
|
||||||
|
|
||||||
SaveSettings
|
SaveSettings
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ function ShowCLIDefaultModeOptions {
|
|||||||
AddParameter 'Apps' 'Default'
|
AddParameter 'Apps' 'Default'
|
||||||
}
|
}
|
||||||
'2' {
|
'2' {
|
||||||
AddParameter 'RemoveAppsCustom'
|
AddParameter 'RemoveApps'
|
||||||
|
AddParameter 'Apps' ($script:SelectedApps -join ',')
|
||||||
|
|
||||||
if ($DisableGameBarIntegrationInput) {
|
if ($DisableGameBarIntegrationInput) {
|
||||||
AddParameter 'DisableDVR'
|
AddParameter 'DisableDVR'
|
||||||
|
|||||||
@@ -1,17 +1,10 @@
|
|||||||
function Get-FeatureId {
|
<#
|
||||||
param(
|
.SYNOPSIS
|
||||||
[Parameter(Mandatory)]
|
Filters a list of features to those that have a non-empty RegistryKey.
|
||||||
$Feature
|
|
||||||
)
|
|
||||||
|
|
||||||
$featureId = [string]$Feature.FeatureId
|
|
||||||
if ([string]::IsNullOrWhiteSpace($featureId)) {
|
|
||||||
throw 'Selected feature is missing required FeatureId.'
|
|
||||||
}
|
|
||||||
|
|
||||||
return $featureId
|
|
||||||
}
|
|
||||||
|
|
||||||
|
.PARAMETER Features
|
||||||
|
An array of feature objects to filter.
|
||||||
|
#>
|
||||||
function Get-RegistryBackedFeatures {
|
function Get-RegistryBackedFeatures {
|
||||||
param(
|
param(
|
||||||
[object[]]$Features = @()
|
[object[]]$Features = @()
|
||||||
|
|||||||
@@ -1,3 +1,18 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Creates a timestamped JSON backup of registry state for selected features.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Resolves selected and undo features from the provided keys, captures their
|
||||||
|
registry state, and saves the result as a JSON file in the Backups/ folder.
|
||||||
|
Returns the file path on success, $null if no registry-backed features exist.
|
||||||
|
|
||||||
|
.PARAMETER ActionableKeys
|
||||||
|
Param keys from $script:Params to resolve into apply features.
|
||||||
|
|
||||||
|
.PARAMETER ExtraFeatures
|
||||||
|
Additional synthetic feature objects (e.g. undo features) to include.
|
||||||
|
#>
|
||||||
function New-RegistrySettingsBackup {
|
function New-RegistrySettingsBackup {
|
||||||
param(
|
param(
|
||||||
[string[]]$ActionableKeys,
|
[string[]]$ActionableKeys,
|
||||||
@@ -32,6 +47,13 @@ function New-RegistrySettingsBackup {
|
|||||||
return $backupFilePath
|
return $backupFilePath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Resolves param keys into deduplicated feature objects from the catalog.
|
||||||
|
|
||||||
|
.PARAMETER ActionableKeys
|
||||||
|
Param keys to look up in $script:Features.
|
||||||
|
#>
|
||||||
function Get-SelectedFeatures {
|
function Get-SelectedFeatures {
|
||||||
param(
|
param(
|
||||||
[string[]]$ActionableKeys
|
[string[]]$ActionableKeys
|
||||||
@@ -46,8 +68,7 @@ function Get-SelectedFeatures {
|
|||||||
$feature = $script:Features[$paramKey]
|
$feature = $script:Features[$paramKey]
|
||||||
if (-not $feature) { continue }
|
if (-not $feature) { continue }
|
||||||
|
|
||||||
$featureId = Get-FeatureId -Feature $feature
|
$featureId = [string]$feature.FeatureId
|
||||||
|
|
||||||
if ($selectedFeatureIds.Add($featureId)) {
|
if ($selectedFeatureIds.Add($featureId)) {
|
||||||
$selectedFeatures.Add($feature)
|
$selectedFeatures.Add($feature)
|
||||||
}
|
}
|
||||||
@@ -56,6 +77,23 @@ function Get-SelectedFeatures {
|
|||||||
return @($selectedFeatures.ToArray())
|
return @($selectedFeatures.ToArray())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Builds the full backup payload object from selected and undo features.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Deduplicates feature IDs, resolves registry capture plans, snapshots all
|
||||||
|
registry keys, and assembles the final backup hashtable with metadata.
|
||||||
|
|
||||||
|
.PARAMETER SelectedFeatures
|
||||||
|
Feature objects from the apply side.
|
||||||
|
|
||||||
|
.PARAMETER UndoFeatures
|
||||||
|
Synthetic feature objects from the undo side.
|
||||||
|
|
||||||
|
.PARAMETER CreatedAt
|
||||||
|
Timestamp recorded in the backup metadata.
|
||||||
|
#>
|
||||||
function Get-RegistryBackupPayload {
|
function Get-RegistryBackupPayload {
|
||||||
param(
|
param(
|
||||||
[object[]]$SelectedFeatures = @(),
|
[object[]]$SelectedFeatures = @(),
|
||||||
@@ -67,8 +105,7 @@ function Get-RegistryBackupPayload {
|
|||||||
$selectedFeatureIds = New-Object System.Collections.Generic.List[string]
|
$selectedFeatureIds = New-Object System.Collections.Generic.List[string]
|
||||||
$seenSelectedFeatureIds = New-Object 'System.Collections.Generic.HashSet[string]' ([System.StringComparer]::OrdinalIgnoreCase)
|
$seenSelectedFeatureIds = New-Object 'System.Collections.Generic.HashSet[string]' ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
foreach ($feature in $SelectedFeatures) {
|
foreach ($feature in $SelectedFeatures) {
|
||||||
$featureId = Get-FeatureId -Feature $feature
|
$featureId = [string]$feature.FeatureId
|
||||||
|
|
||||||
if ($seenSelectedFeatureIds.Add($featureId)) {
|
if ($seenSelectedFeatureIds.Add($featureId)) {
|
||||||
$selectedFeatureIds.Add($featureId)
|
$selectedFeatureIds.Add($featureId)
|
||||||
}
|
}
|
||||||
@@ -77,8 +114,7 @@ function Get-RegistryBackupPayload {
|
|||||||
$selectedUndoFeatureIds = New-Object System.Collections.Generic.List[string]
|
$selectedUndoFeatureIds = New-Object System.Collections.Generic.List[string]
|
||||||
$seenUndoFeatureIds = New-Object 'System.Collections.Generic.HashSet[string]' ([System.StringComparer]::OrdinalIgnoreCase)
|
$seenUndoFeatureIds = New-Object 'System.Collections.Generic.HashSet[string]' ([System.StringComparer]::OrdinalIgnoreCase)
|
||||||
foreach ($feature in $UndoFeatures) {
|
foreach ($feature in $UndoFeatures) {
|
||||||
$featureId = Get-FeatureId -Feature $feature
|
$featureId = [string]$feature.FeatureId
|
||||||
|
|
||||||
if ($seenUndoFeatureIds.Add($featureId)) {
|
if ($seenUndoFeatureIds.Add($featureId)) {
|
||||||
$selectedUndoFeatureIds.Add($featureId)
|
$selectedUndoFeatureIds.Add($featureId)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,309 +0,0 @@
|
|||||||
# Executes a single parameter/feature based on its key
|
|
||||||
# Parameters:
|
|
||||||
# $paramKey - The parameter name to execute
|
|
||||||
function ExecuteParameter {
|
|
||||||
param (
|
|
||||||
[string]$paramKey
|
|
||||||
)
|
|
||||||
|
|
||||||
# Check if this feature has metadata in Features.json
|
|
||||||
$feature = $null
|
|
||||||
if ($script:Features.ContainsKey($paramKey)) {
|
|
||||||
$feature = $script:Features[$paramKey]
|
|
||||||
}
|
|
||||||
|
|
||||||
# If feature has RegistryKey and ApplyText, use dynamic ImportRegistryFile
|
|
||||||
if ($feature -and $feature.RegistryKey -and $feature.ApplyText) {
|
|
||||||
ImportRegistryFile "> $($feature.ApplyText)" $feature.RegistryKey
|
|
||||||
|
|
||||||
# Handle special cases that have additional logic after ImportRegistryFile
|
|
||||||
switch ($paramKey) {
|
|
||||||
'DisableBing' {
|
|
||||||
# Also remove the app package for Bing search
|
|
||||||
RemoveApps @('Microsoft.BingSearch')
|
|
||||||
}
|
|
||||||
'DisableCopilot' {
|
|
||||||
# Also remove the app package for Copilot
|
|
||||||
RemoveApps @('Microsoft.Copilot')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
# Handle features without RegistryKey or with special logic
|
|
||||||
switch ($paramKey) {
|
|
||||||
'RemoveApps' {
|
|
||||||
Write-Host "> $($feature.ApplyText) for $(GetFriendlyTargetUserName)..."
|
|
||||||
$appsList = GenerateAppsList
|
|
||||||
|
|
||||||
if ($appsList.Count -eq 0) {
|
|
||||||
Write-Host "No valid apps were selected for removal" -ForegroundColor Yellow
|
|
||||||
Write-Host ""
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "$($appsList.Count) apps selected for removal"
|
|
||||||
RemoveApps $appsList
|
|
||||||
}
|
|
||||||
'RemoveAppsCustom' {
|
|
||||||
Write-Host "> $($feature.ApplyText)..."
|
|
||||||
$appsList = LoadAppsFromFile $script:CustomAppsListFilePath
|
|
||||||
|
|
||||||
if ($appsList.Count -eq 0) {
|
|
||||||
Write-Host "No valid apps were selected for removal" -ForegroundColor Yellow
|
|
||||||
Write-Host ""
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "$($appsList.Count) apps selected for removal"
|
|
||||||
RemoveApps $appsList
|
|
||||||
}
|
|
||||||
'RemoveGamingApps' {
|
|
||||||
$appsList = @('Microsoft.GamingApp', 'Microsoft.XboxGameOverlay', 'Microsoft.XboxGamingOverlay')
|
|
||||||
Write-Host "> $($feature.ApplyText)..."
|
|
||||||
RemoveApps $appsList
|
|
||||||
return
|
|
||||||
}
|
|
||||||
'RemoveHPApps' {
|
|
||||||
$appsList = @('AD2F1837.HPAIExperienceCenter', 'AD2F1837.HPJumpStarts', 'AD2F1837.HPPCHardwareDiagnosticsWindows', 'AD2F1837.HPPowerManager', 'AD2F1837.HPPrivacySettings', 'AD2F1837.HPSupportAssistant', 'AD2F1837.HPSureShieldAI', 'AD2F1837.HPSystemInformation', 'AD2F1837.HPQuickDrop', 'AD2F1837.HPWorkWell', 'AD2F1837.myHP', 'AD2F1837.HPDesktopSupportUtilities', 'AD2F1837.HPQuickTouch', 'AD2F1837.HPEasyClean', 'AD2F1837.HPConnectedMusic', 'AD2F1837.HPFileViewer', 'AD2F1837.HPRegistration', 'AD2F1837.HPWelcome', 'AD2F1837.HPConnectedPhotopoweredbySnapfish', 'AD2F1837.HPPrinterControl')
|
|
||||||
Write-Host "> $($feature.ApplyText)..."
|
|
||||||
RemoveApps $appsList
|
|
||||||
return
|
|
||||||
}
|
|
||||||
'DisableWidgets' {
|
|
||||||
Write-Host "> $($feature.ApplyText)..."
|
|
||||||
# Stop widgets related processes before removing the app packages to prevent potential issues
|
|
||||||
Get-Process *Widget* -ErrorAction SilentlyContinue | Stop-Process
|
|
||||||
|
|
||||||
RemoveApps @('Microsoft.StartExperiencesApp','MicrosoftWindows.Client.WebExperience','Microsoft.WidgetsPlatformRuntime')
|
|
||||||
}
|
|
||||||
'EnableWindowsSandbox' {
|
|
||||||
Write-Host "> $($feature.ApplyText)..."
|
|
||||||
EnableWindowsFeature "Containers-DisposableClientVM"
|
|
||||||
Write-Host ""
|
|
||||||
return
|
|
||||||
}
|
|
||||||
'EnableWindowsSubsystemForLinux' {
|
|
||||||
Write-Host "> $($feature.ApplyText)..."
|
|
||||||
EnableWindowsFeature "VirtualMachinePlatform"
|
|
||||||
EnableWindowsFeature "Microsoft-Windows-Subsystem-Linux"
|
|
||||||
Write-Host ""
|
|
||||||
return
|
|
||||||
}
|
|
||||||
'ClearStart' {
|
|
||||||
Write-Host "> $($feature.ApplyText) for user $(GetUserName)..."
|
|
||||||
ReplaceStartMenu
|
|
||||||
Write-Host ""
|
|
||||||
return
|
|
||||||
}
|
|
||||||
'ReplaceStart' {
|
|
||||||
Write-Host "> $($feature.ApplyText) for user $(GetUserName)..."
|
|
||||||
ReplaceStartMenu $script:Params.Item("ReplaceStart")
|
|
||||||
Write-Host ""
|
|
||||||
return
|
|
||||||
}
|
|
||||||
'ClearStartAllUsers' {
|
|
||||||
ReplaceStartMenuForAllUsers
|
|
||||||
return
|
|
||||||
}
|
|
||||||
'ReplaceStartAllUsers' {
|
|
||||||
ReplaceStartMenuForAllUsers $script:Params.Item("ReplaceStartAllUsers")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
'DisableStoreSearchSuggestions' {
|
|
||||||
if ($script:Params.ContainsKey("Sysprep")) {
|
|
||||||
Write-Host "> Disabling Microsoft Store search suggestions in the start menu for all users..."
|
|
||||||
DisableStoreSearchSuggestionsForAllUsers
|
|
||||||
Write-Host ""
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "> Disabling Microsoft Store search suggestions for user $(GetUserName)..."
|
|
||||||
DisableStoreSearchSuggestions
|
|
||||||
Write-Host ""
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Executes all selected parameters/features
|
|
||||||
function ExecuteAllChanges {
|
|
||||||
# When running as SYSTEM, require -User or -Sysprep to prevent applying
|
|
||||||
# changes to the SYSTEM profile instead of a real user.
|
|
||||||
$isSystem = ([Security.Principal.WindowsIdentity]::GetCurrent().User.Value -eq 'S-1-5-18')
|
|
||||||
if ($isSystem -and -not $script:Params.ContainsKey("User") -and -not $script:Params.ContainsKey("Sysprep")) {
|
|
||||||
throw "Win11Debloat is running as the SYSTEM account. Use the '-User' or '-Sysprep' parameter to target a specific user."
|
|
||||||
}
|
|
||||||
|
|
||||||
$script:RegistryImportFailures = 0
|
|
||||||
|
|
||||||
# Build list of actionable parameters (skip control params and data-only params)
|
|
||||||
$actionableKeys = @()
|
|
||||||
foreach ($paramKey in $script:Params.Keys) {
|
|
||||||
if ($script:ControlParams -contains $paramKey) { continue }
|
|
||||||
if ($paramKey -eq 'Apps') { continue }
|
|
||||||
if ($paramKey -eq 'CreateRestorePoint') { continue }
|
|
||||||
$actionableKeys += $paramKey
|
|
||||||
}
|
|
||||||
|
|
||||||
$hasRegistryBackedFeature = $false
|
|
||||||
foreach ($paramKey in $actionableKeys) {
|
|
||||||
if (-not $script:Features.ContainsKey($paramKey)) { continue }
|
|
||||||
|
|
||||||
$feature = $script:Features[$paramKey]
|
|
||||||
if ($feature -and -not [string]::IsNullOrWhiteSpace([string]$feature.RegistryKey)) {
|
|
||||||
$hasRegistryBackedFeature = $true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# Undo operations that write registry values also require a backup
|
|
||||||
if (-not $hasRegistryBackedFeature) {
|
|
||||||
foreach ($featureId in $script:UndoParams.Keys) {
|
|
||||||
$f = if ($script:Features.ContainsKey($featureId)) { $script:Features[$featureId] } else { $null }
|
|
||||||
if ($f -and $f.RegistryUndoKey) { $hasRegistryBackedFeature = $true; break }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$totalSteps = $actionableKeys.Count + $script:UndoParams.Count
|
|
||||||
if ($hasRegistryBackedFeature) { $totalSteps++ }
|
|
||||||
if ($script:Params.ContainsKey("CreateRestorePoint")) { $totalSteps++ }
|
|
||||||
$currentStep = 0
|
|
||||||
|
|
||||||
if ($hasRegistryBackedFeature) {
|
|
||||||
$currentStep++
|
|
||||||
if ($script:ApplyProgressCallback) {
|
|
||||||
& $script:ApplyProgressCallback $currentStep $totalSteps "Creating registry backup..."
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "> Creating registry backup..."
|
|
||||||
try {
|
|
||||||
$undoSyntheticFeatures = @($script:UndoParams.Keys | ForEach-Object {
|
|
||||||
$f = if ($script:Features.ContainsKey($_)) { $script:Features[$_] } else { $null }
|
|
||||||
if ($f -and $f.RegistryUndoKey) {
|
|
||||||
[PSCustomObject]@{ FeatureId = $_; RegistryKey = (Resolve-UndoRegFilePath $f.RegistryUndoKey) }
|
|
||||||
}
|
|
||||||
} | Where-Object { $_ })
|
|
||||||
New-RegistrySettingsBackup -ActionableKeys $actionableKeys -ExtraFeatures $undoSyntheticFeatures | Out-Null
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
throw "Registry backup failed before applying changes. $($_.Exception.Message)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create restore point if requested (CLI only - GUI handles this separately)
|
|
||||||
if ($script:Params.ContainsKey("CreateRestorePoint")) {
|
|
||||||
$currentStep++
|
|
||||||
if ($script:ApplyProgressCallback) {
|
|
||||||
& $script:ApplyProgressCallback $currentStep $totalSteps "Creating system restore point, this may take a moment..."
|
|
||||||
}
|
|
||||||
Write-Host "> Creating a system restore point..."
|
|
||||||
CreateSystemRestorePoint
|
|
||||||
Write-Host ""
|
|
||||||
}
|
|
||||||
|
|
||||||
# Execute all parameters
|
|
||||||
foreach ($paramKey in $actionableKeys) {
|
|
||||||
if ($script:CancelRequested) { return }
|
|
||||||
|
|
||||||
$currentStep++
|
|
||||||
|
|
||||||
# Get friendly name for the step
|
|
||||||
$stepName = $paramKey
|
|
||||||
if ($script:Features.ContainsKey($paramKey)) {
|
|
||||||
$feature = $script:Features[$paramKey]
|
|
||||||
if ($feature.ApplyText) {
|
|
||||||
# Prefer explicit ApplyText when provided
|
|
||||||
$stepName = $feature.ApplyText
|
|
||||||
} elseif ($feature.Label) {
|
|
||||||
# Fallback: use label from Features.json
|
|
||||||
$stepName = $feature.Label
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($script:ApplyProgressCallback) {
|
|
||||||
& $script:ApplyProgressCallback $currentStep $totalSteps $stepName
|
|
||||||
}
|
|
||||||
|
|
||||||
ExecuteParameter -paramKey $paramKey
|
|
||||||
}
|
|
||||||
|
|
||||||
# Execute all undo operations
|
|
||||||
foreach ($featureId in $script:UndoParams.Keys) {
|
|
||||||
if ($script:CancelRequested) { return }
|
|
||||||
|
|
||||||
$f = if ($script:Features.ContainsKey($featureId)) { $script:Features[$featureId] } else { $null }
|
|
||||||
$undoLabel = if ($f -and $f.UndoLabel) { $f.UndoLabel } else { $featureId }
|
|
||||||
$applyUndoText = if ($f -and $f.ApplyUndoText) { $f.ApplyUndoText } else { $undoLabel }
|
|
||||||
|
|
||||||
$currentStep++
|
|
||||||
if ($script:ApplyProgressCallback) {
|
|
||||||
& $script:ApplyProgressCallback $currentStep $totalSteps $applyUndoText
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($f -and $f.RegistryUndoKey) {
|
|
||||||
ImportRegistryFile "> $applyUndoText" (Resolve-UndoRegFilePath $f.RegistryUndoKey)
|
|
||||||
} else {
|
|
||||||
Invoke-UndoFeatureAction -FeatureId $featureId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($script:RegistryImportFailures -gt 0) {
|
|
||||||
Write-Host ""
|
|
||||||
Write-Host "$($script:RegistryImportFailures) registry import change(s) failed. See output above for details." -ForegroundColor Yellow
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Resolves the path of an undo reg file relative to $script:RegfilesPath.
|
|
||||||
# Checks the Undo/ subfolder first, then falls back to the root Regfiles/ folder.
|
|
||||||
function Resolve-UndoRegFilePath {
|
|
||||||
param ([string]$FileName)
|
|
||||||
$undoSubPath = Join-Path 'Undo' $FileName
|
|
||||||
if (Test-Path (Join-Path $script:RegfilesPath $undoSubPath)) {
|
|
||||||
return $undoSubPath
|
|
||||||
}
|
|
||||||
return $FileName
|
|
||||||
}
|
|
||||||
|
|
||||||
function Invoke-UndoFeatureAction {
|
|
||||||
param(
|
|
||||||
[Parameter(Mandatory)]
|
|
||||||
[string]$FeatureId
|
|
||||||
)
|
|
||||||
|
|
||||||
$feature = if ($script:Features.ContainsKey($FeatureId)) { $script:Features[$FeatureId] } else { $null }
|
|
||||||
|
|
||||||
switch ($FeatureId) {
|
|
||||||
'DisableStoreSearchSuggestions' {
|
|
||||||
if ($script:Params.ContainsKey('Sysprep')) {
|
|
||||||
Write-Host "> Re-enabling Microsoft Store search suggestions in the start menu for all users..."
|
|
||||||
EnableStoreSearchSuggestionsForAllUsers
|
|
||||||
Write-Host ""
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "> Re-enabling Microsoft Store search suggestions for user $(GetUserName)..."
|
|
||||||
EnableStoreSearchSuggestions
|
|
||||||
Write-Host ""
|
|
||||||
return
|
|
||||||
}
|
|
||||||
'EnableWindowsSandbox' {
|
|
||||||
Write-Host "> $($feature.ApplyUndoText)..."
|
|
||||||
DisableWindowsFeature 'Containers-DisposableClientVM'
|
|
||||||
Write-Host ""
|
|
||||||
return
|
|
||||||
}
|
|
||||||
'EnableWindowsSubsystemForLinux' {
|
|
||||||
Write-Host "> $($feature.ApplyUndoText)..."
|
|
||||||
DisableWindowsFeature 'Microsoft-Windows-Subsystem-Linux'
|
|
||||||
DisableWindowsFeature 'VirtualMachinePlatform'
|
|
||||||
Write-Host ""
|
|
||||||
return
|
|
||||||
}
|
|
||||||
default {
|
|
||||||
Write-Host "> No undo action defined for $FeatureId, skipping..." -ForegroundColor Yellow
|
|
||||||
Write-Host ""
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
# Tests whether the registry operations in a feature's .reg file currently match the live registry.
|
<#
|
||||||
# Returns $true if ALL operations in the apply reg file match current system state.
|
.SYNOPSIS
|
||||||
# Returns $false if the feature has no RegistryKey, the file is missing, or any operation mismatches.
|
Maps a .reg file value type string to its RegistryValueKind enum.
|
||||||
|
|
||||||
|
.PARAMETER Operation
|
||||||
|
A parsed .reg operation object containing a ValueType property.
|
||||||
|
#>
|
||||||
function Get-ExpectedRegistryValueKind {
|
function Get-ExpectedRegistryValueKind {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
@@ -18,13 +22,25 @@ function Get-ExpectedRegistryValueKind {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Tests whether a feature's registry operations currently match the live registry.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Returns $true when ALL operations in the apply .reg file match current system
|
||||||
|
state. Returns $false if the feature has no RegistryKey, the reg file is
|
||||||
|
missing, or any operation mismatches. Special-cased features (Widgets, Store
|
||||||
|
suggestions, Windows Sandbox, WSL) bypass .reg checking entirely.
|
||||||
|
|
||||||
|
.PARAMETER FeatureId
|
||||||
|
The feature identifier to test.
|
||||||
|
#>
|
||||||
function Test-FeatureApplied {
|
function Test-FeatureApplied {
|
||||||
param (
|
param (
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
[string]$FeatureId
|
[string]$FeatureId
|
||||||
)
|
)
|
||||||
|
|
||||||
if (-not $script:Features.ContainsKey($FeatureId)) { return $false }
|
|
||||||
$feature = $script:Features[$FeatureId]
|
$feature = $script:Features[$FeatureId]
|
||||||
|
|
||||||
switch ($FeatureId) {
|
switch ($FeatureId) {
|
||||||
@@ -50,10 +66,7 @@ function Test-FeatureApplied {
|
|||||||
return (Test-StoreSearchSuggestionsDisabledForAllUsers)
|
return (Test-StoreSearchSuggestionsDisabledForAllUsers)
|
||||||
}
|
}
|
||||||
|
|
||||||
$storeDbPath = "$env:LocalAppData\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db"
|
$storeDbPath = GetStoreAppsDatabasePathForUser -UserName (GetUserName)
|
||||||
if ($script:Params.ContainsKey('User')) {
|
|
||||||
$storeDbPath = GetUserDirectory -userName "$(GetUserName)" -fileName "AppData\Local\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db" -exitIfPathNotFound $false
|
|
||||||
}
|
|
||||||
|
|
||||||
return (Test-StoreSearchSuggestionsDisabled -StoreAppsDatabase $storeDbPath)
|
return (Test-StoreSearchSuggestionsDisabled -StoreAppsDatabase $storeDbPath)
|
||||||
}
|
}
|
||||||
@@ -150,8 +163,18 @@ function Test-FeatureApplied {
|
|||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
|
|
||||||
# Returns the 1-based index of the UiGroup option whose features all match current system state,
|
<#
|
||||||
# or 0 if no option fully matches (meaning the current state is unknown / "No Change").
|
.SYNOPSIS
|
||||||
|
Returns the 1-based index of the UiGroup option whose features all match
|
||||||
|
current system state.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Returns 0 if no option fully matches, meaning the current state is unknown
|
||||||
|
or represents "No Change".
|
||||||
|
|
||||||
|
.PARAMETER Group
|
||||||
|
A UiGroup object whose Values array contains options with FeatureIds.
|
||||||
|
#>
|
||||||
function Get-CurrentGroupActiveIndex {
|
function Get-CurrentGroupActiveIndex {
|
||||||
param (
|
param (
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ function ImportRegistryFile {
|
|||||||
$importScript = {
|
$importScript = {
|
||||||
param($targetRegFilePath, $hiveContext)
|
param($targetRegFilePath, $hiveContext)
|
||||||
|
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Invoke-RegistryOperationsFromRegFile -RegFilePath $targetRegFilePath
|
||||||
|
Write-Host ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
# When the target user's hive is already loaded under their SID, the .reg file's
|
# When the target user's hive is already loaded under their SID, the .reg file's
|
||||||
# HKEY_USERS\Default paths won't match. Use the PowerShell registry writer instead,
|
# HKEY_USERS\Default paths won't match. Use the PowerShell registry writer instead,
|
||||||
# which remaps Default → SID via Split-RegistryPath.
|
# which remaps Default → SID via Split-RegistryPath.
|
||||||
|
|||||||
425
Scripts/Features/InvokeChanges.ps1
Normal file
425
Scripts/Features/InvokeChanges.ps1
Normal file
@@ -0,0 +1,425 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Applies a single feature/debloat operation.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Handles two categories of features:
|
||||||
|
- Registry-backed: imports the .reg file via ImportRegistryFile, then runs
|
||||||
|
any post-import side effects (e.g., removing companion app packages).
|
||||||
|
- Custom logic: app removal, Windows optional features, start menu
|
||||||
|
replacement, and other special-case features.
|
||||||
|
#>
|
||||||
|
function Invoke-FeatureApply {
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[string]$FeatureId
|
||||||
|
)
|
||||||
|
|
||||||
|
# Resolve feature metadata from Features.json
|
||||||
|
$feature = $script:Features[$FeatureId]
|
||||||
|
$applyText = $feature.ApplyText
|
||||||
|
|
||||||
|
# ---- Registry-backed features: import .reg file, then handle side effects ----
|
||||||
|
if ($feature.RegistryKey) {
|
||||||
|
ImportRegistryFile "> $applyText..." $feature.RegistryKey
|
||||||
|
|
||||||
|
# Post-import side effects for specific features
|
||||||
|
switch ($FeatureId) {
|
||||||
|
'DisableBing' {
|
||||||
|
# Also remove the app package for Bing search
|
||||||
|
RemoveApps @('Microsoft.BingSearch')
|
||||||
|
}
|
||||||
|
'DisableCopilot' {
|
||||||
|
# Also remove the app packages for Copilot
|
||||||
|
RemoveApps @('Microsoft.Copilot', 'XP9CXNGPPJ97XX')
|
||||||
|
}
|
||||||
|
'DisableTelemetry' {
|
||||||
|
# Also disable telemetry scheduled tasks
|
||||||
|
Disable-TelemetryScheduledTasks
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
# ---- Custom features (no registry backing, or special handling required) ----
|
||||||
|
switch ($FeatureId) {
|
||||||
|
'RemoveApps' {
|
||||||
|
Write-Host "> $applyText for $(GetFriendlyTargetUserName)..."
|
||||||
|
$appsList = GenerateAppsList
|
||||||
|
|
||||||
|
if ($appsList.Count -eq 0) {
|
||||||
|
Write-Host "No valid apps were selected for removal" -ForegroundColor Yellow
|
||||||
|
Write-Host ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "$($appsList.Count) apps selected for removal"
|
||||||
|
RemoveApps $appsList
|
||||||
|
return
|
||||||
|
}
|
||||||
|
'RemoveGamingApps' {
|
||||||
|
$appsList = @('Microsoft.GamingApp', 'Microsoft.XboxGameOverlay', 'Microsoft.XboxGamingOverlay')
|
||||||
|
Write-Host "> $applyText..."
|
||||||
|
RemoveApps $appsList
|
||||||
|
return
|
||||||
|
}
|
||||||
|
'RemoveHPApps' {
|
||||||
|
$appsList = @('AD2F1837.HPAIExperienceCenter', 'AD2F1837.HPJumpStarts', 'AD2F1837.HPPCHardwareDiagnosticsWindows', 'AD2F1837.HPPowerManager', 'AD2F1837.HPPrivacySettings', 'AD2F1837.HPSupportAssistant', 'AD2F1837.HPSureShieldAI', 'AD2F1837.HPSystemInformation', 'AD2F1837.HPQuickDrop', 'AD2F1837.HPWorkWell', 'AD2F1837.myHP', 'AD2F1837.HPDesktopSupportUtilities', 'AD2F1837.HPQuickTouch', 'AD2F1837.HPEasyClean', 'AD2F1837.HPConnectedMusic', 'AD2F1837.HPFileViewer', 'AD2F1837.HPRegistration', 'AD2F1837.HPWelcome', 'AD2F1837.HPConnectedPhotopoweredbySnapfish', 'AD2F1837.HPPrinterControl')
|
||||||
|
Write-Host "> $applyText..."
|
||||||
|
RemoveApps $appsList
|
||||||
|
return
|
||||||
|
}
|
||||||
|
'DisableWidgets' {
|
||||||
|
Write-Host "> $applyText..."
|
||||||
|
# Stop widgets related processes before removing the app packages to prevent potential issues
|
||||||
|
if (-not $script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Get-Process *Widget* -ErrorAction SilentlyContinue | Stop-Process
|
||||||
|
}
|
||||||
|
|
||||||
|
RemoveApps @('Microsoft.StartExperiencesApp','MicrosoftWindows.Client.WebExperience','Microsoft.WidgetsPlatformRuntime')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
'EnableWindowsSandbox' {
|
||||||
|
Write-Host "> $applyText..."
|
||||||
|
EnableWindowsFeature "Containers-DisposableClientVM"
|
||||||
|
Write-Host ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
'EnableWindowsSubsystemForLinux' {
|
||||||
|
Write-Host "> $applyText..."
|
||||||
|
EnableWindowsFeature "VirtualMachinePlatform"
|
||||||
|
EnableWindowsFeature "Microsoft-Windows-Subsystem-Linux"
|
||||||
|
Write-Host ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
'ClearStart' {
|
||||||
|
Write-Host "> $applyText for user $(GetUserName)..."
|
||||||
|
$startMenuBinFile = GetStartMenuBinPathForUser -UserName (GetUserName)
|
||||||
|
if (-not [string]::IsNullOrWhiteSpace($startMenuBinFile)) {
|
||||||
|
ReplaceStartMenu -startMenuBinFile $startMenuBinFile
|
||||||
|
}
|
||||||
|
Write-Host ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
'ReplaceStart' {
|
||||||
|
Write-Host "> $applyText for user $(GetUserName)..."
|
||||||
|
$startMenuBinFile = GetStartMenuBinPathForUser -UserName (GetUserName)
|
||||||
|
if (-not [string]::IsNullOrWhiteSpace($startMenuBinFile)) {
|
||||||
|
ReplaceStartMenu -startMenuBinFile $startMenuBinFile -startMenuTemplate $script:Params.Item("ReplaceStart")
|
||||||
|
}
|
||||||
|
Write-Host ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
'ClearStartAllUsers' {
|
||||||
|
ReplaceStartMenuForAllUsers
|
||||||
|
return
|
||||||
|
}
|
||||||
|
'ReplaceStartAllUsers' {
|
||||||
|
ReplaceStartMenuForAllUsers -startMenuTemplate $script:Params.Item("ReplaceStartAllUsers")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
'DisableStoreSearchSuggestions' {
|
||||||
|
if ($script:Params.ContainsKey("Sysprep")) {
|
||||||
|
Write-Host "> Disabling Microsoft Store search suggestions in the start menu for all users..."
|
||||||
|
DisableStoreSearchSuggestionsForAllUsers
|
||||||
|
Write-Host ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "> Disabling Microsoft Store search suggestions for user $(GetUserName)..."
|
||||||
|
$storeDb = GetStoreAppsDatabasePathForUser -UserName (GetUserName)
|
||||||
|
if ($storeDb) {
|
||||||
|
DisableStoreSearchSuggestions -StoreAppsDatabase $storeDb
|
||||||
|
}
|
||||||
|
Write-Host ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Undoes a single feature that has no RegistryUndoKey.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Handles undo for features that require custom logic rather than a simple
|
||||||
|
.reg file import. Features with a RegistryUndoKey are handled directly
|
||||||
|
via ImportRegistryFile in Invoke-UndoFeatures.
|
||||||
|
#>
|
||||||
|
function Invoke-FeatureUndo {
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[string]$FeatureId
|
||||||
|
)
|
||||||
|
|
||||||
|
$feature = if ($script:Features.ContainsKey($FeatureId)) { $script:Features[$FeatureId] } else { $null }
|
||||||
|
|
||||||
|
switch ($FeatureId) {
|
||||||
|
'DisableStoreSearchSuggestions' {
|
||||||
|
if ($script:Params.ContainsKey('Sysprep')) {
|
||||||
|
Write-Host "> Re-enabling Microsoft Store search suggestions in the start menu for all users..."
|
||||||
|
EnableStoreSearchSuggestionsForAllUsers
|
||||||
|
Write-Host ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "> Re-enabling Microsoft Store search suggestions for user $(GetUserName)..."
|
||||||
|
$storeDb = GetStoreAppsDatabasePathForUser -UserName (GetUserName)
|
||||||
|
if ($storeDb) {
|
||||||
|
EnableStoreSearchSuggestions -StoreAppsDatabase $storeDb
|
||||||
|
}
|
||||||
|
Write-Host ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
'EnableWindowsSandbox' {
|
||||||
|
Write-Host "> $($feature.ApplyUndoText)..."
|
||||||
|
DisableWindowsFeature 'Containers-DisposableClientVM'
|
||||||
|
Write-Host ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
'EnableWindowsSubsystemForLinux' {
|
||||||
|
Write-Host "> $($feature.ApplyUndoText)..."
|
||||||
|
DisableWindowsFeature 'Microsoft-Windows-Subsystem-Linux'
|
||||||
|
DisableWindowsFeature 'VirtualMachinePlatform'
|
||||||
|
Write-Host ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
'DisableTelemetry' {
|
||||||
|
# Also re-enable telemetry scheduled tasks
|
||||||
|
Enable-TelemetryScheduledTasks
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Resolves the path of an undo .reg file relative to $script:RegfilesPath.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Checks the Undo/ subfolder first, then falls back to the root Regfiles/
|
||||||
|
folder. This allows undo files to be organized separately from apply files.
|
||||||
|
#>
|
||||||
|
function Resolve-UndoRegFilePath {
|
||||||
|
param([string]$FileName)
|
||||||
|
|
||||||
|
$undoSubPath = Join-Path 'Undo' $FileName
|
||||||
|
if (Test-Path (Join-Path $script:RegfilesPath $undoSubPath)) {
|
||||||
|
return $undoSubPath
|
||||||
|
}
|
||||||
|
return $FileName
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Applies a list of features, reporting progress for each.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Iterates through the provided feature IDs and calls Invoke-FeatureApply
|
||||||
|
for each. Handles progress callbacks (GUI mode) and cancellation checks.
|
||||||
|
This is called by Invoke-AllChanges during the apply phase.
|
||||||
|
#>
|
||||||
|
function Invoke-ApplyFeatures {
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[string[]]$FeatureIds,
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[int]$StartStep,
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[int]$TotalSteps
|
||||||
|
)
|
||||||
|
|
||||||
|
if ($FeatureIds.Count -eq 0) { return }
|
||||||
|
|
||||||
|
$step = $StartStep
|
||||||
|
foreach ($featureId in $FeatureIds) {
|
||||||
|
if ($script:CancelRequested) { return }
|
||||||
|
|
||||||
|
# Resolve display name for the progress indicator
|
||||||
|
$f = $script:Features[$featureId]
|
||||||
|
$displayName = $f.ApplyText
|
||||||
|
|
||||||
|
if ($script:ApplyProgressCallback) {
|
||||||
|
& $script:ApplyProgressCallback $step $TotalSteps $displayName
|
||||||
|
}
|
||||||
|
|
||||||
|
Invoke-FeatureApply -FeatureId $featureId
|
||||||
|
$step++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Undoes a list of features, reporting progress for each.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Iterates through the provided feature IDs. Features with a RegistryUndoKey
|
||||||
|
are handled by importing the undo .reg file; all others delegate to
|
||||||
|
Invoke-FeatureUndo for custom undo logic.
|
||||||
|
This is called by Invoke-AllChanges during the undo phase.
|
||||||
|
#>
|
||||||
|
function Invoke-UndoFeatures {
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[string[]]$FeatureIds,
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[int]$StartStep,
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[int]$TotalSteps
|
||||||
|
)
|
||||||
|
|
||||||
|
if ($FeatureIds.Count -eq 0) { return }
|
||||||
|
|
||||||
|
$step = $StartStep
|
||||||
|
foreach ($featureId in $FeatureIds) {
|
||||||
|
if ($script:CancelRequested) { return }
|
||||||
|
|
||||||
|
$f = if ($script:Features.ContainsKey($featureId)) { $script:Features[$featureId] } else { $null }
|
||||||
|
$undoLabel = if ($f -and $f.UndoLabel) { $f.UndoLabel } else { $featureId }
|
||||||
|
$undoText = if ($f -and $f.ApplyUndoText) { $f.ApplyUndoText } else { $undoLabel }
|
||||||
|
|
||||||
|
if ($script:ApplyProgressCallback) {
|
||||||
|
& $script:ApplyProgressCallback $step $TotalSteps $undoText
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($f -and $f.RegistryUndoKey) {
|
||||||
|
ImportRegistryFile "> $undoText" (Resolve-UndoRegFilePath $f.RegistryUndoKey)
|
||||||
|
}
|
||||||
|
|
||||||
|
Invoke-FeatureUndo -FeatureId $featureId
|
||||||
|
$step++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Main orchestrator: applies and undoes all selected features.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Sequenced in four phases:
|
||||||
|
1. Registry backup
|
||||||
|
2. System restore point
|
||||||
|
3. Apply phase - applies all selected features via Invoke-ApplyFeatures
|
||||||
|
4. Undo phase - undoes selected features via Invoke-UndoFeatures
|
||||||
|
|
||||||
|
Progress is reported through $script:ApplyProgressCallback when set
|
||||||
|
(used by the GUI modal). Cancellation is checked between each step.
|
||||||
|
#>
|
||||||
|
function Invoke-AllChanges {
|
||||||
|
# Guard: prevent running as SYSTEM account without explicit target user
|
||||||
|
$isSystem = ([Security.Principal.WindowsIdentity]::GetCurrent().User.Value -eq 'S-1-5-18')
|
||||||
|
if ($isSystem -and -not $script:Params.ContainsKey("User") -and -not $script:Params.ContainsKey("Sysprep")) {
|
||||||
|
throw "Win11Debloat is running as the SYSTEM account. Use the '-User' or '-Sysprep' parameter to target a specific user."
|
||||||
|
}
|
||||||
|
|
||||||
|
$script:RegistryImportFailures = 0
|
||||||
|
|
||||||
|
# ---- Gather work items ----
|
||||||
|
$applyIds = @()
|
||||||
|
foreach ($key in $script:Params.Keys) {
|
||||||
|
if ($script:ControlParams -contains $key) { continue }
|
||||||
|
if ($key -eq 'Apps') { continue }
|
||||||
|
if ($key -eq 'CreateRestorePoint') { continue }
|
||||||
|
$applyIds += $key
|
||||||
|
}
|
||||||
|
$undoIds = @($script:UndoParams.Keys)
|
||||||
|
|
||||||
|
# ---- Determine if registry backup is needed ----
|
||||||
|
$needsBackup = $false
|
||||||
|
foreach ($id in $applyIds) {
|
||||||
|
$f = $script:Features[$id]
|
||||||
|
if ($f -and -not [string]::IsNullOrWhiteSpace([string]$f.RegistryKey)) {
|
||||||
|
$needsBackup = $true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (-not $needsBackup) {
|
||||||
|
foreach ($id in $undoIds) {
|
||||||
|
$f = if ($script:Features.ContainsKey($id)) { $script:Features[$id] } else { $null }
|
||||||
|
if ($f -and $f.RegistryUndoKey) { $needsBackup = $true; break }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# ---- Calculate total progress steps ----
|
||||||
|
$totalSteps = $applyIds.Count + $undoIds.Count
|
||||||
|
if ($needsBackup) { $totalSteps++ }
|
||||||
|
if ($script:Params.ContainsKey("CreateRestorePoint")) { $totalSteps++ }
|
||||||
|
$step = 0
|
||||||
|
|
||||||
|
# ================================================================
|
||||||
|
# Phase 1: Registry backup
|
||||||
|
# ================================================================
|
||||||
|
if ($needsBackup) {
|
||||||
|
$step++
|
||||||
|
if ($script:ApplyProgressCallback) {
|
||||||
|
& $script:ApplyProgressCallback $step $totalSteps "Creating registry backup..."
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Create registry backup" -ForegroundColor Cyan
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Host "> Creating registry backup..."
|
||||||
|
try {
|
||||||
|
$undoSyntheticFeatures = @($undoIds | ForEach-Object {
|
||||||
|
$f = if ($script:Features.ContainsKey($_)) { $script:Features[$_] } else { $null }
|
||||||
|
if ($f -and $f.RegistryUndoKey) {
|
||||||
|
[PSCustomObject]@{ FeatureId = $_; RegistryKey = (Resolve-UndoRegFilePath $f.RegistryUndoKey) }
|
||||||
|
}
|
||||||
|
} | Where-Object { $_ })
|
||||||
|
New-RegistrySettingsBackup -ActionableKeys $applyIds -ExtraFeatures $undoSyntheticFeatures | Out-Null
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
throw "Registry backup failed before applying changes. $($_.Exception.Message)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# ================================================================
|
||||||
|
# Phase 2: System restore point
|
||||||
|
# ================================================================
|
||||||
|
if ($script:Params.ContainsKey("CreateRestorePoint")) {
|
||||||
|
$step++
|
||||||
|
if ($script:ApplyProgressCallback) {
|
||||||
|
& $script:ApplyProgressCallback $step $totalSteps "Creating system restore point, this may take a moment..."
|
||||||
|
}
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Create system restore point" -ForegroundColor Cyan
|
||||||
|
Write-Host ""
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Host "> Creating a system restore point..."
|
||||||
|
CreateSystemRestorePoint
|
||||||
|
Write-Host ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# ================================================================
|
||||||
|
# Phase 3: Apply features
|
||||||
|
# ================================================================
|
||||||
|
if ($applyIds.Count -gt 0) {
|
||||||
|
Invoke-ApplyFeatures -FeatureIds $applyIds -StartStep ($step + 1) -TotalSteps $totalSteps
|
||||||
|
$step += $applyIds.Count
|
||||||
|
}
|
||||||
|
|
||||||
|
# ================================================================
|
||||||
|
# Phase 4: Undo features
|
||||||
|
# ================================================================
|
||||||
|
if ($undoIds.Count -gt 0) {
|
||||||
|
Invoke-UndoFeatures -FeatureIds $undoIds -StartStep ($step + 1) -TotalSteps $totalSteps
|
||||||
|
$step += $undoIds.Count
|
||||||
|
}
|
||||||
|
|
||||||
|
# ================================================================
|
||||||
|
# Final: Report registry import failures
|
||||||
|
# ================================================================
|
||||||
|
if ($script:RegistryImportFailures -gt 0) {
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host "$($script:RegistryImportFailures) registry import change(s) failed. See output above for details." -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -385,7 +385,7 @@ function Find-RegistryAllowListPlanMatch {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
$subKeyPrefix = "$($plan.NormalizedPath)\\"
|
$subKeyPrefix = "$($plan.NormalizedPath)\"
|
||||||
if ($NormalizedPath.StartsWith($subKeyPrefix, [System.StringComparison]::OrdinalIgnoreCase)) {
|
if ($NormalizedPath.StartsWith($subKeyPrefix, [System.StringComparison]::OrdinalIgnoreCase)) {
|
||||||
return [PSCustomObject]@{
|
return [PSCustomObject]@{
|
||||||
IsDescendant = $true
|
IsDescendant = $true
|
||||||
|
|||||||
@@ -1,8 +1,27 @@
|
|||||||
# Replace the startmenu for all users, when using the default startmenuTemplate this clears all pinned apps
|
<#
|
||||||
# Credit: https://lazyadmin.nl/win-11/customize-windows-11-start-menu-layout/
|
.SYNOPSIS
|
||||||
|
Replaces the start menu layout for all user profiles.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Iterates over every existing user profile and the Default user profile,
|
||||||
|
replacing each user's start2.bin file with the specified template. When
|
||||||
|
using the default template, this clears all pinned apps from the start menu.
|
||||||
|
|
||||||
|
Credit: https://lazyadmin.nl/win-11/customize-windows-11-start-menu-layout/
|
||||||
|
|
||||||
|
.PARAMETER startMenuTemplate
|
||||||
|
Path to the .bin template file to apply. Defaults to the blank template
|
||||||
|
bundled with the script (Assets/Start/start2.bin).
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
ReplaceStartMenuForAllUsers
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
ReplaceStartMenuForAllUsers -startMenuTemplate "C:\CustomLayout.bin"
|
||||||
|
#>
|
||||||
function ReplaceStartMenuForAllUsers {
|
function ReplaceStartMenuForAllUsers {
|
||||||
param (
|
param (
|
||||||
$startMenuTemplate = "$script:AssetsPath\Start\start2.bin"
|
[string]$startMenuTemplate = "$script:AssetsPath\Start\start2.bin"
|
||||||
)
|
)
|
||||||
|
|
||||||
Write-Host "> Removing all pinned apps from the start menu for all users..."
|
Write-Host "> Removing all pinned apps from the start menu for all users..."
|
||||||
@@ -20,12 +39,17 @@ function ReplaceStartMenuForAllUsers {
|
|||||||
|
|
||||||
# Go through all users and replace the start menu file
|
# Go through all users and replace the start menu file
|
||||||
ForEach ($startMenuPath in $usersStartMenuPaths) {
|
ForEach ($startMenuPath in $usersStartMenuPaths) {
|
||||||
ReplaceStartMenu $startMenuTemplate "$($startMenuPath.Fullname)\start2.bin"
|
ReplaceStartMenu -startMenuBinFile "$($startMenuPath.Fullname)\start2.bin" -startMenuTemplate $startMenuTemplate
|
||||||
}
|
}
|
||||||
|
|
||||||
# Also replace the start menu file for the default user profile
|
# Also replace the start menu file for the default user profile
|
||||||
$defaultStartMenuPath = GetUserDirectory -userName "Default" -fileName "AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState" -exitIfPathNotFound $false
|
$defaultStartMenuPath = GetUserDirectory -userName "Default" -fileName "AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState" -exitIfPathNotFound $false
|
||||||
|
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Replace Start Menu for Default user profile with template $startMenuTemplate" -ForegroundColor Cyan
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
# Create folder if it doesn't exist
|
# Create folder if it doesn't exist
|
||||||
if (-not (Test-Path $defaultStartMenuPath)) {
|
if (-not (Test-Path $defaultStartMenuPath)) {
|
||||||
new-item $defaultStartMenuPath -ItemType Directory -Force | Out-Null
|
new-item $defaultStartMenuPath -ItemType Directory -Force | Out-Null
|
||||||
@@ -33,43 +57,71 @@ function ReplaceStartMenuForAllUsers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Copy template to default profile
|
# Copy template to default profile
|
||||||
Copy-Item -Path $startMenuTemplate -Destination $defaultStartMenuPath -Force
|
ReplaceStartMenu -startMenuBinFile "$($defaultStartMenuPath)\start2.bin" -startMenuTemplate $startMenuTemplate
|
||||||
Write-Host "Replaced start menu for the default user profile"
|
Write-Host "Replaced start menu for the default user profile"
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Replace the startmenu at the specified location, when using the default startmenuTemplate this clears all pinned apps
|
<#
|
||||||
# Credit: https://lazyadmin.nl/win-11/customize-windows-11-start-menu-layout/
|
.SYNOPSIS
|
||||||
|
Replaces the start menu layout for a single user.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Backs up the current start2.bin file (if it exists), then copies the
|
||||||
|
specified template over it. When using the default template this clears
|
||||||
|
all pinned apps from the start menu. Validates that the template file
|
||||||
|
exists and has a .bin extension before proceeding.
|
||||||
|
|
||||||
|
Credit: https://lazyadmin.nl/win-11/customize-windows-11-start-menu-layout/
|
||||||
|
|
||||||
|
.PARAMETER startMenuBinFile
|
||||||
|
The full path to the user's start2.bin file to replace.
|
||||||
|
|
||||||
|
.PARAMETER startMenuTemplate
|
||||||
|
Path to the .bin template file to apply. Defaults to the blank template
|
||||||
|
bundled with the script (Assets/Start/start2.bin).
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
ReplaceStartMenu -startMenuBinFile "$env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin"
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
ReplaceStartMenu -startMenuBinFile "$env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin" -startMenuTemplate "C:\CustomLayout.bin"
|
||||||
|
#>
|
||||||
function ReplaceStartMenu {
|
function ReplaceStartMenu {
|
||||||
param (
|
param (
|
||||||
$startMenuTemplate = "$script:AssetsPath\Start\start2.bin",
|
[Parameter(Mandatory)]
|
||||||
$startMenuBinFile = "$env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin"
|
[string]$startMenuBinFile,
|
||||||
|
[string]$startMenuTemplate = "$script:AssetsPath\Start\start2.bin"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Change path to correct user if a user was specified
|
|
||||||
if ($script:Params.ContainsKey("User")) {
|
|
||||||
$startMenuBinFile = GetStartMenuBinPathForUser -UserName (GetUserName)
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check if template bin file exists
|
# Check if template bin file exists
|
||||||
if (-not (Test-Path $startMenuTemplate)) {
|
if (-not (Test-Path $startMenuTemplate)) {
|
||||||
Write-Host "Error: Unable to replace start menu, template file not found" -ForegroundColor Red
|
Write-Host "Error: Unable to replace start menu, template file not found" -ForegroundColor Red
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([IO.Path]::GetExtension($startMenuTemplate) -ne ".bin" ) {
|
if ([IO.Path]::GetExtension($startMenuTemplate) -ne ".bin") {
|
||||||
Write-Host "Error: Unable to replace start menu, template file is not a valid .bin file" -ForegroundColor Red
|
Write-Host "Error: Unable to replace start menu, template file is not a valid .bin file" -ForegroundColor Red
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
$userName = GetStartMenuUserNameFromPath -StartMenuBinFile $startMenuBinFile
|
$userName = GetStartMenuUserNameFromPath -StartMenuBinFile $startMenuBinFile
|
||||||
|
|
||||||
$backupBinFile = $startMenuBinFile + ".bak"
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Replace Start Menu for user $userName with template $startMenuTemplate" -ForegroundColor Cyan
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
$timestamp = Get-Date -Format 'yyyyMMdd_HHmmss'
|
||||||
|
$backupFileName = "Win11Debloat-StartBackup-$timestamp.bak"
|
||||||
|
$startMenuDir = Split-Path $startMenuBinFile -Parent
|
||||||
|
$backupBinFile = Join-Path $startMenuDir $backupFileName
|
||||||
|
|
||||||
if (Test-Path $startMenuBinFile) {
|
if (Test-Path $startMenuBinFile) {
|
||||||
# Backup current start menu file
|
# Backup current start menu file
|
||||||
Move-Item -Path $startMenuBinFile -Destination $backupBinFile -Force
|
Copy-Item -Path $startMenuBinFile -Destination $backupBinFile -Force
|
||||||
|
Write-Verbose "Start menu backup for user $userName saved to $backupFileName"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Write-Host "Unable to find original start2.bin file for user $userName, no backup was created for this user" -ForegroundColor Yellow
|
Write-Host "Unable to find original start2.bin file for user $userName, no backup was created for this user" -ForegroundColor Yellow
|
||||||
@@ -82,6 +134,24 @@ function ReplaceStartMenu {
|
|||||||
Write-Host "Replaced start menu for user $userName"
|
Write-Host "Replaced start menu for user $userName"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Returns the full path to the start menu bin file for a given user.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Resolves the path to the start2.bin file for the specified username.
|
||||||
|
When no username is provided or the value is empty, falls back to
|
||||||
|
the current user's local app data path via $env:LOCALAPPDATA.
|
||||||
|
|
||||||
|
.PARAMETER UserName
|
||||||
|
The target username. Pass an empty string or omit to resolve for the current user.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
GetStartMenuBinPathForUser -UserName "Jeff"
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
GetStartMenuBinPathForUser -UserName "Default"
|
||||||
|
#>
|
||||||
function GetStartMenuBinPathForUser {
|
function GetStartMenuBinPathForUser {
|
||||||
param(
|
param(
|
||||||
[string]$UserName
|
[string]$UserName
|
||||||
@@ -94,6 +164,21 @@ function GetStartMenuBinPathForUser {
|
|||||||
return (GetUserDirectory -userName $UserName -fileName "AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin" -exitIfPathNotFound $false)
|
return (GetUserDirectory -userName $UserName -fileName "AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin" -exitIfPathNotFound $false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Extracts the username from a start2.bin file path.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Parses a typical C:\Users\<UserName>\AppData\... path and returns the
|
||||||
|
username portion. Returns 'unknown' if the path does not match the
|
||||||
|
expected pattern.
|
||||||
|
|
||||||
|
.PARAMETER StartMenuBinFile
|
||||||
|
The full path to a start2.bin file.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
GetStartMenuUserNameFromPath -StartMenuBinFile "$env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin"
|
||||||
|
#>
|
||||||
function GetStartMenuUserNameFromPath {
|
function GetStartMenuUserNameFromPath {
|
||||||
param(
|
param(
|
||||||
[string]$StartMenuBinFile
|
[string]$StartMenuBinFile
|
||||||
@@ -108,23 +193,119 @@ function GetStartMenuUserNameFromPath {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Returns the path to the latest start menu backup file for the given scope.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Resolves the LocalState folder for the specified scope and returns the
|
||||||
|
full path to the most recent Win11Debloat-StartBackup-*.bak file, or
|
||||||
|
$null if no backup exists.
|
||||||
|
|
||||||
|
For CurrentUser, uses $env:LOCALAPPDATA directly. For AllUsers, scans
|
||||||
|
every user profile.
|
||||||
|
|
||||||
|
.PARAMETER Scope
|
||||||
|
The scope to check: CurrentUser or AllUsers.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
$backupPath = Get-StartMenuBackupPath -Scope 'CurrentUser'
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
$backupPath = Get-StartMenuBackupPath -Scope 'AllUsers'
|
||||||
|
#>
|
||||||
|
function Get-StartMenuBackupPath {
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[ValidateSet('CurrentUser', 'AllUsers')]
|
||||||
|
[string]$Scope
|
||||||
|
)
|
||||||
|
|
||||||
|
if ($Scope -eq 'CurrentUser') {
|
||||||
|
$localStateDir = "$env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState"
|
||||||
|
$latestBackup = Get-ChildItem -Path (Join-Path $localStateDir 'Win11Debloat-StartBackup-*.bak') -ErrorAction SilentlyContinue |
|
||||||
|
Sort-Object Name -Descending |
|
||||||
|
Select-Object -First 1
|
||||||
|
if ($latestBackup) { return $latestBackup.FullName }
|
||||||
|
return $null
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$userPathString = GetUserDirectory -userName "*" -fileName "AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState"
|
||||||
|
$usersStartMenuPaths = Get-ChildItem -Path $userPathString -ErrorAction SilentlyContinue
|
||||||
|
foreach ($startMenuPath in $usersStartMenuPaths) {
|
||||||
|
$latestBackup = Get-ChildItem -Path (Join-Path $startMenuPath.FullName 'Win11Debloat-StartBackup-*.bak') -ErrorAction SilentlyContinue |
|
||||||
|
Sort-Object Name -Descending |
|
||||||
|
Select-Object -First 1
|
||||||
|
if ($latestBackup) { return $latestBackup.FullName }
|
||||||
|
}
|
||||||
|
return $null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Restores a user's start menu from a backup file.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Moves the current start2.bin to a .restore.bak safety copy, then copies
|
||||||
|
the specified backup file into place. Returns a PSCustomObject with
|
||||||
|
UserName, Result ($true/$false), and Message properties describing
|
||||||
|
the outcome.
|
||||||
|
|
||||||
|
.PARAMETER StartMenuBinFile
|
||||||
|
The full path to the user's start2.bin file to restore.
|
||||||
|
|
||||||
|
.PARAMETER BackupFilePath
|
||||||
|
Path to the backup file to restore from. If omitted, automatically
|
||||||
|
finds the latest Win11Debloat-StartBackup-*.bak file.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
RestoreStartMenuFromBackup -StartMenuBinFile "$env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin"
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
RestoreStartMenuFromBackup -StartMenuBinFile "$env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin" -BackupFilePath "C:\Backups\Win11Debloat-StartBackup-20260101_120000.bak"
|
||||||
|
#>
|
||||||
function RestoreStartMenuFromBackup {
|
function RestoreStartMenuFromBackup {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
[string]$StartMenuBinFile,
|
[string]$StartMenuBinFile,
|
||||||
[Parameter(Mandatory = $false)]
|
|
||||||
[string]$BackupFilePath
|
[string]$BackupFilePath
|
||||||
)
|
)
|
||||||
|
|
||||||
$userName = GetStartMenuUserNameFromPath -StartMenuBinFile $StartMenuBinFile
|
$userName = GetStartMenuUserNameFromPath -StartMenuBinFile $StartMenuBinFile
|
||||||
$backupBinFile = if ([string]::IsNullOrWhiteSpace($BackupFilePath)) {
|
$backupBinFile = if ([string]::IsNullOrWhiteSpace($BackupFilePath)) {
|
||||||
$StartMenuBinFile + '.bak'
|
# Auto-detect latest backup in the same folder as the start2.bin
|
||||||
|
$startMenuDir = Split-Path $StartMenuBinFile -Parent
|
||||||
|
$latestBackup = Get-ChildItem -Path (Join-Path $startMenuDir 'Win11Debloat-StartBackup-*.bak') -ErrorAction SilentlyContinue |
|
||||||
|
Sort-Object Name -Descending |
|
||||||
|
Select-Object -First 1
|
||||||
|
|
||||||
|
if ($latestBackup) { $latestBackup.FullName } else { $null }
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$BackupFilePath
|
$BackupFilePath
|
||||||
}
|
}
|
||||||
$currentBinBackup = $StartMenuBinFile + '.restore.bak'
|
$restoreTimestamp = Get-Date -Format 'yyyyMMdd_HHmmss'
|
||||||
|
$restoreBackupFileName = "Win11Debloat-StartRestore-$restoreTimestamp.bak"
|
||||||
|
$currentBinBackup = Join-Path (Split-Path $StartMenuBinFile -Parent) $restoreBackupFileName
|
||||||
|
|
||||||
|
if ([string]::IsNullOrWhiteSpace($backupBinFile)) {
|
||||||
|
return [PSCustomObject]@{
|
||||||
|
UserName = $userName
|
||||||
|
Result = $false
|
||||||
|
Message = "No start menu backup file found for user $userName."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Restore start menu for user $userName from backup $backupBinFile" -ForegroundColor Cyan
|
||||||
|
return [PSCustomObject]@{
|
||||||
|
UserName = $userName
|
||||||
|
Result = $true
|
||||||
|
Message = "[WhatIf] Restored start menu for user $userName."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (-not (Test-Path -LiteralPath $backupBinFile)) {
|
if (-not (Test-Path -LiteralPath $backupBinFile)) {
|
||||||
return [PSCustomObject]@{
|
return [PSCustomObject]@{
|
||||||
@@ -155,23 +336,61 @@ function RestoreStartMenuFromBackup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Restores the start menu for the current target user from a backup.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Resolves the start2.bin path for the currently logged-in user, then
|
||||||
|
delegates to RestoreStartMenuFromBackup.
|
||||||
|
|
||||||
|
.PARAMETER BackupFilePath
|
||||||
|
Path to the backup file to restore from. If omitted, automatically
|
||||||
|
finds the latest Win11Debloat-StartBackup-*.bak file.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
RestoreStartMenu
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
RestoreStartMenu -BackupFilePath "C:\Backups\Win11Debloat-StartBackup-20260101_120000.bak"
|
||||||
|
#>
|
||||||
function RestoreStartMenu {
|
function RestoreStartMenu {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory = $false)]
|
|
||||||
[string]$BackupFilePath
|
[string]$BackupFilePath
|
||||||
)
|
)
|
||||||
|
|
||||||
$targetUserName = GetUserName
|
$targetUserName = $env:USERNAME
|
||||||
$startMenuBinFile = GetStartMenuBinPathForUser -UserName $targetUserName
|
$startMenuBinFile = "$env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin"
|
||||||
|
|
||||||
Write-Host "Restoring start menu for user $targetUserName from backup..."
|
Write-Host "Restoring start menu for user $targetUserName from backup..."
|
||||||
|
|
||||||
return RestoreStartMenuFromBackup -StartMenuBinFile $startMenuBinFile -BackupFilePath $BackupFilePath
|
return RestoreStartMenuFromBackup -StartMenuBinFile $startMenuBinFile -BackupFilePath $BackupFilePath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Restores the start menu for all user profiles from a backup.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Iterates over every existing user profile and restores each user's
|
||||||
|
start2.bin from the latest backup in their LocalState folder. For the
|
||||||
|
Default user profile, removes the start2.bin file (which was previously
|
||||||
|
copied from a template) so that new profiles revert to the system
|
||||||
|
default start menu.
|
||||||
|
|
||||||
|
.PARAMETER BackupFilePath
|
||||||
|
Path to the backup file to restore from. If omitted, automatically
|
||||||
|
finds the latest Win11Debloat-StartBackup-*.bak in each user's
|
||||||
|
LocalState folder.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
RestoreStartMenuForAllUsers
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
RestoreStartMenuForAllUsers -BackupFilePath "C:\Backups\Win11Debloat-StartBackup-20260101_120000.bak"
|
||||||
|
#>
|
||||||
function RestoreStartMenuForAllUsers {
|
function RestoreStartMenuForAllUsers {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory = $false)]
|
|
||||||
[string]$BackupFilePath
|
[string]$BackupFilePath
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -191,6 +410,15 @@ function RestoreStartMenuForAllUsers {
|
|||||||
if (Test-Path $defaultStartMenuPath) {
|
if (Test-Path $defaultStartMenuPath) {
|
||||||
$defaultStartMenuBinFile = Join-Path $defaultStartMenuPath 'start2.bin'
|
$defaultStartMenuBinFile = Join-Path $defaultStartMenuPath 'start2.bin'
|
||||||
if (Test-Path -LiteralPath $defaultStartMenuBinFile) {
|
if (Test-Path -LiteralPath $defaultStartMenuBinFile) {
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Remove start2.bin for the default user profile" -ForegroundColor Cyan
|
||||||
|
$results += [PSCustomObject]@{
|
||||||
|
UserName = 'Default'
|
||||||
|
Result = $true
|
||||||
|
Message = '[WhatIf] Removed start2.bin for the default user profile.'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
try {
|
try {
|
||||||
Remove-Item -LiteralPath $defaultStartMenuBinFile -Force
|
Remove-Item -LiteralPath $defaultStartMenuBinFile -Force
|
||||||
$results += [PSCustomObject]@{
|
$results += [PSCustomObject]@{
|
||||||
@@ -208,6 +436,7 @@ function RestoreStartMenuForAllUsers {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($results.Count -eq 0) {
|
if ($results.Count -eq 0) {
|
||||||
$results += [PSCustomObject]@{
|
$results += [PSCustomObject]@{
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ function RestartExplorer {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Restart the Windows Explorer process" -ForegroundColor Cyan
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
Write-Host "> Attempting to restart the Windows Explorer process to apply all changes..."
|
Write-Host "> Attempting to restart the Windows Explorer process to apply all changes..."
|
||||||
|
|
||||||
if ($script:Params.ContainsKey("NoRestartExplorer")) {
|
if ($script:Params.ContainsKey("NoRestartExplorer")) {
|
||||||
|
|||||||
@@ -133,6 +133,11 @@ function Restore-RegistryBackupState {
|
|||||||
|
|
||||||
$friendlyTarget = GetFriendlyRegistryBackupTarget -Target ([string]$Backup.Target)
|
$friendlyTarget = GetFriendlyRegistryBackupTarget -Target ([string]$Backup.Target)
|
||||||
|
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Restore registry backup for $friendlyTarget" -ForegroundColor Cyan
|
||||||
|
return [PSCustomObject]@{ Result = $true }
|
||||||
|
}
|
||||||
|
|
||||||
$restoreAction = {
|
$restoreAction = {
|
||||||
param($normalizedBackup)
|
param($normalizedBackup)
|
||||||
|
|
||||||
@@ -148,9 +153,10 @@ function Restore-RegistryBackupState {
|
|||||||
Write-Host "Restore requires loading target user hive."
|
Write-Host "Restore requires loading target user hive."
|
||||||
Invoke-WithLoadedRestoreHive -Target $Backup.Target -ScriptBlock $restoreAction -ArgumentObject $Backup
|
Invoke-WithLoadedRestoreHive -Target $Backup.Target -ScriptBlock $restoreAction -ArgumentObject $Backup
|
||||||
Write-Host "Restore completed for $friendlyTarget."
|
Write-Host "Restore completed for $friendlyTarget."
|
||||||
return
|
return [PSCustomObject]@{ Result = $true }
|
||||||
}
|
}
|
||||||
|
|
||||||
& $restoreAction $Backup
|
& $restoreAction $Backup
|
||||||
Write-Host "Restore completed for $friendlyTarget."
|
Write-Host "Restore completed for $friendlyTarget."
|
||||||
|
return [PSCustomObject]@{ Result = $true }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,63 @@
|
|||||||
# Disables Microsoft Store search suggestions in the start menu for all users by denying access to the Store app database file for each user
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Disables Microsoft Store search suggestions in the start menu for all user profiles.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Iterates over every existing user profile and the Default user profile,
|
||||||
|
denying the EVERYONE group FullControl access to each user's Store app
|
||||||
|
database file (store.db). This prevents Windows from showing Store search
|
||||||
|
suggestions in the start menu search pane.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
DisableStoreSearchSuggestionsForAllUsers
|
||||||
|
#>
|
||||||
function DisableStoreSearchSuggestionsForAllUsers {
|
function DisableStoreSearchSuggestionsForAllUsers {
|
||||||
# Get path to Store app database for all users
|
# Get path to Store app database for all users
|
||||||
$userPathString = GetUserDirectory -userName "*" -fileName "AppData\Local\Packages"
|
$userPathString = GetUserDirectory -userName "*" -fileName "AppData\Local\Packages"
|
||||||
$usersStoreDbPaths = Get-ChildItem -Path $userPathString -ErrorAction SilentlyContinue
|
$usersStoreDbPaths = Get-ChildItem -Path $userPathString -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
# Go through all users and disable start search suggestions
|
# Go through all users and disable start search suggestions
|
||||||
ForEach ($storeDbPath in $usersStoreDbPaths) {
|
foreach ($storeDbPath in $usersStoreDbPaths) {
|
||||||
DisableStoreSearchSuggestions ($storeDbPath.FullName + "\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db")
|
DisableStoreSearchSuggestions -StoreAppsDatabase ($storeDbPath.FullName + "\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db")
|
||||||
}
|
}
|
||||||
|
|
||||||
# Also disable start search suggestions for the default user profile
|
# Also disable start search suggestions for the default user profile
|
||||||
$defaultStoreDbPath = GetUserDirectory -userName "Default" -fileName "AppData\Local\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db" -exitIfPathNotFound $false
|
$defaultStoreDbPath = GetStoreAppsDatabasePathForUser -UserName "Default"
|
||||||
DisableStoreSearchSuggestions $defaultStoreDbPath
|
if ($defaultStoreDbPath) {
|
||||||
|
DisableStoreSearchSuggestions -StoreAppsDatabase $defaultStoreDbPath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Disables Microsoft Store search suggestions in the start menu by denying access to the Store app database file
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Disables Microsoft Store search suggestions for a single user.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Denies the EVERYONE group FullControl access to the specified Store app
|
||||||
|
database file (store.db). If the file does not exist (e.g. on EEA systems
|
||||||
|
where Store app suggestions are absent by default), it creates the file
|
||||||
|
and its parent directory first to prevent Windows from recreating it later.
|
||||||
|
|
||||||
|
.PARAMETER StoreAppsDatabase
|
||||||
|
The full path to the user's store.db file.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
DisableStoreSearchSuggestions -StoreAppsDatabase "$env:LOCALAPPDATA\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db"
|
||||||
|
#>
|
||||||
function DisableStoreSearchSuggestions {
|
function DisableStoreSearchSuggestions {
|
||||||
param (
|
param (
|
||||||
$StoreAppsDatabase = "$env:LocalAppData\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db"
|
[Parameter(Mandatory)]
|
||||||
|
[string]$StoreAppsDatabase
|
||||||
)
|
)
|
||||||
|
|
||||||
# Change path to correct user if a user was specified
|
|
||||||
if ($script:Params.ContainsKey("User")) {
|
|
||||||
$StoreAppsDatabase = GetUserDirectory -userName "$(GetUserName)" -fileName "AppData\Local\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db" -exitIfPathNotFound $false
|
|
||||||
}
|
|
||||||
|
|
||||||
$userName = [regex]::Match($StoreAppsDatabase, '(?:Users\\)([^\\]+)(?:\\AppData)').Groups[1].Value
|
$userName = [regex]::Match($StoreAppsDatabase, '(?:Users\\)([^\\]+)(?:\\AppData)').Groups[1].Value
|
||||||
|
if (-not $userName) { $userName = '<unknown>' }
|
||||||
|
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Disable Microsoft Store search suggestions for user $userName by restricting access to ${StoreAppsDatabase}" -ForegroundColor Cyan
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
# This file doesn't exist in EEA (No Store app suggestions).
|
# This file doesn't exist in EEA (No Store app suggestions).
|
||||||
if (-not (Test-Path -Path $StoreAppsDatabase))
|
if (-not (Test-Path -Path $StoreAppsDatabase))
|
||||||
@@ -51,34 +82,66 @@ function DisableStoreSearchSuggestions {
|
|||||||
Write-Host "Disabled Microsoft Store search suggestions for user $userName"
|
Write-Host "Disabled Microsoft Store search suggestions for user $userName"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Re-enables Microsoft Store search suggestions in the start menu for all user profiles.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Iterates over every existing user profile and the Default user profile,
|
||||||
|
removing the deny ACL from each user's Store app database file (store.db)
|
||||||
|
and then deleting the file. This restores the default Windows behavior
|
||||||
|
where Store search suggestions appear in the start menu.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
EnableStoreSearchSuggestionsForAllUsers
|
||||||
|
#>
|
||||||
function EnableStoreSearchSuggestionsForAllUsers {
|
function EnableStoreSearchSuggestionsForAllUsers {
|
||||||
# Get path to Store app database for all users
|
# Get path to Store app database for all users
|
||||||
$userPathString = GetUserDirectory -userName "*" -fileName "AppData\Local\Packages"
|
$userPathString = GetUserDirectory -userName "*" -fileName "AppData\Local\Packages"
|
||||||
$usersStoreDbPaths = Get-ChildItem -Path $userPathString -ErrorAction SilentlyContinue
|
$usersStoreDbPaths = Get-ChildItem -Path $userPathString -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
# Go through all users and re-enable start search suggestions
|
# Go through all users and re-enable start search suggestions
|
||||||
ForEach ($storeDbPath in $usersStoreDbPaths) {
|
foreach ($storeDbPath in $usersStoreDbPaths) {
|
||||||
EnableStoreSearchSuggestions ($storeDbPath.FullName + "\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db")
|
EnableStoreSearchSuggestions -StoreAppsDatabase ($storeDbPath.FullName + "\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db")
|
||||||
}
|
}
|
||||||
|
|
||||||
# Also re-enable for the default user profile
|
# Also re-enable for the default user profile
|
||||||
$defaultStoreDbPath = GetUserDirectory -userName "Default" -fileName "AppData\Local\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db" -exitIfPathNotFound $false
|
$defaultStoreDbPath = GetStoreAppsDatabasePathForUser -UserName "Default"
|
||||||
EnableStoreSearchSuggestions $defaultStoreDbPath
|
if ($defaultStoreDbPath) {
|
||||||
|
EnableStoreSearchSuggestions -StoreAppsDatabase $defaultStoreDbPath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Re-enables Microsoft Store search suggestions for a single user.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Takes ownership of the specified Store app database file, removes any
|
||||||
|
EVERYONE deny FullControl ACL entries, and deletes the file. If the file
|
||||||
|
does not exist, no action is taken. Callers should handle the case where
|
||||||
|
the file is absent gracefully.
|
||||||
|
|
||||||
|
.PARAMETER StoreAppsDatabase
|
||||||
|
The full path to the user's store.db file.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
EnableStoreSearchSuggestions -StoreAppsDatabase "$env:LOCALAPPDATA\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db"
|
||||||
|
#>
|
||||||
function EnableStoreSearchSuggestions {
|
function EnableStoreSearchSuggestions {
|
||||||
param (
|
param (
|
||||||
$StoreAppsDatabase = "$env:LocalAppData\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db"
|
[Parameter(Mandatory)]
|
||||||
|
[string]$StoreAppsDatabase
|
||||||
)
|
)
|
||||||
|
|
||||||
# Change path to correct user if a user was specified
|
|
||||||
if ($script:Params.ContainsKey("User")) {
|
|
||||||
$StoreAppsDatabase = GetUserDirectory -userName "$(GetUserName)" -fileName "AppData\Local\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db" -exitIfPathNotFound $false
|
|
||||||
}
|
|
||||||
|
|
||||||
$userName = [regex]::Match($StoreAppsDatabase, '(?:Users\\)([^\\]+)(?:\\AppData)').Groups[1].Value
|
$userName = [regex]::Match($StoreAppsDatabase, '(?:Users\\)([^\\]+)(?:\\AppData)').Groups[1].Value
|
||||||
if (-not $userName) { $userName = '<unknown>' }
|
if (-not $userName) { $userName = '<unknown>' }
|
||||||
|
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Re-enable Microsoft Store search suggestions for user $userName by restoring access to ${StoreAppsDatabase}" -ForegroundColor Cyan
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (-not (Test-Path -Path $StoreAppsDatabase)) {
|
if (-not (Test-Path -Path $StoreAppsDatabase)) {
|
||||||
Write-Host "Store app database not found for user $userName, nothing to undo"
|
Write-Host "Store app database not found for user $userName, nothing to undo"
|
||||||
return
|
return
|
||||||
@@ -120,6 +183,51 @@ function EnableStoreSearchSuggestions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Returns the full path to the Store app database file for a given user.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Resolves the path to the Microsoft Store app database (store.db) for the
|
||||||
|
specified username. When no username is provided or the value is empty,
|
||||||
|
falls back to the current user's local app data path via $env:LOCALAPPDATA.
|
||||||
|
|
||||||
|
.PARAMETER UserName
|
||||||
|
The target username. Pass an empty string or omit to resolve for the current user.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
GetStoreAppsDatabasePathForUser -UserName "Jeff"
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
GetStoreAppsDatabasePathForUser -UserName "Default"
|
||||||
|
#>
|
||||||
|
function GetStoreAppsDatabasePathForUser {
|
||||||
|
param(
|
||||||
|
[string]$UserName
|
||||||
|
)
|
||||||
|
|
||||||
|
if ([string]::IsNullOrWhiteSpace($UserName)) {
|
||||||
|
return "$env:LOCALAPPDATA\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db"
|
||||||
|
}
|
||||||
|
|
||||||
|
return (GetUserDirectory -userName $UserName -fileName "AppData\Local\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db" -exitIfPathNotFound $false)
|
||||||
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Tests whether Store search suggestions are disabled for a single user.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Checks whether the specified store.db file has an EVERYONE deny
|
||||||
|
FullControl ACL entry applied. Returns $true if the deny rule is present,
|
||||||
|
$false otherwise (including when the file or directory does not exist).
|
||||||
|
|
||||||
|
.PARAMETER StoreAppsDatabase
|
||||||
|
The full path to the user's store.db file.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Test-StoreSearchSuggestionsDisabled -StoreAppsDatabase "C:\Users\Jeff\AppData\Local\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db"
|
||||||
|
#>
|
||||||
function Test-StoreSearchSuggestionsDisabled {
|
function Test-StoreSearchSuggestionsDisabled {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
@@ -147,7 +255,8 @@ function Test-StoreSearchSuggestionsDisabled {
|
|||||||
$isEveryone = $false
|
$isEveryone = $false
|
||||||
try {
|
try {
|
||||||
$isEveryone = $accessRule.IdentityReference.Translate([System.Security.Principal.SecurityIdentifier]) -eq $everyoneSid
|
$isEveryone = $accessRule.IdentityReference.Translate([System.Security.Principal.SecurityIdentifier]) -eq $everyoneSid
|
||||||
} catch { }
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
if ($isEveryone) {
|
if ($isEveryone) {
|
||||||
return $true
|
return $true
|
||||||
@@ -157,6 +266,19 @@ function Test-StoreSearchSuggestionsDisabled {
|
|||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Tests whether Store search suggestions are disabled for all user profiles.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Collects the store.db paths for all existing user profiles and the Default
|
||||||
|
user profile, then verifies that every one of them has the EVERYONE deny
|
||||||
|
FullControl ACL applied. Returns $true only if ALL paths pass the check.
|
||||||
|
Returns $false immediately if any user's store.db is not disabled.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Test-StoreSearchSuggestionsDisabledForAllUsers
|
||||||
|
#>
|
||||||
function Test-StoreSearchSuggestionsDisabledForAllUsers {
|
function Test-StoreSearchSuggestionsDisabledForAllUsers {
|
||||||
$paths = @()
|
$paths = @()
|
||||||
|
|
||||||
@@ -166,7 +288,7 @@ function Test-StoreSearchSuggestionsDisabledForAllUsers {
|
|||||||
$paths += ($storeDbPath.FullName + "\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db")
|
$paths += ($storeDbPath.FullName + "\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db")
|
||||||
}
|
}
|
||||||
|
|
||||||
$defaultStoreDbPath = GetUserDirectory -userName "Default" -fileName "AppData\Local\Packages\Microsoft.WindowsStore_8wekyb3d8bbwe\LocalState\store.db" -exitIfPathNotFound $false
|
$defaultStoreDbPath = GetStoreAppsDatabasePathForUser -UserName "Default"
|
||||||
if ($defaultStoreDbPath) {
|
if ($defaultStoreDbPath) {
|
||||||
$paths += $defaultStoreDbPath
|
$paths += $defaultStoreDbPath
|
||||||
}
|
}
|
||||||
128
Scripts/Features/TelemetryScheduledTasks.ps1
Normal file
128
Scripts/Features/TelemetryScheduledTasks.ps1
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
# List of known Windows telemetry-related scheduled tasks
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Returns the list of known Windows telemetry-related scheduled tasks.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Returns an array of hashtables, each with a Path and Name key, representing
|
||||||
|
scheduled tasks that collect or report telemetry data on Windows.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Get-TelemetryScheduledTasks
|
||||||
|
#>
|
||||||
|
function Get-TelemetryScheduledTasks {
|
||||||
|
return @(
|
||||||
|
@{ Path = "\Microsoft\Windows\Application Experience\"; Name = "Microsoft Compatibility Appraiser" },
|
||||||
|
@{ Path = "\Microsoft\Windows\Application Experience\"; Name = "Microsoft Compatibility Appraiser Exp" },
|
||||||
|
@{ Path = "\Microsoft\Windows\Application Experience\"; Name = "ProgramDataUpdater" },
|
||||||
|
@{ Path = "\Microsoft\Windows\Application Experience\"; Name = "StartupAppTask" },
|
||||||
|
@{ Path = "\Microsoft\Windows\Customer Experience Improvement Program\"; Name = "Consolidator" },
|
||||||
|
@{ Path = "\Microsoft\Windows\Customer Experience Improvement Program\"; Name = "UsbCeip" },
|
||||||
|
@{ Path = "\Microsoft\Windows\DiskDiagnostic\"; Name = "Microsoft-Windows-DiskDiagnosticDataCollector" },
|
||||||
|
@{ Path = "\Microsoft\Windows\Autochk\"; Name = "Proxy" }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Disables known Windows telemetry-related scheduled tasks.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Iterates over a predefined list of Windows scheduled tasks associated with
|
||||||
|
telemetry and disables each one that exists and is not already disabled.
|
||||||
|
Supports -WhatIf to preview changes without applying them.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Disable-TelemetryScheduledTasks
|
||||||
|
#>
|
||||||
|
function Disable-TelemetryScheduledTasks {
|
||||||
|
Write-Host "> Disabling telemetry scheduled tasks..."
|
||||||
|
$tasks = Get-TelemetryScheduledTasks
|
||||||
|
|
||||||
|
foreach ($task in $tasks) {
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Disable Scheduled Task: $($task.Path)$($task.Name)" -ForegroundColor Cyan
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = Invoke-NonBlocking -ScriptBlock {
|
||||||
|
param($path, $name)
|
||||||
|
Import-Module ScheduledTasks -ErrorAction SilentlyContinue
|
||||||
|
$taskObj = Get-ScheduledTask -TaskPath $path -TaskName $name -ErrorAction SilentlyContinue
|
||||||
|
if (-not $taskObj) {
|
||||||
|
return @{ Success = $true; Status = 'NotFound' }
|
||||||
|
}
|
||||||
|
if ($taskObj.State -ne 'Disabled') {
|
||||||
|
try {
|
||||||
|
Disable-ScheduledTask -TaskPath $path -TaskName $name -ErrorAction Stop | Out-Null
|
||||||
|
return @{ Success = $true; Status = 'Disabled' }
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return @{ Success = $false; Status = 'Error'; Error = $_.Exception.Message }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return @{ Success = $true; Status = 'AlreadyDisabled' }
|
||||||
|
} -ArgumentList @($task.Path, $task.Name)
|
||||||
|
|
||||||
|
switch ($result.Status) {
|
||||||
|
'Disabled' { Write-Host "Disabled Scheduled Task: $($task.Path)$($task.Name)" }
|
||||||
|
'AlreadyDisabled' { Write-Host "Scheduled Task $($task.Path)$($task.Name) is already disabled" -ForegroundColor DarkGray }
|
||||||
|
'NotFound' { Write-Host "Scheduled Task $($task.Path)$($task.Name) not found" -ForegroundColor DarkGray }
|
||||||
|
'Error' { Write-Host "Failed to disable Scheduled Task: $($task.Path)$($task.Name) - $($result.Error)" -ForegroundColor Yellow }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host ""
|
||||||
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Enables known Windows telemetry-related scheduled tasks.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Iterates over a predefined list of Windows scheduled tasks associated with
|
||||||
|
telemetry and enables each one that exists and is currently disabled.
|
||||||
|
Supports -WhatIf to preview changes without applying them.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Enable-TelemetryScheduledTasks
|
||||||
|
#>
|
||||||
|
function Enable-TelemetryScheduledTasks {
|
||||||
|
Write-Host "> Enabling telemetry scheduled tasks..."
|
||||||
|
$tasks = Get-TelemetryScheduledTasks
|
||||||
|
|
||||||
|
foreach ($task in $tasks) {
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Enable Scheduled Task: $($task.Path)$($task.Name)" -ForegroundColor Cyan
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = Invoke-NonBlocking -ScriptBlock {
|
||||||
|
param($path, $name)
|
||||||
|
Import-Module ScheduledTasks -ErrorAction SilentlyContinue
|
||||||
|
$taskObj = Get-ScheduledTask -TaskPath $path -TaskName $name -ErrorAction SilentlyContinue
|
||||||
|
if (-not $taskObj) {
|
||||||
|
return @{ Success = $true; Status = 'NotFound' }
|
||||||
|
}
|
||||||
|
if ($taskObj.State -eq 'Disabled') {
|
||||||
|
try {
|
||||||
|
Enable-ScheduledTask -TaskPath $path -TaskName $name -ErrorAction Stop | Out-Null
|
||||||
|
return @{ Success = $true; Status = 'Enabled' }
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return @{ Success = $false; Status = 'Error'; Error = $_.Exception.Message }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return @{ Success = $true; Status = 'AlreadyEnabled' }
|
||||||
|
} -ArgumentList @($task.Path, $task.Name)
|
||||||
|
|
||||||
|
switch ($result.Status) {
|
||||||
|
'Enabled' { Write-Host "Enabled Scheduled Task: $($task.Path)$($task.Name)" }
|
||||||
|
'AlreadyEnabled' { Write-Host "Scheduled Task $($task.Path)$($task.Name) is already enabled." -ForegroundColor DarkGray }
|
||||||
|
'NotFound' { Write-Host "Scheduled Task $($task.Path)$($task.Name) not found." -ForegroundColor DarkGray }
|
||||||
|
'Error' { Write-Host "Failed to enable Scheduled Task: $($task.Path)$($task.Name) - $($result.Error)" -ForegroundColor Yellow }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host ""
|
||||||
|
}
|
||||||
@@ -4,6 +4,12 @@ function EnableWindowsFeature {
|
|||||||
[string]$FeatureName
|
[string]$FeatureName
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Enable Windows feature: $FeatureName" -ForegroundColor Cyan
|
||||||
|
Write-Host ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
$result = Invoke-NonBlocking -ScriptBlock {
|
$result = Invoke-NonBlocking -ScriptBlock {
|
||||||
param($name)
|
param($name)
|
||||||
Enable-WindowsOptionalFeature -Online -FeatureName $name -All -NoRestart
|
Enable-WindowsOptionalFeature -Online -FeatureName $name -All -NoRestart
|
||||||
@@ -21,6 +27,12 @@ function DisableWindowsFeature {
|
|||||||
[string]$FeatureName
|
[string]$FeatureName
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Disable Windows feature: $FeatureName" -ForegroundColor Cyan
|
||||||
|
Write-Host ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
$result = Invoke-NonBlocking -ScriptBlock {
|
$result = Invoke-NonBlocking -ScriptBlock {
|
||||||
param($name)
|
param($name)
|
||||||
Disable-WindowsOptionalFeature -Online -FeatureName $name -NoRestart
|
Disable-WindowsOptionalFeature -Online -FeatureName $name -NoRestart
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
function LoadAppsDetailsFromJson {
|
function LoadAppsDetailsFromJson {
|
||||||
param (
|
param (
|
||||||
[switch]$OnlyInstalled,
|
[switch]$OnlyInstalled,
|
||||||
[string]$InstalledList = "",
|
[object[]]$InstalledList = $null,
|
||||||
[switch]$InitialCheckedFromJson
|
[switch]$InitialCheckedFromJson
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -24,15 +24,19 @@ function LoadAppsDetailsFromJson {
|
|||||||
if ($OnlyInstalled) {
|
if ($OnlyInstalled) {
|
||||||
$isInstalled = $false
|
$isInstalled = $false
|
||||||
foreach ($appId in $appIdArray) {
|
foreach ($appId in $appIdArray) {
|
||||||
if (($InstalledList -like ("*$appId*")) -or (Get-AppxPackage -Name $appId)) {
|
# Check Get-AppxPackage first (fast, no process launch)
|
||||||
|
if (Get-AppxPackage -Name $appId) {
|
||||||
$isInstalled = $true
|
$isInstalled = $true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if (($appId -eq "Microsoft.Edge") -and ($InstalledList -like "* Microsoft.Edge *")) {
|
|
||||||
|
# Then check the pre-fetched winget list
|
||||||
|
if ($InstalledList -and (Test-AppInWingetList -appId $appId -InstalledList $InstalledList)) {
|
||||||
$isInstalled = $true
|
$isInstalled = $true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not $isInstalled) { continue }
|
if (-not $isInstalled) { continue }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,6 +56,7 @@ function LoadAppsDetailsFromJson {
|
|||||||
Description = $appData.Description
|
Description = $appData.Description
|
||||||
SelectedByDefault = $appData.SelectedByDefault
|
SelectedByDefault = $appData.SelectedByDefault
|
||||||
Recommendation = $appData.Recommendation
|
Recommendation = $appData.Recommendation
|
||||||
|
RemovalMethod = if ($appData.RemovalMethod -and $appData.RemovalMethod -eq 'WinGet') { 'WinGet' } else { 'Appx' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,19 @@
|
|||||||
# Returns list of apps from the specified file, it trims the app names and removes any comments
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Returns a list of app IDs from the specified JSON file.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Reads an Apps.json file and returns the AppIds for every entry where
|
||||||
|
SelectedByDefault is $true. Each app entry may declare a single AppId
|
||||||
|
or an array of AppIds; both forms are handled transparently.
|
||||||
|
|
||||||
|
.PARAMETER appsFilePath
|
||||||
|
Path to a JSON file in the Config/Apps.json format.
|
||||||
|
|
||||||
|
.OUTPUTS
|
||||||
|
System.String[]. An array of app ID strings, or an empty array if the
|
||||||
|
file does not exist or contains no selected-by-default apps.
|
||||||
|
#>
|
||||||
function LoadAppsFromFile {
|
function LoadAppsFromFile {
|
||||||
param (
|
param (
|
||||||
$appsFilePath
|
$appsFilePath
|
||||||
@@ -11,9 +26,6 @@ function LoadAppsFromFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
# Check if file is JSON or text format
|
|
||||||
if ($appsFilePath -like "*.json") {
|
|
||||||
# JSON file format
|
|
||||||
$jsonContent = Get-Content -Path $appsFilePath -Raw | ConvertFrom-Json
|
$jsonContent = Get-Content -Path $appsFilePath -Raw | ConvertFrom-Json
|
||||||
Foreach ($appData in $jsonContent.Apps) {
|
Foreach ($appData in $jsonContent.Apps) {
|
||||||
# Handle AppId as array (could be single or multiple IDs)
|
# Handle AppId as array (could be single or multiple IDs)
|
||||||
@@ -24,19 +36,6 @@ function LoadAppsFromFile {
|
|||||||
$appsList += $appIdArray
|
$appsList += $appIdArray
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
# Legacy text file format
|
|
||||||
Foreach ($app in (Get-Content -Path $appsFilePath | Where-Object { $_ -notmatch '^#.*' -and $_ -notmatch '^\s*$' } )) {
|
|
||||||
if (-not ($app.IndexOf('#') -eq -1)) {
|
|
||||||
$app = $app.Substring(0, $app.IndexOf('#'))
|
|
||||||
}
|
|
||||||
|
|
||||||
$app = $app.Trim()
|
|
||||||
$appString = $app.Trim('*')
|
|
||||||
$appsList += $appString
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $appsList
|
return $appsList
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ function LoadSettings {
|
|||||||
|
|
||||||
$feature = $script:Features[$setting.Name]
|
$feature = $script:Features[$setting.Name]
|
||||||
|
|
||||||
|
# Skip unknown settings that aren't defined in Features.json
|
||||||
|
if (-not $feature) { continue }
|
||||||
|
|
||||||
# Check version and feature compatibility using Features.json
|
# Check version and feature compatibility using Features.json
|
||||||
if (($feature.MinVersion -and $WinVersion -lt $feature.MinVersion) -or ($feature.MaxVersion -and $WinVersion -gt $feature.MaxVersion) -or ($feature.FeatureId -eq 'DisableModernStandbyNetworking' -and (-not $script:ModernStandbySupported))) {
|
if (($feature.MinVersion -and $WinVersion -lt $feature.MinVersion) -or ($feature.MaxVersion -and $WinVersion -gt $feature.MaxVersion) -or ($feature.FeatureId -eq 'DisableModernStandbyNetworking' -and (-not $script:ModernStandbySupported))) {
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
# Saves the provided appsList to the CustomAppsList file
|
|
||||||
function SaveCustomAppsListToFile {
|
|
||||||
param (
|
|
||||||
$appsList
|
|
||||||
)
|
|
||||||
|
|
||||||
$script:SelectedApps = $appsList
|
|
||||||
|
|
||||||
# Create file that stores selected apps if it doesn't exist
|
|
||||||
if (-not (Test-Path $script:CustomAppsListFilePath)) {
|
|
||||||
$null = New-Item $script:CustomAppsListFilePath -ItemType File
|
|
||||||
}
|
|
||||||
|
|
||||||
Set-Content -Path $script:CustomAppsListFilePath -Value $script:SelectedApps
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,17 @@
|
|||||||
# Saves the current settings, excluding control parameters, to 'LastUsedSettings.json' file
|
# Saves the current settings, excluding control parameters, to 'LastUsedSettings.json' file
|
||||||
function SaveSettings {
|
function SaveSettings {
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Save settings to LastUsedSettings.json" -ForegroundColor Cyan
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
$settings = @{
|
$settings = @{
|
||||||
"Version" = "1.0"
|
"Version" = "1.0"
|
||||||
"Settings" = @()
|
"Settings" = @()
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($param in $script:Params.Keys) {
|
foreach ($param in $script:Params.Keys) {
|
||||||
if ($script:ControlParams -notcontains $param) {
|
if ($script:ControlParams -notcontains $param -and $script:Features.ContainsKey($param)) {
|
||||||
$value = $script:Params[$param]
|
$value = $script:Params[$param]
|
||||||
|
|
||||||
$settings.Settings += @{
|
$settings.Settings += @{
|
||||||
|
|||||||
@@ -187,10 +187,10 @@ function Update-AppRemovalScopeDescription {
|
|||||||
$AppRemovalScopeDescription.Text = "Apps will be removed for all users and from the Windows image to prevent reinstallation for new users."
|
$AppRemovalScopeDescription.Text = "Apps will be removed for all users and from the Windows image to prevent reinstallation for new users."
|
||||||
}
|
}
|
||||||
"Current user only" {
|
"Current user only" {
|
||||||
$AppRemovalScopeDescription.Text = "Apps will only be removed for the current user. Existing and new users will not be affected."
|
$AppRemovalScopeDescription.Text = "Apps will only be removed for the current user."
|
||||||
}
|
}
|
||||||
"Target user only" {
|
"Target user only" {
|
||||||
$AppRemovalScopeDescription.Text = "Apps will only be removed for the specified target user. Existing and new users will not be affected."
|
$AppRemovalScopeDescription.Text = "Apps will only be removed for the specified target user."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -311,12 +311,13 @@ function Load-AppsWithList {
|
|||||||
[System.Windows.Controls.CheckBox]$OnlyInstalledAppsBox,
|
[System.Windows.Controls.CheckBox]$OnlyInstalledAppsBox,
|
||||||
[System.Windows.Controls.Border]$LoadingAppsIndicator,
|
[System.Windows.Controls.Border]$LoadingAppsIndicator,
|
||||||
[System.Windows.Controls.MenuItem]$ImportConfigBtn,
|
[System.Windows.Controls.MenuItem]$ImportConfigBtn,
|
||||||
[string]$ListOfApps
|
[object[]]$ListOfApps
|
||||||
)
|
)
|
||||||
|
|
||||||
$script:MainWindowLastSelectedCheckbox = $null
|
$script:MainWindowLastSelectedCheckbox = $null
|
||||||
|
|
||||||
$loaderScriptPath = $script:LoadAppsDetailsScriptPath
|
$loaderScriptPath = $script:LoadAppsDetailsScriptPath
|
||||||
|
$helperScriptPath = $script:TestAppInWingetListScriptPath
|
||||||
$appsFilePath = $script:AppsListFilePath
|
$appsFilePath = $script:AppsListFilePath
|
||||||
$onlyInstalled = [bool]$OnlyInstalledAppsBox.IsChecked
|
$onlyInstalled = [bool]$OnlyInstalledAppsBox.IsChecked
|
||||||
|
|
||||||
@@ -326,13 +327,16 @@ function Load-AppsWithList {
|
|||||||
$script:PreloadedAppData = $null
|
$script:PreloadedAppData = $null
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# Load apps details in a background job to keep the UI responsive
|
# Load apps details in a background job to keep the UI responsive.
|
||||||
|
# The helper is dot-sourced inside the job because the runspace
|
||||||
|
# does not inherit the parent scope's dot-sourced functions.
|
||||||
$rawAppData = Invoke-NonBlocking -ScriptBlock {
|
$rawAppData = Invoke-NonBlocking -ScriptBlock {
|
||||||
param($loaderScript, $appsListFilePath, $installedList, $onlyInstalled)
|
param($loaderScript, $helperScript, $appsListFilePath, $installedList, $onlyInstalled)
|
||||||
$script:AppsListFilePath = $appsListFilePath
|
$script:AppsListFilePath = $appsListFilePath
|
||||||
|
. $helperScript
|
||||||
. $loaderScript
|
. $loaderScript
|
||||||
LoadAppsDetailsFromJson -OnlyInstalled:$onlyInstalled -InstalledList $installedList -InitialCheckedFromJson:$false
|
LoadAppsDetailsFromJson -OnlyInstalled:$onlyInstalled -InstalledList $installedList -InitialCheckedFromJson:$false
|
||||||
} -ArgumentList $loaderScriptPath, $appsFilePath, $ListOfApps, $onlyInstalled
|
} -ArgumentList $loaderScriptPath, $helperScriptPath, $appsFilePath, $ListOfApps, $onlyInstalled
|
||||||
}
|
}
|
||||||
|
|
||||||
$appsToAdd = @($rawAppData | Where-Object { $_ -and ($_.AppId -or $_.FriendlyName) } | Sort-Object -Property FriendlyName)
|
$appsToAdd = @($rawAppData | Where-Object { $_ -and ($_.AppId -or $_.FriendlyName) } | Sort-Object -Property FriendlyName)
|
||||||
@@ -348,10 +352,9 @@ function Load-AppsWithList {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
$brushSafe = [System.Windows.Media.BrushConverter]::new().ConvertFromString('#4CAF50')
|
$brushSafe = $Window.Resources['AppRecommendationSafeColor']
|
||||||
$brushUnsafe = [System.Windows.Media.BrushConverter]::new().ConvertFromString('#F44336')
|
$brushDefault = $Window.Resources['AppRecommendationOptionalColor']
|
||||||
$brushDefault = [System.Windows.Media.BrushConverter]::new().ConvertFromString('#FFC107')
|
$brushUnsafe = $Window.Resources['AppRecommendationUnsafeColor']
|
||||||
$brushSafe.Freeze(); $brushUnsafe.Freeze(); $brushDefault.Freeze()
|
|
||||||
|
|
||||||
# Create WPF controls; pump the Dispatcher every batch so the spinner keeps animating.
|
# Create WPF controls; pump the Dispatcher every batch so the spinner keeps animating.
|
||||||
$batchSize = 20
|
$batchSize = 20
|
||||||
@@ -381,7 +384,7 @@ function Load-AppsWithList {
|
|||||||
$dot.ToolTip = switch ($app.Recommendation) {
|
$dot.ToolTip = switch ($app.Recommendation) {
|
||||||
'safe' { '[Recommended] Safe to remove for most users' }
|
'safe' { '[Recommended] Safe to remove for most users' }
|
||||||
'unsafe' { '[Not Recommended] Only remove if you know what you are doing' }
|
'unsafe' { '[Not Recommended] Only remove if you know what you are doing' }
|
||||||
default { "[Optional] Remove if you don't need this app" }
|
default { "[Optional] Can be safely removed if you don't need this app" }
|
||||||
}
|
}
|
||||||
[System.Windows.Controls.Grid]::SetColumn($dot, 0)
|
[System.Windows.Controls.Grid]::SetColumn($dot, 0)
|
||||||
|
|
||||||
@@ -512,12 +515,14 @@ function Load-AppsIntoMainUI {
|
|||||||
$Window.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Render, [action] {})
|
$Window.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Render, [action] {})
|
||||||
$Window.Dispatcher.BeginInvoke([System.Windows.Threading.DispatcherPriority]::Background, [action] {
|
$Window.Dispatcher.BeginInvoke([System.Windows.Threading.DispatcherPriority]::Background, [action] {
|
||||||
try {
|
try {
|
||||||
$listOfApps = ""
|
$listOfApps = $null
|
||||||
|
|
||||||
if ($OnlyInstalledAppsBox.IsChecked -and ($script:WingetInstalled -eq $true)) {
|
if ($OnlyInstalledAppsBox.IsChecked -and ($script:WingetInstalled -eq $true)) {
|
||||||
$listOfApps = GetInstalledAppsViaWinget -TimeOut 10 -NonBlocking
|
Write-Host "Retrieving installed apps via winget..."
|
||||||
|
$listOfApps = GetInstalledAppsViaWinget -TimeOut 20 -NonBlocking
|
||||||
|
|
||||||
if ($null -eq $listOfApps) {
|
if ($null -eq $listOfApps) {
|
||||||
|
Write-Warning "WinGet returned no data (command timed out or failed)"
|
||||||
Show-MessageBox -Message 'Unable to load list of installed apps via WinGet.' -Title 'Error' -Button 'OK' -Icon 'Error' | Out-Null
|
Show-MessageBox -Message 'Unable to load list of installed apps via WinGet.' -Title 'Error' -Button 'OK' -Icon 'Error' | Out-Null
|
||||||
$OnlyInstalledAppsBox.IsChecked = $false
|
$OnlyInstalledAppsBox.IsChecked = $false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +1,8 @@
|
|||||||
# MainWindow-Deployment.ps1
|
# MainWindow-Deployment.ps1
|
||||||
# Overview generation, pending tweak actions, feature labels, tweak preset maps, apply logic, user mode state, user selection, and validation.
|
# Overview generation, pending tweak actions, feature labels, tweak preset maps, apply logic, user mode state, user selection, and validation.
|
||||||
|
|
||||||
function Get-FeatureLabel {
|
|
||||||
param(
|
|
||||||
[string]$FeatureId,
|
|
||||||
$FallbackLabel = $null
|
|
||||||
)
|
|
||||||
|
|
||||||
$label = $script:FeatureLabelLookup[$FeatureId]
|
|
||||||
if (-not [string]::IsNullOrWhiteSpace([string]$label)) {
|
|
||||||
return [string]$label
|
|
||||||
}
|
|
||||||
|
|
||||||
if (-not [string]::IsNullOrWhiteSpace([string]$FallbackLabel)) {
|
|
||||||
return [string]$FallbackLabel
|
|
||||||
}
|
|
||||||
|
|
||||||
return [string]$FeatureId
|
|
||||||
}
|
|
||||||
|
|
||||||
function Get-UndoFeatureLabel {
|
function Get-UndoFeatureLabel {
|
||||||
param(
|
param([string]$FeatureId)
|
||||||
[string]$FeatureId,
|
|
||||||
$FallbackLabel = $null
|
|
||||||
)
|
|
||||||
|
|
||||||
$undoLabel = $script:UndoFeatureLabelLookup[$FeatureId]
|
$undoLabel = $script:UndoFeatureLabelLookup[$FeatureId]
|
||||||
if (-not [string]::IsNullOrWhiteSpace([string]$undoLabel)) {
|
if (-not [string]::IsNullOrWhiteSpace([string]$undoLabel)) {
|
||||||
@@ -31,8 +10,7 @@ function Get-UndoFeatureLabel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Fall back to the regular label (prefixed for undo context)
|
# Fall back to the regular label (prefixed for undo context)
|
||||||
$label = Get-FeatureLabel -FeatureId $FeatureId -FallbackLabel $FallbackLabel
|
return [string]$script:FeatureLabelLookup[$FeatureId]
|
||||||
return [string]$label
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-PendingTweakActions {
|
function Get-PendingTweakActions {
|
||||||
@@ -69,14 +47,14 @@ function Get-PendingTweakActions {
|
|||||||
$actions.Add([PSCustomObject]@{
|
$actions.Add([PSCustomObject]@{
|
||||||
Action = 'Apply'
|
Action = 'Apply'
|
||||||
FeatureId = [string]$mapping.FeatureId
|
FeatureId = [string]$mapping.FeatureId
|
||||||
Label = (Get-FeatureLabel -FeatureId $mapping.FeatureId -FallbackLabel $mapping.Label)
|
Label = [string]$script:FeatureLabelLookup[$mapping.FeatureId]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
elseif ($wasApplied -and -not $isNowChecked) {
|
elseif ($wasApplied -and -not $isNowChecked) {
|
||||||
$actions.Add([PSCustomObject]@{
|
$actions.Add([PSCustomObject]@{
|
||||||
Action = 'Undo'
|
Action = 'Undo'
|
||||||
FeatureId = [string]$mapping.FeatureId
|
FeatureId = [string]$mapping.FeatureId
|
||||||
Label = (Get-FeatureLabel -FeatureId $mapping.FeatureId -FallbackLabel $mapping.Label)
|
Label = [string]$script:FeatureLabelLookup[$mapping.FeatureId]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,7 +79,7 @@ function Get-PendingTweakActions {
|
|||||||
$actions.Add([PSCustomObject]@{
|
$actions.Add([PSCustomObject]@{
|
||||||
Action = 'Apply'
|
Action = 'Apply'
|
||||||
FeatureId = [string]$fid
|
FeatureId = [string]$fid
|
||||||
Label = (Get-FeatureLabel -FeatureId $fid)
|
Label = [string]$script:FeatureLabelLookup[$fid]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ function Build-DynamicTweaks {
|
|||||||
|
|
||||||
$helpBtn = New-Object System.Windows.Controls.Button
|
$helpBtn = New-Object System.Windows.Controls.Button
|
||||||
$helpBtn.Content = $helpIcon
|
$helpBtn.Content = $helpIcon
|
||||||
$helpBtn.ToolTip = "Open wiki for more info on '$categoryName' tweaks"
|
$helpBtn.ToolTip = "Open the wiki for more info on '$categoryName' tweaks"
|
||||||
$helpBtn.Tag = (GetWikiUrlForCategory -category $categoryName)
|
$helpBtn.Tag = (GetWikiUrlForCategory -category $categoryName)
|
||||||
$helpBtn.Style = $Window.Resources['CategoryHelpLinkButtonStyle']
|
$helpBtn.Style = $Window.Resources['CategoryHelpLinkButtonStyle']
|
||||||
$helpBtn.Add_Click({
|
$helpBtn.Add_Click({
|
||||||
@@ -192,6 +192,12 @@ function Build-DynamicTweaks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Build a FeatureId -> feature lookup for version filtering in groups
|
||||||
|
$featureMap = @{}
|
||||||
|
foreach ($f in $featuresJson.Features) {
|
||||||
|
$featureMap[$f.FeatureId] = $f
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($categoryObj in $orderedCategories) {
|
foreach ($categoryObj in $orderedCategories) {
|
||||||
$categoryName = $categoryObj.Name
|
$categoryName = $categoryObj.Name
|
||||||
|
|
||||||
@@ -250,7 +256,60 @@ function Build-DynamicTweaks {
|
|||||||
foreach ($item in $sortedItems) {
|
foreach ($item in $sortedItems) {
|
||||||
if ($item.Type -eq 'group') {
|
if ($item.Type -eq 'group') {
|
||||||
$group = $item.Data
|
$group = $item.Data
|
||||||
$items = @('No Change') + ($group.Values | ForEach-Object { $_.Label })
|
# Filter values by Windows version compatibility of their referenced features
|
||||||
|
$filteredValues = @($group.Values | Where-Object {
|
||||||
|
$allCompatible = $true
|
||||||
|
foreach ($fid in $_.FeatureIds) {
|
||||||
|
if ($featureMap.ContainsKey($fid)) {
|
||||||
|
$f = $featureMap[$fid]
|
||||||
|
if (($f.MinVersion -and $WinVersion -lt $f.MinVersion) -or ($f.MaxVersion -and $WinVersion -gt $f.MaxVersion)) {
|
||||||
|
$allCompatible = $false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$allCompatible
|
||||||
|
})
|
||||||
|
# Skip the group entirely if all values are incompatible with this Windows version
|
||||||
|
if ($filteredValues.Count -eq 0) { continue }
|
||||||
|
|
||||||
|
# When only 1 value remains, render as the underlying feature directly
|
||||||
|
if ($filteredValues.Count -eq 1) {
|
||||||
|
$featureIds = $filteredValues[0].FeatureIds
|
||||||
|
|
||||||
|
if (-not $featureIds -or $featureIds.Count -eq 0) { continue }
|
||||||
|
|
||||||
|
$soleFid = $featureIds[0]
|
||||||
|
|
||||||
|
if ($featureMap.ContainsKey($soleFid)) {
|
||||||
|
$soleFeature = $featureMap[$soleFid]
|
||||||
|
$opt = 'Apply'
|
||||||
|
if ($soleFeature.FeatureId -match '^Disable') { $opt = 'Disable' } elseif ($soleFeature.FeatureId -match '^Enable') { $opt = 'Enable' }
|
||||||
|
$items = @('No Change', $opt)
|
||||||
|
$comboName = ("Feature_{0}_Combo" -f $soleFeature.FeatureId) -replace '[^a-zA-Z0-9_]', ''
|
||||||
|
$combo = CreateLabeledCombo -parent $panel -labelText $soleFeature.Label -comboName $comboName -items $items
|
||||||
|
# attach tooltip from Features.json if present
|
||||||
|
if ($soleFeature.ToolTip -or $soleFeature.DisableWhenApplied -eq $true) {
|
||||||
|
$tooltipText = $soleFeature.ToolTip
|
||||||
|
if ($soleFeature.DisableWhenApplied -eq $true) {
|
||||||
|
$tooltipText = "This tweak is already applied and cannot be undone automatically. Visit the Win11Debloat wiki for instructions on how to manually revert this change."
|
||||||
|
}
|
||||||
|
$tipBlock = New-Object System.Windows.Controls.TextBlock
|
||||||
|
$tipBlock.Text = $tooltipText
|
||||||
|
$tipBlock.TextWrapping = 'Wrap'
|
||||||
|
$tipBlock.MaxWidth = 420
|
||||||
|
$combo.ToolTip = $tipBlock
|
||||||
|
[System.Windows.Controls.ToolTipService]::SetShowOnDisabled($combo, $true)
|
||||||
|
$lblBorderObj = $null
|
||||||
|
try { $lblBorderObj = $Window.FindName("$comboName`_LabelBorder") } catch {}
|
||||||
|
if ($lblBorderObj) { $lblBorderObj.ToolTip = $tipBlock }
|
||||||
|
}
|
||||||
|
$script:UiControlMappings[$comboName] = @{ Type = 'feature'; FeatureId = $soleFeature.FeatureId; Label = $soleFeature.Label; Category = $categoryName }
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
$items = @('No Change') + ($filteredValues | ForEach-Object { $_.Label })
|
||||||
$comboName = 'Group_{0}Combo' -f $group.GroupId
|
$comboName = 'Group_{0}Combo' -f $group.GroupId
|
||||||
$combo = CreateLabeledCombo -parent $panel -labelText $group.Label -comboName $comboName -items $items
|
$combo = CreateLabeledCombo -parent $panel -labelText $group.Label -comboName $comboName -items $items
|
||||||
# attach tooltip from UiGroups if present
|
# attach tooltip from UiGroups if present
|
||||||
@@ -264,7 +323,7 @@ function Build-DynamicTweaks {
|
|||||||
try { $lblBorderObj = $Window.FindName("$comboName`_LabelBorder") } catch {}
|
try { $lblBorderObj = $Window.FindName("$comboName`_LabelBorder") } catch {}
|
||||||
if ($lblBorderObj) { $lblBorderObj.ToolTip = $tipBlock }
|
if ($lblBorderObj) { $lblBorderObj.ToolTip = $tipBlock }
|
||||||
}
|
}
|
||||||
$script:UiControlMappings[$comboName] = @{ Type = 'group'; Values = $group.Values; Label = $group.Label; Category = $categoryName }
|
$script:UiControlMappings[$comboName] = @{ Type = 'group'; Values = $filteredValues; Label = $group.Label; Category = $categoryName }
|
||||||
}
|
}
|
||||||
elseif ($item.Type -eq 'feature') {
|
elseif ($item.Type -eq 'feature') {
|
||||||
$feature = $item.Data
|
$feature = $item.Data
|
||||||
|
|||||||
@@ -1,71 +1,5 @@
|
|||||||
# MainWindow-WindowChrome.ps1
|
# MainWindow-WindowChrome.ps1
|
||||||
# Window sizing, DPI-aware coordinate conversion, maximized-window taskbar-constraint helpers, and UI animations.
|
# Window sizing, DPI-aware coordinate conversion, and UI animations.
|
||||||
|
|
||||||
function Register-MaximizedWindowHelper {
|
|
||||||
if (-not ([System.Management.Automation.PSTypeName]'Win11Debloat.MaximizedWindowHelper').Type) {
|
|
||||||
Add-Type -Namespace Win11Debloat -Name MaximizedWindowHelper `
|
|
||||||
-ReferencedAssemblies 'PresentationFramework','System.Windows.Forms','System.Drawing' `
|
|
||||||
-MemberDefinition @'
|
|
||||||
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
|
|
||||||
private struct MINMAXINFO {
|
|
||||||
public POINT ptReserved, ptMaxSize, ptMaxPosition, ptMinTrackSize, ptMaxTrackSize;
|
|
||||||
}
|
|
||||||
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
|
|
||||||
private struct POINT { public int x, y; }
|
|
||||||
|
|
||||||
[System.Runtime.InteropServices.DllImport("user32.dll")]
|
|
||||||
private static extern System.IntPtr MonitorFromWindow(System.IntPtr hwnd, uint dwFlags);
|
|
||||||
|
|
||||||
[System.Runtime.InteropServices.DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
|
|
||||||
private static extern bool GetMonitorInfo(System.IntPtr hMonitor, ref MONITORINFO lpmi);
|
|
||||||
|
|
||||||
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
|
|
||||||
private struct RECT {
|
|
||||||
public int Left, Top, Right, Bottom;
|
|
||||||
}
|
|
||||||
|
|
||||||
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet = System.Runtime.InteropServices.CharSet.Auto)]
|
|
||||||
private struct MONITORINFO {
|
|
||||||
public int cbSize;
|
|
||||||
public RECT rcMonitor;
|
|
||||||
public RECT rcWork;
|
|
||||||
public uint dwFlags;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static System.IntPtr WmGetMinMaxInfoHook(
|
|
||||||
System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) {
|
|
||||||
if (msg == 0x0024) { // WM_GETMINMAXINFO
|
|
||||||
var mmi = (MINMAXINFO)System.Runtime.InteropServices.Marshal.PtrToStructure(
|
|
||||||
lParam, typeof(MINMAXINFO));
|
|
||||||
|
|
||||||
const uint MONITOR_DEFAULTTONEAREST = 0x00000002;
|
|
||||||
var monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
|
|
||||||
var monitorInfo = new MONITORINFO();
|
|
||||||
monitorInfo.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(MONITORINFO));
|
|
||||||
|
|
||||||
if (monitor != System.IntPtr.Zero && GetMonitorInfo(monitor, ref monitorInfo)) {
|
|
||||||
mmi.ptMaxPosition.x = monitorInfo.rcWork.Left - monitorInfo.rcMonitor.Left;
|
|
||||||
mmi.ptMaxPosition.y = monitorInfo.rcWork.Top - monitorInfo.rcMonitor.Top;
|
|
||||||
mmi.ptMaxSize.x = monitorInfo.rcWork.Right - monitorInfo.rcWork.Left;
|
|
||||||
mmi.ptMaxSize.y = monitorInfo.rcWork.Bottom - monitorInfo.rcWork.Top;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var screen = System.Windows.Forms.Screen.FromHandle(hwnd);
|
|
||||||
var wa = screen.WorkingArea;
|
|
||||||
var bounds = screen.Bounds;
|
|
||||||
mmi.ptMaxPosition.x = wa.Left - bounds.Left;
|
|
||||||
mmi.ptMaxPosition.y = wa.Top - bounds.Top;
|
|
||||||
mmi.ptMaxSize.x = wa.Width;
|
|
||||||
mmi.ptMaxSize.y = wa.Height;
|
|
||||||
}
|
|
||||||
|
|
||||||
System.Runtime.InteropServices.Marshal.StructureToPtr(mmi, lParam, true);
|
|
||||||
}
|
|
||||||
return System.IntPtr.Zero;
|
|
||||||
}
|
|
||||||
'@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Convert screen-pixel coordinates to WPF device-independent pixels (DIP)
|
# Convert screen-pixel coordinates to WPF device-independent pixels (DIP)
|
||||||
function ConvertTo-ScreenPointToDip {
|
function ConvertTo-ScreenPointToDip {
|
||||||
@@ -118,16 +52,35 @@ function Update-MainWindowChrome {
|
|||||||
)
|
)
|
||||||
|
|
||||||
$windowStateMaximized = [System.Windows.WindowState]::Maximized
|
$windowStateMaximized = [System.Windows.WindowState]::Maximized
|
||||||
$chrome = [System.Windows.Shell.WindowChrome]::GetWindowChrome($Window)
|
|
||||||
|
|
||||||
if ($Window.WindowState -eq $windowStateMaximized) {
|
if ($Window.WindowState -eq $windowStateMaximized) {
|
||||||
$MainBorder.Margin = [System.Windows.Thickness]::new(0)
|
$chrome = [System.Windows.Shell.WindowChrome]::GetWindowChrome($Window)
|
||||||
|
$resizeBorder = if ($chrome) { $chrome.ResizeBorderThickness } else { [System.Windows.SystemParameters]::WindowResizeBorderThickness }
|
||||||
|
|
||||||
|
# Compute margins using screen bounds vs working area
|
||||||
|
$marginLeft = $resizeBorder.Left
|
||||||
|
$marginTop = $resizeBorder.Top
|
||||||
|
$marginRight = $resizeBorder.Right
|
||||||
|
$marginBottom = $resizeBorder.Bottom
|
||||||
|
|
||||||
|
$screen = Get-WindowScreen -Window $Window
|
||||||
|
if ($screen) {
|
||||||
|
$workTL = ConvertTo-ScreenPointToDip -Window $Window -X $screen.WorkingArea.Left -Y $screen.WorkingArea.Top
|
||||||
|
$workSize = ConvertTo-ScreenPixelsToDip -Window $Window -Width $screen.WorkingArea.Width -Height $screen.WorkingArea.Height
|
||||||
|
$screenTL = ConvertTo-ScreenPointToDip -Window $Window -X $screen.Bounds.Left -Y $screen.Bounds.Top
|
||||||
|
$screenSize = ConvertTo-ScreenPixelsToDip -Window $Window -Width $screen.Bounds.Width -Height $screen.Bounds.Height
|
||||||
|
|
||||||
|
$marginLeft += ($workTL.X - $screenTL.X)
|
||||||
|
$marginTop += ($workTL.Y - $screenTL.Y)
|
||||||
|
$marginRight += ($screenTL.X + $screenSize.Width) - ($workTL.X + $workSize.Width)
|
||||||
|
$marginBottom += ($screenTL.Y + $screenSize.Height) - ($workTL.Y + $workSize.Height)
|
||||||
|
}
|
||||||
|
|
||||||
|
$MainBorder.Margin = [System.Windows.Thickness]::new($marginLeft, $marginTop, $marginRight, $marginBottom)
|
||||||
$MainBorder.BorderThickness = [System.Windows.Thickness]::new(0)
|
$MainBorder.BorderThickness = [System.Windows.Thickness]::new(0)
|
||||||
$MainBorder.CornerRadius = [System.Windows.CornerRadius]::new(0)
|
$MainBorder.CornerRadius = [System.Windows.CornerRadius]::new(0)
|
||||||
$MainBorder.Effect = $null
|
$MainBorder.Effect = $null
|
||||||
$TitleBarBackground.CornerRadius = [System.Windows.CornerRadius]::new(0)
|
$TitleBarBackground.CornerRadius = [System.Windows.CornerRadius]::new(0)
|
||||||
# Zero out resize borders when maximized so the entire title bar row is draggable
|
|
||||||
if ($chrome) { $chrome.ResizeBorderThickness = [System.Windows.Thickness]::new(0) }
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$MainBorder.Margin = [System.Windows.Thickness]::new(0)
|
$MainBorder.Margin = [System.Windows.Thickness]::new(0)
|
||||||
@@ -135,7 +88,6 @@ function Update-MainWindowChrome {
|
|||||||
$MainBorder.CornerRadius = [System.Windows.CornerRadius]::new(8)
|
$MainBorder.CornerRadius = [System.Windows.CornerRadius]::new(8)
|
||||||
$MainBorder.Effect = $NormalWindowShadow
|
$MainBorder.Effect = $NormalWindowShadow
|
||||||
$TitleBarBackground.CornerRadius = [System.Windows.CornerRadius]::new(8, 8, 0, 0)
|
$TitleBarBackground.CornerRadius = [System.Windows.CornerRadius]::new(8, 8, 0, 0)
|
||||||
if ($chrome) { $chrome.ResizeBorderThickness = [System.Windows.Thickness]::new(5) }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Creates a lightweight state object for the restore-backup dialog result.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Encapsulates the user's dialog choice (Result), the selected backup file
|
||||||
|
path, and the parsed backup payload so callers receive a single object.
|
||||||
|
#>
|
||||||
function New-RestoreDialogState {
|
function New-RestoreDialogState {
|
||||||
param(
|
param(
|
||||||
[string]$Result = 'Cancel',
|
[string]$Result = 'Cancel',
|
||||||
@@ -8,6 +16,16 @@ function New-RestoreDialogState {
|
|||||||
return @{ Result = $Result; SelectedFile = $SelectedFile; Backup = $Backup }
|
return @{ Result = $Result; SelectedFile = $SelectedFile; Backup = $Backup }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Looks up a feature definition by ID from the provided feature catalog.
|
||||||
|
|
||||||
|
.PARAMETER FeatureId
|
||||||
|
The identifier to search for (e.g. 'DisableTelemetry').
|
||||||
|
|
||||||
|
.PARAMETER Features
|
||||||
|
A hashtable loaded from Features.json (FeatureId -> feature object).
|
||||||
|
#>
|
||||||
function Get-RestoreDialogFeatureDefinition {
|
function Get-RestoreDialogFeatureDefinition {
|
||||||
param(
|
param(
|
||||||
[string]$FeatureId,
|
[string]$FeatureId,
|
||||||
@@ -25,6 +43,21 @@ function Get-RestoreDialogFeatureDefinition {
|
|||||||
return $null
|
return $null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Determines whether a feature can be automatically reverted via registry restore.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Returns $true when the feature has a non-empty RegistryKey, indicating
|
||||||
|
an apply .reg file exists that can be undone automatically. Features
|
||||||
|
with custom logic (no RegistryKey) must be manually reverted.
|
||||||
|
|
||||||
|
.PARAMETER FeatureId
|
||||||
|
The feature identifier to check.
|
||||||
|
|
||||||
|
.PARAMETER Features
|
||||||
|
A hashtable loaded from Features.json.
|
||||||
|
#>
|
||||||
function Test-RestoreDialogFeatureCanAutoRevert {
|
function Test-RestoreDialogFeatureCanAutoRevert {
|
||||||
param(
|
param(
|
||||||
[string]$FeatureId,
|
[string]$FeatureId,
|
||||||
@@ -43,6 +76,20 @@ function Test-RestoreDialogFeatureCanAutoRevert {
|
|||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Resolves a human-readable label for a feature shown in the restore dialog.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Returns the feature's Label from Features.json when found, falling back
|
||||||
|
to the raw FeatureId string. For null/empty FeatureIds returns 'Unknown feature'.
|
||||||
|
|
||||||
|
.PARAMETER FeatureId
|
||||||
|
The feature identifier to resolve a label for.
|
||||||
|
|
||||||
|
.PARAMETER Features
|
||||||
|
A hashtable loaded from Features.json.
|
||||||
|
#>
|
||||||
function Get-RestoreDialogFeatureDisplayLabel {
|
function Get-RestoreDialogFeatureDisplayLabel {
|
||||||
param(
|
param(
|
||||||
[string]$FeatureId,
|
[string]$FeatureId,
|
||||||
@@ -54,13 +101,28 @@ function Get-RestoreDialogFeatureDisplayLabel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$featureDefinition = Get-RestoreDialogFeatureDefinition -FeatureId $FeatureId -Features $Features
|
$featureDefinition = Get-RestoreDialogFeatureDefinition -FeatureId $FeatureId -Features $Features
|
||||||
if ($featureDefinition -and -not [string]::IsNullOrWhiteSpace([string]$featureDefinition.Label)) {
|
if ($featureDefinition) {
|
||||||
return [string]$featureDefinition.Label
|
return [string]$featureDefinition.Label
|
||||||
}
|
}
|
||||||
|
|
||||||
return $FeatureId
|
return $FeatureId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Checks whether a feature should appear in the restore dialog's overview list.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
A feature is considered visible when it exists in the catalog and has
|
||||||
|
a non-empty Category (meaning it belongs to a UI grouping). Features
|
||||||
|
without a Category are hidden from the overview.
|
||||||
|
|
||||||
|
.PARAMETER FeatureId
|
||||||
|
The feature identifier to check.
|
||||||
|
|
||||||
|
.PARAMETER Features
|
||||||
|
A hashtable loaded from Features.json.
|
||||||
|
#>
|
||||||
function Test-RestoreDialogFeatureVisibleInOverview {
|
function Test-RestoreDialogFeatureVisibleInOverview {
|
||||||
param(
|
param(
|
||||||
[string]$FeatureId,
|
[string]$FeatureId,
|
||||||
@@ -79,6 +141,13 @@ function Test-RestoreDialogFeatureVisibleInOverview {
|
|||||||
return -not [string]::IsNullOrWhiteSpace([string]$featureDefinition.Category)
|
return -not [string]::IsNullOrWhiteSpace([string]$featureDefinition.Category)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Extracts deduplicated forward (apply) feature IDs from a backup payload.
|
||||||
|
|
||||||
|
.PARAMETER SelectedBackup
|
||||||
|
The parsed backup object containing a SelectedFeatures property.
|
||||||
|
#>
|
||||||
function Get-SelectedForwardFeatureIdsFromBackup {
|
function Get-SelectedForwardFeatureIdsFromBackup {
|
||||||
param($SelectedBackup)
|
param($SelectedBackup)
|
||||||
|
|
||||||
@@ -99,6 +168,13 @@ function Get-SelectedForwardFeatureIdsFromBackup {
|
|||||||
return @($selectedFeatureIds.ToArray())
|
return @($selectedFeatureIds.ToArray())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Extracts deduplicated undo feature IDs from a backup payload.
|
||||||
|
|
||||||
|
.PARAMETER SelectedBackup
|
||||||
|
The parsed backup object containing a SelectedUndoFeatures property.
|
||||||
|
#>
|
||||||
function Get-SelectedUndoFeatureIdsFromBackup {
|
function Get-SelectedUndoFeatureIdsFromBackup {
|
||||||
param($SelectedBackup)
|
param($SelectedBackup)
|
||||||
|
|
||||||
@@ -119,6 +195,13 @@ function Get-SelectedUndoFeatureIdsFromBackup {
|
|||||||
return @($selectedUndoFeatureIds.ToArray())
|
return @($selectedUndoFeatureIds.ToArray())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Merges forward and undo feature IDs from a backup into a single deduplicated list.
|
||||||
|
|
||||||
|
.PARAMETER SelectedBackup
|
||||||
|
The parsed backup object containing SelectedFeatures and SelectedUndoFeatures.
|
||||||
|
#>
|
||||||
function Get-CombinedSelectedFeatureIdsFromBackup {
|
function Get-CombinedSelectedFeatureIdsFromBackup {
|
||||||
param($SelectedBackup)
|
param($SelectedBackup)
|
||||||
|
|
||||||
@@ -139,12 +222,34 @@ function Get-CombinedSelectedFeatureIdsFromBackup {
|
|||||||
return @($featureIds.ToArray())
|
return @($featureIds.ToArray())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Convenience wrapper that returns all combined feature IDs from a backup.
|
||||||
|
|
||||||
|
.PARAMETER SelectedBackup
|
||||||
|
The parsed backup object.
|
||||||
|
#>
|
||||||
function Get-SelectedFeatureIdsFromBackup {
|
function Get-SelectedFeatureIdsFromBackup {
|
||||||
param($SelectedBackup)
|
param($SelectedBackup)
|
||||||
|
|
||||||
return @(Get-CombinedSelectedFeatureIdsFromBackup -SelectedBackup $SelectedBackup)
|
return @(Get-CombinedSelectedFeatureIdsFromBackup -SelectedBackup $SelectedBackup)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Splits selected feature IDs into revertible and non-revertible lists for display.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Iterates the provided feature IDs, filters to those visible in the overview,
|
||||||
|
and separates them into auto-revertible (has a RegistryKey) and non-revertible
|
||||||
|
(requires manual undo) buckets. Each entry includes a display label.
|
||||||
|
|
||||||
|
.PARAMETER SelectedFeatureIds
|
||||||
|
The list of feature IDs to categorize.
|
||||||
|
|
||||||
|
.PARAMETER Features
|
||||||
|
A hashtable loaded from Features.json.
|
||||||
|
#>
|
||||||
function Get-RestoreBackupFeatureLists {
|
function Get-RestoreBackupFeatureLists {
|
||||||
param(
|
param(
|
||||||
[string[]]$SelectedFeatureIds,
|
[string[]]$SelectedFeatureIds,
|
||||||
|
|||||||
@@ -1,3 +1,26 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Applies light or dark theme colors to a WPF window's resource dictionary.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Iterates over a predefined set of theme color categories and
|
||||||
|
populates the window's Resources with SolidColorBrush entries keyed by
|
||||||
|
category and resource name (e.g. "AppAccentColor"). Additionally loads and
|
||||||
|
merges shared XAML styles from the script's SharedStylesSchema path if
|
||||||
|
available.
|
||||||
|
|
||||||
|
.PARAMETER window
|
||||||
|
The WPF Window whose resource dictionary will be populated.
|
||||||
|
|
||||||
|
.PARAMETER usesDarkMode
|
||||||
|
When $true, dark theme colors are applied; when $false, light theme colors.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
SetWindowThemeResources -window $MainWindow -usesDarkMode $true
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
SetWindowThemeResources -window $Dialog -usesDarkMode $false
|
||||||
|
#>
|
||||||
# Sets resource colors for a WPF window based on dark mode preference
|
# Sets resource colors for a WPF window based on dark mode preference
|
||||||
function SetWindowThemeResources {
|
function SetWindowThemeResources {
|
||||||
param (
|
param (
|
||||||
@@ -5,80 +28,99 @@ function SetWindowThemeResources {
|
|||||||
[bool]$usesDarkMode
|
[bool]$usesDarkMode
|
||||||
)
|
)
|
||||||
|
|
||||||
if ($usesDarkMode) {
|
$ThemeColor = @{
|
||||||
$window.Resources.Add("BgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#202020")))
|
App = @{
|
||||||
$window.Resources.Add("FgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#FFFFFF")))
|
AccentColor = @{ Light = '#ffae00'; Dark = '#ffd700' }
|
||||||
$window.Resources.Add("CardBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#2b2b2b")))
|
BorderColor = @{ Light = '#ededed'; Dark = '#404040' }
|
||||||
$window.Resources.Add("BorderColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#404040")))
|
BgColor = @{ Light = '#f3f3f3'; Dark = '#202020' }
|
||||||
$window.Resources.Add("ButtonBorderColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#404040")))
|
FgColor = @{ Light = '#000000'; Dark = '#ffffff' }
|
||||||
$window.Resources.Add("CheckBoxBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#272727")))
|
IdColor = @{ Light = '#666666'; Dark = '#afafaf' }
|
||||||
$window.Resources.Add("CheckBoxBorderColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#808080")))
|
|
||||||
$window.Resources.Add("CheckBoxHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#343434")))
|
|
||||||
$window.Resources.Add("ComboBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#373737")))
|
|
||||||
$window.Resources.Add("ComboHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#434343")))
|
|
||||||
$window.Resources.Add("ComboItemBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#2c2c2c")))
|
|
||||||
$window.Resources.Add("ComboItemHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#383838")))
|
|
||||||
$window.Resources.Add("ComboItemSelectedColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#343434")))
|
|
||||||
$window.Resources.Add("AccentColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#FFD700")))
|
|
||||||
$window.Resources.Add("ButtonDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#434343")))
|
|
||||||
$window.Resources.Add("ButtonTextDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#989898")))
|
|
||||||
$window.Resources.Add("SecondaryButtonBg", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#393939")))
|
|
||||||
$window.Resources.Add("SecondaryButtonHover", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#2a2a2a")))
|
|
||||||
$window.Resources.Add("SecondaryButtonPressed", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#1e1e1e")))
|
|
||||||
$window.Resources.Add("SecondaryButtonDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#3b3b3b")))
|
|
||||||
$window.Resources.Add("SecondaryButtonTextDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#787878")))
|
|
||||||
$window.Resources.Add("InputFocusColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#1f1f1f")))
|
|
||||||
$window.Resources.Add("ScrollBarThumbColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#3d3d3d")))
|
|
||||||
$window.Resources.Add("ScrollBarThumbHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#4b4b4b")))
|
|
||||||
$window.Resources.Add("TitlebarButtonHover", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#2d2d2d")))
|
|
||||||
$window.Resources.Add("TitlebarButtonPressed", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#292929")))
|
|
||||||
$window.Resources.Add("AppIdColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#afafaf")))
|
|
||||||
$window.Resources.Add("SearchHighlightColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#4A4A2A")))
|
|
||||||
$window.Resources.Add("SearchHighlightActiveColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#8A7000")))
|
|
||||||
$window.Resources.Add("TableHeaderColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#333333")))
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$window.Resources.Add("BgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f3f3f3")))
|
|
||||||
$window.Resources.Add("FgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#000000")))
|
|
||||||
$window.Resources.Add("CardBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#fbfbfb")))
|
|
||||||
$window.Resources.Add("BorderColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#ededed")))
|
|
||||||
$window.Resources.Add("ButtonBorderColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#d3d3d3")))
|
|
||||||
$window.Resources.Add("CheckBoxBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f5f5f5")))
|
|
||||||
$window.Resources.Add("CheckBoxBorderColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#898989")))
|
|
||||||
$window.Resources.Add("CheckBoxHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#ececec")))
|
|
||||||
$window.Resources.Add("ComboBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#FFFFFF")))
|
|
||||||
$window.Resources.Add("ComboHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f8f8f8")))
|
|
||||||
$window.Resources.Add("ComboItemBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f9f9f9")))
|
|
||||||
$window.Resources.Add("ComboItemHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f0f0f0")))
|
|
||||||
$window.Resources.Add("ComboItemSelectedColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f3f3f3")))
|
|
||||||
$window.Resources.Add("AccentColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#ffae00")))
|
|
||||||
$window.Resources.Add("ButtonDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#bfbfbf")))
|
|
||||||
$window.Resources.Add("ButtonTextDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#ffffff")))
|
|
||||||
$window.Resources.Add("SecondaryButtonBg", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#fbfbfb")))
|
|
||||||
$window.Resources.Add("SecondaryButtonHover", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f6f6f6")))
|
|
||||||
$window.Resources.Add("SecondaryButtonPressed", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f0f0f0")))
|
|
||||||
$window.Resources.Add("SecondaryButtonDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f7f7f7")))
|
|
||||||
$window.Resources.Add("SecondaryButtonTextDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#b7b7b7")))
|
|
||||||
$window.Resources.Add("InputFocusColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#fbfbfb")))
|
|
||||||
$window.Resources.Add("ScrollBarThumbColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#b9b9b9")))
|
|
||||||
$window.Resources.Add("ScrollBarThumbHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#8b8b8b")))
|
|
||||||
$window.Resources.Add("TitlebarButtonHover", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#e1e1e1")))
|
|
||||||
$window.Resources.Add("TitlebarButtonPressed", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#e6e6e6")))
|
|
||||||
$window.Resources.Add("AppIdColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#666666")))
|
|
||||||
$window.Resources.Add("SearchHighlightColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#FFF4CE")))
|
|
||||||
$window.Resources.Add("SearchHighlightActiveColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#FFD966")))
|
|
||||||
$window.Resources.Add("TableHeaderColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#ffffff")))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$window.Resources.Add("ButtonBg", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#0067c0")))
|
Card = @{
|
||||||
$window.Resources.Add("ButtonHover", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#1E88E5")))
|
BgColor = @{ Light = '#fbfbfb'; Dark = '#2b2b2b' }
|
||||||
$window.Resources.Add("ButtonPressed", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#3284cc")))
|
}
|
||||||
$window.Resources.Add("CloseHover", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#c42b1c")))
|
|
||||||
$window.Resources.Add("InformationIconColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#0078D4")))
|
Button = @{
|
||||||
$window.Resources.Add("SuccessIconColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#107C10")))
|
BorderColor = @{ Light = '#d3d3d3'; Dark = '#404040' }
|
||||||
$window.Resources.Add("WarningIconColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#FFB900")))
|
BgColor = @{ Light = '#0067c0'; Dark = '#0067c0' }
|
||||||
$window.Resources.Add("ErrorIconColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#E81123")))
|
DisabledColor = @{ Light = '#bfbfbf'; Dark = '#434343' }
|
||||||
$window.Resources.Add("QuestionIconColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#0078D4")))
|
HoverColor = @{ Light = '#1975c5'; Dark = '#1975c5' }
|
||||||
|
PressedColor = @{ Light = '#3183ca'; Dark = '#3183ca' }
|
||||||
|
TextDisabledColor = @{ Light = '#ffffff'; Dark = '#989898' }
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondaryButton = @{
|
||||||
|
BgColor = @{ Light = '#fbfbfb'; Dark = '#393939' }
|
||||||
|
DisabledColor = @{ Light = '#f7f7f7'; Dark = '#3b3b3b' }
|
||||||
|
HoverColor = @{ Light = '#f6f6f6'; Dark = '#2a2a2a' }
|
||||||
|
PressedColor = @{ Light = '#f0f0f0'; Dark = '#1e1e1e' }
|
||||||
|
TextDisabledColor = @{ Light = '#b7b7b7'; Dark = '#787878' }
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckBox = @{
|
||||||
|
BgColor = @{ Light = '#f5f5f5'; Dark = '#272727' }
|
||||||
|
BorderColor = @{ Light = '#898989'; Dark = '#808080' }
|
||||||
|
HoverColor = @{ Light = '#ececec'; Dark = '#343434' }
|
||||||
|
}
|
||||||
|
|
||||||
|
ComboBox = @{
|
||||||
|
BgColor = @{ Light = '#ffffff'; Dark = '#373737' }
|
||||||
|
HoverColor = @{ Light = '#f8f8f8'; Dark = '#434343' }
|
||||||
|
ItemBgColor = @{ Light = '#f9f9f9'; Dark = '#2c2c2c' }
|
||||||
|
ItemHoverColor = @{ Light = '#f0f0f0'; Dark = '#383838' }
|
||||||
|
ItemSelectedColor = @{ Light = '#f3f3f3'; Dark = '#343434' }
|
||||||
|
}
|
||||||
|
|
||||||
|
TextBox = @{
|
||||||
|
BorderColor = @{ Light = '#bdbdbd'; Dark = '#989a9d' }
|
||||||
|
BgColor = @{ Light = '#fbfbfb'; Dark = '#2d2d2d' }
|
||||||
|
FocusColor = @{ Light = '#ffffff'; Dark = '#1f1f1f' }
|
||||||
|
HoverColor = @{ Light = '#f6f6f6'; Dark = '#323232' }
|
||||||
|
SideBorderColor = @{ Light = '#ececec'; Dark = '#343434' }
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollBar = @{
|
||||||
|
ThumbColor = @{ Light = '#b9b9b9'; Dark = '#3d3d3d' }
|
||||||
|
ThumbHoverColor = @{ Light = '#8b8b8b'; Dark = '#4b4b4b' }
|
||||||
|
}
|
||||||
|
|
||||||
|
TitleBar = @{
|
||||||
|
ButtonHoverColor = @{ Light = '#dcdcdc'; Dark = '#353535' }
|
||||||
|
ButtonPressedColor = @{ Light = '#cccccc'; Dark = '#333333' }
|
||||||
|
CloseHoverColor = @{ Light = '#e81123'; Dark = '#e81123' }
|
||||||
|
ClosePressedColor = @{ Light = '#f1707a'; Dark = '#f1707a' }
|
||||||
|
UnfocusedFgColor = @{ Light = '#868686'; Dark = '#969696' }
|
||||||
|
}
|
||||||
|
|
||||||
|
Search = @{
|
||||||
|
HighlightActiveColor = @{ Light = '#ffd966'; Dark = '#8a7000' }
|
||||||
|
HighlightColor = @{ Light = '#fff4ce'; Dark = '#4a4a2a' }
|
||||||
|
}
|
||||||
|
|
||||||
|
Table = @{
|
||||||
|
HeaderColor = @{ Light = '#ffffff'; Dark = '#303030' }
|
||||||
|
}
|
||||||
|
|
||||||
|
Icon = @{
|
||||||
|
ErrorColor = @{ Light = '#e81123'; Dark = '#e81123' }
|
||||||
|
InformationColor = @{ Light = '#0078d4'; Dark = '#0078d4' }
|
||||||
|
QuestionColor = @{ Light = '#0078d4'; Dark = '#0078d4' }
|
||||||
|
SuccessColor = @{ Light = '#107c10'; Dark = '#107c10' }
|
||||||
|
WarningColor = @{ Light = '#ffb900'; Dark = '#ffb900' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$Theme = if ($usesDarkMode) { 'Dark' } else { 'Light' }
|
||||||
|
|
||||||
|
foreach ($Group in $ThemeColor.GetEnumerator()) {
|
||||||
|
foreach ($Resource in $Group.Value.GetEnumerator()) {
|
||||||
|
$ResourceName = $Group.Key + $Resource.Key
|
||||||
|
$window.Resources[$ResourceName] = [System.Windows.Media.SolidColorBrush]::new(
|
||||||
|
[System.Windows.Media.ColorConverter]::ConvertFromString($Resource.Value[$Theme])
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Load and merge shared styles
|
# Load and merge shared styles
|
||||||
if ($script:SharedStylesSchema -and (Test-Path $script:SharedStylesSchema)) {
|
if ($script:SharedStylesSchema -and (Test-Path $script:SharedStylesSchema)) {
|
||||||
|
|||||||
@@ -53,12 +53,12 @@ function Show-AppSelectionWindow {
|
|||||||
$window.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{})
|
$window.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{})
|
||||||
|
|
||||||
$appsPanel.Children.Clear()
|
$appsPanel.Children.Clear()
|
||||||
$listOfApps = ""
|
$listOfApps = $null
|
||||||
|
|
||||||
if ($onlyInstalledBox.IsChecked -and ($script:WingetInstalled -eq $true)) {
|
if ($onlyInstalledBox.IsChecked -and ($script:WingetInstalled -eq $true)) {
|
||||||
# Attempt to get a list of installed apps via WinGet, times out after 10 seconds
|
# Attempt to get a list of installed apps via WinGet, times out after 10 seconds
|
||||||
$listOfApps = GetInstalledAppsViaWinget -TimeOut 10
|
$listOfApps = GetInstalledAppsViaWinget -TimeOut 10 -NonBlocking
|
||||||
if (-not $listOfApps) {
|
if ($null -eq $listOfApps) {
|
||||||
# Show error that the script was unable to get list of apps from WinGet
|
# Show error that the script was unable to get list of apps from WinGet
|
||||||
Show-MessageBox -Message 'Unable to load list of installed apps via WinGet.' -Title 'Error' -Button 'OK' -Icon 'Error' -Owner $window | Out-Null
|
Show-MessageBox -Message 'Unable to load list of installed apps via WinGet.' -Title 'Error' -Button 'OK' -Icon 'Error' -Owner $window | Out-Null
|
||||||
$onlyInstalledBox.IsChecked = $false
|
$onlyInstalledBox.IsChecked = $false
|
||||||
@@ -134,7 +134,7 @@ function Show-AppSelectionWindow {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveCustomAppsListToFile -appsList $selectedApps
|
$script:SelectedApps = $selectedApps
|
||||||
|
|
||||||
$window.DialogResult = $true
|
$window.DialogResult = $true
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -8,26 +8,6 @@ function Show-ApplyModal {
|
|||||||
|
|
||||||
Add-Type -AssemblyName PresentationFramework,PresentationCore,WindowsBase | Out-Null
|
Add-Type -AssemblyName PresentationFramework,PresentationCore,WindowsBase | Out-Null
|
||||||
|
|
||||||
# P/Invoke helpers for forcing focus back after Explorer restart
|
|
||||||
if (-not ([System.Management.Automation.PSTypeName]'Win11Debloat.FocusHelper').Type) {
|
|
||||||
Add-Type -Namespace Win11Debloat -Name FocusHelper -MemberDefinition @'
|
|
||||||
[DllImport("user32.dll")] public static extern bool SetForegroundWindow(IntPtr hWnd);
|
|
||||||
[DllImport("user32.dll")] public static extern IntPtr GetForegroundWindow();
|
|
||||||
[DllImport("user32.dll")] public static extern uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr lpdwProcessId);
|
|
||||||
[DllImport("user32.dll")] public static extern bool AttachThreadInput(uint idAttach, uint idAttachTo, bool fAttach);
|
|
||||||
[DllImport("kernel32.dll")] public static extern uint GetCurrentThreadId();
|
|
||||||
|
|
||||||
public static void ForceActivate(IntPtr hwnd) {
|
|
||||||
IntPtr fg = GetForegroundWindow();
|
|
||||||
uint fgThread = GetWindowThreadProcessId(fg, IntPtr.Zero);
|
|
||||||
uint myThread = GetCurrentThreadId();
|
|
||||||
if (fgThread != myThread) AttachThreadInput(myThread, fgThread, true);
|
|
||||||
SetForegroundWindow(hwnd);
|
|
||||||
if (fgThread != myThread) AttachThreadInput(myThread, fgThread, false);
|
|
||||||
}
|
|
||||||
'@
|
|
||||||
}
|
|
||||||
|
|
||||||
$usesDarkMode = GetSystemUsesDarkMode
|
$usesDarkMode = GetSystemUsesDarkMode
|
||||||
|
|
||||||
# Determine owner window
|
# Determine owner window
|
||||||
@@ -89,7 +69,7 @@ function Show-ApplyModal {
|
|||||||
$script:ApplyProgressBarEl.Value = 0
|
$script:ApplyProgressBarEl.Value = 0
|
||||||
$script:ApplyModalInErrorState = $false
|
$script:ApplyModalInErrorState = $false
|
||||||
|
|
||||||
# Set up progress callback for ExecuteAllChanges
|
# Set up progress callback for Invoke-AllChanges
|
||||||
$script:ApplyProgressCallback = {
|
$script:ApplyProgressCallback = {
|
||||||
param($currentStep, $totalSteps, $stepName)
|
param($currentStep, $totalSteps, $stepName)
|
||||||
$script:ApplyStepNameEl.Text = $stepName
|
$script:ApplyStepNameEl.Text = $stepName
|
||||||
@@ -122,7 +102,7 @@ function Show-ApplyModal {
|
|||||||
# Run changes in background to keep UI responsive
|
# Run changes in background to keep UI responsive
|
||||||
$applyWindow.Dispatcher.BeginInvoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{
|
$applyWindow.Dispatcher.BeginInvoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{
|
||||||
try {
|
try {
|
||||||
ExecuteAllChanges
|
Invoke-AllChanges
|
||||||
|
|
||||||
$registryImportFailureCount = [int]$script:RegistryImportFailures
|
$registryImportFailureCount = [int]$script:RegistryImportFailures
|
||||||
|
|
||||||
@@ -133,8 +113,7 @@ function Show-ApplyModal {
|
|||||||
# Wait for Explorer to finish relaunching, then reclaim focus.
|
# Wait for Explorer to finish relaunching, then reclaim focus.
|
||||||
Start-Sleep -Milliseconds 800
|
Start-Sleep -Milliseconds 800
|
||||||
$applyWindow.Dispatcher.Invoke([action]{
|
$applyWindow.Dispatcher.Invoke([action]{
|
||||||
$hwnd = (New-Object System.Windows.Interop.WindowInteropHelper($applyWindow)).Handle
|
$applyWindow.Activate()
|
||||||
[Win11Debloat.FocusHelper]::ForceActivate($hwnd)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,7 +157,7 @@ function Show-ApplyModal {
|
|||||||
$tb = [System.Windows.Controls.TextBlock]::new()
|
$tb = [System.Windows.Controls.TextBlock]::new()
|
||||||
$tb.Text = "$([char]0x2022) $featureName"
|
$tb.Text = "$([char]0x2022) $featureName"
|
||||||
$tb.FontSize = 12
|
$tb.FontSize = 12
|
||||||
$tb.SetResourceReference([System.Windows.Controls.TextBlock]::ForegroundProperty, 'FgColor')
|
$tb.SetResourceReference([System.Windows.Controls.TextBlock]::ForegroundProperty, "AppFgColor")
|
||||||
$tb.Opacity = 0.85
|
$tb.Opacity = 0.85
|
||||||
$tb.Margin = [System.Windows.Thickness]::new(0, 2, 0, 0)
|
$tb.Margin = [System.Windows.Thickness]::new(0, 2, 0, 0)
|
||||||
$applyRebootList.Children.Add($tb) | Out-Null
|
$applyRebootList.Children.Add($tb) | Out-Null
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Hides the currently displayed bubble popup.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Closes the bubble popup with a smooth fade-out animation (220ms). If the
|
||||||
|
-Immediate switch is used, the popup is closed instantly without animation.
|
||||||
|
This function is called automatically by Show-Bubble's timer and can also
|
||||||
|
be invoked manually to dismiss the bubble early.
|
||||||
|
|
||||||
|
.PARAMETER Immediate
|
||||||
|
If specified, the bubble popup is closed instantly without a fade-out
|
||||||
|
animation. Any pending close timer is also stopped.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Hide-Bubble
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Hide-Bubble -Immediate
|
||||||
|
#>
|
||||||
function Hide-Bubble {
|
function Hide-Bubble {
|
||||||
param (
|
param (
|
||||||
[Parameter(Mandatory=$false)]
|
[Parameter(Mandatory=$false)]
|
||||||
@@ -37,6 +57,34 @@ function Hide-Bubble {
|
|||||||
$bubblePanel.BeginAnimation([System.Windows.UIElement]::OpacityProperty, $fadeOut)
|
$bubblePanel.BeginAnimation([System.Windows.UIElement]::OpacityProperty, $fadeOut)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Displays a transient bubble popup hint anchored above a target control.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Shows a WPF popup styled as a speech bubble above the specified target
|
||||||
|
control. The bubble fades in with a animation, displays for a configurable
|
||||||
|
duration, then fades out. Any previously shown bubble is dismissed
|
||||||
|
immediately before showing the new one.
|
||||||
|
|
||||||
|
.PARAMETER TargetControl
|
||||||
|
The WPF Control above which the bubble popup will be placed. This
|
||||||
|
parameter is mandatory.
|
||||||
|
|
||||||
|
.PARAMETER Message
|
||||||
|
The text message to display inside the bubble. Defaults to
|
||||||
|
'View the selected changes here'.
|
||||||
|
|
||||||
|
.PARAMETER DurationSeconds
|
||||||
|
The number of seconds the bubble remains visible before auto-hiding.
|
||||||
|
The minimum value is 1 second. Defaults to 5 seconds.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Show-Bubble -TargetControl $myButton
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
Show-Bubble -TargetControl $myButton -Message 'Changes saved!' -DurationSeconds 3
|
||||||
|
#>
|
||||||
function Show-Bubble {
|
function Show-Bubble {
|
||||||
param (
|
param (
|
||||||
[Parameter(Mandatory=$true)]
|
[Parameter(Mandatory=$true)]
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ function Show-ImportExportConfigWindow {
|
|||||||
$Owner.Dispatcher.Invoke([action]{ $overlay.Visibility = 'Visible' })
|
$Owner.Dispatcher.Invoke([action]{ $overlay.Visibility = 'Visible' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch { }
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
# Load XAML from schema file
|
# Load XAML from schema file
|
||||||
$schemaPath = $script:ImportExportConfigSchema
|
$schemaPath = $script:ImportExportConfigSchema
|
||||||
@@ -52,7 +53,8 @@ function Show-ImportExportConfigWindow {
|
|||||||
if ($mainCheckBoxStyle) {
|
if ($mainCheckBoxStyle) {
|
||||||
$dlg.Resources.Add([type][System.Windows.Controls.CheckBox], $mainCheckBoxStyle)
|
$dlg.Resources.Add([type][System.Windows.Controls.CheckBox], $mainCheckBoxStyle)
|
||||||
}
|
}
|
||||||
} catch { }
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
# Populate named elements
|
# Populate named elements
|
||||||
$dlg.Title = $Title
|
$dlg.Title = $Title
|
||||||
@@ -78,7 +80,7 @@ function Show-ImportExportConfigWindow {
|
|||||||
$cb.Margin = [System.Windows.Thickness]::new(0,0,0,4)
|
$cb.Margin = [System.Windows.Thickness]::new(0,0,0,4)
|
||||||
$cb.FontSize = 14
|
$cb.FontSize = 14
|
||||||
$cb.FontWeight = [System.Windows.FontWeights]::Medium
|
$cb.FontWeight = [System.Windows.FontWeights]::Medium
|
||||||
$cb.Foreground = $dlg.FindResource('FgColor')
|
$cb.Foreground = $dlg.FindResource("AppFgColor")
|
||||||
if ($DisabledCategories -contains $cat) {
|
if ($DisabledCategories -contains $cat) {
|
||||||
$cb.IsChecked = $false
|
$cb.IsChecked = $false
|
||||||
$cb.IsEnabled = $false
|
$cb.IsEnabled = $false
|
||||||
@@ -93,9 +95,9 @@ function Show-ImportExportConfigWindow {
|
|||||||
$detailsText = New-Object System.Windows.Controls.TextBlock
|
$detailsText = New-Object System.Windows.Controls.TextBlock
|
||||||
$detailsText.Text = $CategoryDetails[$cat]
|
$detailsText.Text = $CategoryDetails[$cat]
|
||||||
$detailsText.FontSize = 12
|
$detailsText.FontSize = 12
|
||||||
$detailsText.Foreground = $dlg.FindResource('FgColor')
|
$detailsText.Foreground = $dlg.FindResource("AppFgColor")
|
||||||
$detailsText.Margin = [System.Windows.Thickness]::new(30,0,0,0)
|
$detailsText.Margin = [System.Windows.Thickness]::new(32,0,0,0)
|
||||||
$detailsText.Opacity = 0.75
|
$detailsText.Opacity = if ($DisabledCategories -contains $cat) { 0.45 } else { 0.75 }
|
||||||
$detailsText.TextWrapping = [System.Windows.TextWrapping]::Wrap
|
$detailsText.TextWrapping = [System.Windows.TextWrapping]::Wrap
|
||||||
$container.Children.Add($detailsText) | Out-Null
|
$container.Children.Add($detailsText) | Out-Null
|
||||||
}
|
}
|
||||||
@@ -286,11 +288,17 @@ function Build-CategoryDetails {
|
|||||||
$details = @{}
|
$details = @{}
|
||||||
|
|
||||||
if ($AppCount -gt 0) {
|
if ($AppCount -gt 0) {
|
||||||
$details['Applications'] = "$AppCount app$(if ($AppCount -ne 1) { 's' })"
|
$details['Applications'] = "$AppCount app$(if ($AppCount -ne 1) { 's' }) selected"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$details['Applications'] = 'No apps selected'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($TweakCount -gt 0) {
|
if ($TweakCount -gt 0) {
|
||||||
$details['System Tweaks'] = "$TweakCount tweak$(if ($TweakCount -ne 1) { 's' })"
|
$details['System Tweaks'] = "$TweakCount tweak$(if ($TweakCount -ne 1) { 's' }) selected"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$details['System Tweaks'] = 'No tweaks selected'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($DeploymentSettings) {
|
if ($DeploymentSettings) {
|
||||||
@@ -381,7 +389,7 @@ function Export-Configuration {
|
|||||||
$deploymentSettings = Get-DeploymentSettings -Owner $Owner -UserSelectionCombo $UserSelectionCombo -OtherUsernameTextBox $OtherUsernameTextBox
|
$deploymentSettings = Get-DeploymentSettings -Owner $Owner -UserSelectionCombo $UserSelectionCombo -OtherUsernameTextBox $OtherUsernameTextBox
|
||||||
$categoryDetails = Build-CategoryDetails -AppCount $selectedApps.Count -TweakCount $tweakSettings.Count -DeploymentSettings $deploymentSettings
|
$categoryDetails = Build-CategoryDetails -AppCount $selectedApps.Count -TweakCount $tweakSettings.Count -DeploymentSettings $deploymentSettings
|
||||||
|
|
||||||
$categories = Show-ImportExportConfigWindow -Owner $Owner -UsesDarkMode $UsesDarkMode -Title 'Export Configuration' -Prompt 'Select the settings you wish to include in your export.' -DisabledCategories $disabledCategories -CategoryDetails $categoryDetails -ActionLabel 'Export Settings'
|
$categories = Show-ImportExportConfigWindow -Owner $Owner -UsesDarkMode $UsesDarkMode -Title 'Export Configuration' -Prompt 'Create a configuration file based on the currently selected settings. You can choose which settings categories you wish to include in the export.' -DisabledCategories $disabledCategories -CategoryDetails $categoryDetails -ActionLabel 'Export Settings'
|
||||||
if (-not $categories) {
|
if (-not $categories) {
|
||||||
Write-Host 'Export canceled.'
|
Write-Host 'Export canceled.'
|
||||||
return
|
return
|
||||||
@@ -413,6 +421,12 @@ function Export-Configuration {
|
|||||||
|
|
||||||
Write-Host "Exporting configuration to '$($saveDialog.FileName)'... (Categories: $($categories -join ', '))"
|
Write-Host "Exporting configuration to '$($saveDialog.FileName)'... (Categories: $($categories -join ', '))"
|
||||||
|
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Export configuration to '$($saveDialog.FileName)'" -ForegroundColor Cyan
|
||||||
|
Show-MessageBox -Message "[WhatIf] Configuration would be exported to this file (no file written)." -Title 'Export Configuration' -Button 'OK' -Icon 'Information' | Out-Null
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (SaveToFile -Config $config -FilePath $saveDialog.FileName) {
|
if (SaveToFile -Config $config -FilePath $saveDialog.FileName) {
|
||||||
Write-Host "Configuration exported successfully: $($saveDialog.FileName)"
|
Write-Host "Configuration exported successfully: $($saveDialog.FileName)"
|
||||||
Show-MessageBox -Message "Configuration exported successfully." -Title 'Export Configuration' -Button 'OK' -Icon 'Information' | Out-Null
|
Show-MessageBox -Message "Configuration exported successfully." -Title 'Export Configuration' -Button 'OK' -Icon 'Information' | Out-Null
|
||||||
@@ -475,7 +489,7 @@ function Import-Configuration {
|
|||||||
$tweakCount = @($config.Tweaks | Where-Object { $_ -and $_.Name -and $_.Value -eq $true }).Count
|
$tweakCount = @($config.Tweaks | Where-Object { $_ -and $_.Name -and $_.Value -eq $true }).Count
|
||||||
$categoryDetails = Build-CategoryDetails -AppCount $appCount -TweakCount $tweakCount -DeploymentSettings @($config.Deployment)
|
$categoryDetails = Build-CategoryDetails -AppCount $appCount -TweakCount $tweakCount -DeploymentSettings @($config.Deployment)
|
||||||
|
|
||||||
$categories = Show-ImportExportConfigWindow -Owner $Owner -UsesDarkMode $UsesDarkMode -Title 'Import Configuration' -Prompt 'Select the settings you wish to import. You can review and modify them before they are applied.' -Categories $availableCategories -CategoryDetails $categoryDetails -ActionLabel 'Import Settings'
|
$categories = Show-ImportExportConfigWindow -Owner $Owner -UsesDarkMode $UsesDarkMode -Title 'Import Configuration' -Prompt 'Choose the settings categories that you wish to import. You can review and modify the imported settings before they are applied.' -Categories $availableCategories -CategoryDetails $categoryDetails -ActionLabel 'Import Settings'
|
||||||
if (-not $categories) {
|
if (-not $categories) {
|
||||||
Write-Host 'Import canceled.'
|
Write-Host 'Import canceled.'
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1,71 +1,6 @@
|
|||||||
function Show-MainWindow {
|
function Show-MainWindow {
|
||||||
Add-Type -AssemblyName PresentationFramework,PresentationCore,WindowsBase,System.Windows.Forms | Out-Null
|
Add-Type -AssemblyName PresentationFramework,PresentationCore,WindowsBase,System.Windows.Forms | Out-Null
|
||||||
|
|
||||||
# ---- Constrain maximized window to taskbar work area ----
|
|
||||||
if (-not ([System.Management.Automation.PSTypeName]'Win11Debloat.MaximizedWindowHelper').Type) {
|
|
||||||
Add-Type -Namespace Win11Debloat -Name MaximizedWindowHelper `
|
|
||||||
-ReferencedAssemblies 'PresentationFramework','System.Windows.Forms','System.Drawing' `
|
|
||||||
-MemberDefinition @'
|
|
||||||
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
|
|
||||||
private struct MINMAXINFO {
|
|
||||||
public POINT ptReserved, ptMaxSize, ptMaxPosition, ptMinTrackSize, ptMaxTrackSize;
|
|
||||||
}
|
|
||||||
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
|
|
||||||
private struct POINT { public int x, y; }
|
|
||||||
|
|
||||||
[System.Runtime.InteropServices.DllImport("user32.dll")]
|
|
||||||
private static extern System.IntPtr MonitorFromWindow(System.IntPtr hwnd, uint dwFlags);
|
|
||||||
|
|
||||||
[System.Runtime.InteropServices.DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
|
|
||||||
private static extern bool GetMonitorInfo(System.IntPtr hMonitor, ref MONITORINFO lpmi);
|
|
||||||
|
|
||||||
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
|
|
||||||
private struct RECT {
|
|
||||||
public int Left, Top, Right, Bottom;
|
|
||||||
}
|
|
||||||
|
|
||||||
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet = System.Runtime.InteropServices.CharSet.Auto)]
|
|
||||||
private struct MONITORINFO {
|
|
||||||
public int cbSize;
|
|
||||||
public RECT rcMonitor;
|
|
||||||
public RECT rcWork;
|
|
||||||
public uint dwFlags;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static System.IntPtr WmGetMinMaxInfoHook(
|
|
||||||
System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) {
|
|
||||||
if (msg == 0x0024) { // WM_GETMINMAXINFO
|
|
||||||
var mmi = (MINMAXINFO)System.Runtime.InteropServices.Marshal.PtrToStructure(
|
|
||||||
lParam, typeof(MINMAXINFO));
|
|
||||||
|
|
||||||
const uint MONITOR_DEFAULTTONEAREST = 0x00000002;
|
|
||||||
var monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
|
|
||||||
var monitorInfo = new MONITORINFO();
|
|
||||||
monitorInfo.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(MONITORINFO));
|
|
||||||
|
|
||||||
if (monitor != System.IntPtr.Zero && GetMonitorInfo(monitor, ref monitorInfo)) {
|
|
||||||
mmi.ptMaxPosition.x = monitorInfo.rcWork.Left - monitorInfo.rcMonitor.Left;
|
|
||||||
mmi.ptMaxPosition.y = monitorInfo.rcWork.Top - monitorInfo.rcMonitor.Top;
|
|
||||||
mmi.ptMaxSize.x = monitorInfo.rcWork.Right - monitorInfo.rcWork.Left;
|
|
||||||
mmi.ptMaxSize.y = monitorInfo.rcWork.Bottom - monitorInfo.rcWork.Top;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var screen = System.Windows.Forms.Screen.FromHandle(hwnd);
|
|
||||||
var wa = screen.WorkingArea;
|
|
||||||
var bounds = screen.Bounds;
|
|
||||||
mmi.ptMaxPosition.x = wa.Left - bounds.Left;
|
|
||||||
mmi.ptMaxPosition.y = wa.Top - bounds.Top;
|
|
||||||
mmi.ptMaxSize.x = wa.Width;
|
|
||||||
mmi.ptMaxSize.y = wa.Height;
|
|
||||||
}
|
|
||||||
|
|
||||||
System.Runtime.InteropServices.Marshal.StructureToPtr(mmi, lParam, true);
|
|
||||||
}
|
|
||||||
return System.IntPtr.Zero;
|
|
||||||
}
|
|
||||||
'@
|
|
||||||
}
|
|
||||||
|
|
||||||
$WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild
|
$WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild
|
||||||
$usesDarkMode = GetSystemUsesDarkMode
|
$usesDarkMode = GetSystemUsesDarkMode
|
||||||
|
|
||||||
@@ -123,12 +58,6 @@
|
|||||||
$window.Add_SourceInitialized({
|
$window.Add_SourceInitialized({
|
||||||
& $applyInitialWindowSize
|
& $applyInitialWindowSize
|
||||||
& $updateWindowChrome
|
& $updateWindowChrome
|
||||||
|
|
||||||
$hwndHelper = New-Object System.Windows.Interop.WindowInteropHelper($window)
|
|
||||||
$hwndSource = [System.Windows.Interop.HwndSource]::FromHwnd($hwndHelper.Handle)
|
|
||||||
$hookMethod = [Win11Debloat.MaximizedWindowHelper].GetMethod('WmGetMinMaxInfoHook')
|
|
||||||
$hook = [System.Delegate]::CreateDelegate([System.Windows.Interop.HwndSourceHook], $hookMethod)
|
|
||||||
$hwndSource.AddHook($hook)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$window.Add_SizeChanged({
|
$window.Add_SizeChanged({
|
||||||
@@ -940,7 +869,7 @@
|
|||||||
|
|
||||||
# ---- Preload app data ----
|
# ---- Preload app data ----
|
||||||
try {
|
try {
|
||||||
$script:PreloadedAppData = LoadAppsDetailsFromJson -OnlyInstalled:$false -InstalledList '' -InitialCheckedFromJson:$false
|
$script:PreloadedAppData = LoadAppsDetailsFromJson -OnlyInstalled:$false -InstalledList $null -InitialCheckedFromJson:$false
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Warning "Failed to preload apps list: $_"
|
Write-Warning "Failed to preload apps list: $_"
|
||||||
@@ -953,6 +882,14 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
$window.Show() | Out-Null
|
$window.Show() | Out-Null
|
||||||
|
|
||||||
|
# If WhatIf mode is enabled, notify the user that no changes will be made
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
$window.Dispatcher.BeginInvoke([System.Windows.Threading.DispatcherPriority]::Loaded, [action]{
|
||||||
|
Show-MessageBox -Message "WhatIf mode is enabled. The script will not make any changes to your system in this mode.`n`nYou can observe the actions that would be taken by the script in the console output." -Title 'WhatIf Mode' -Button 'OK' -Icon 'Information' -Owner $window
|
||||||
|
}) | Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
[System.Windows.Threading.Dispatcher]::PushFrame($frame)
|
[System.Windows.Threading.Dispatcher]::PushFrame($frame)
|
||||||
return $null
|
return $null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,27 +87,27 @@ function Show-MessageBox {
|
|||||||
switch ($Icon) {
|
switch ($Icon) {
|
||||||
'Information' {
|
'Information' {
|
||||||
$iconText.Text = [char]0xE946
|
$iconText.Text = [char]0xE946
|
||||||
$iconText.Foreground = $msgWindow.FindResource('InformationIconColor')
|
$iconText.Foreground = $msgWindow.FindResource('IconInformationColor')
|
||||||
$iconText.Visibility = 'Visible'
|
$iconText.Visibility = 'Visible'
|
||||||
}
|
}
|
||||||
'Success' {
|
'Success' {
|
||||||
$iconText.Text = [char]0xE73E
|
$iconText.Text = [char]0xE73E
|
||||||
$iconText.Foreground = $msgWindow.FindResource('SuccessIconColor')
|
$iconText.Foreground = $msgWindow.FindResource('IconSuccessColor')
|
||||||
$iconText.Visibility = 'Visible'
|
$iconText.Visibility = 'Visible'
|
||||||
}
|
}
|
||||||
'Warning' {
|
'Warning' {
|
||||||
$iconText.Text = [char]0xE7BA
|
$iconText.Text = [char]0xE7BA
|
||||||
$iconText.Foreground = $msgWindow.FindResource('WarningIconColor')
|
$iconText.Foreground = $msgWindow.FindResource('IconWarningColor')
|
||||||
$iconText.Visibility = 'Visible'
|
$iconText.Visibility = 'Visible'
|
||||||
}
|
}
|
||||||
'Error' {
|
'Error' {
|
||||||
$iconText.Text = [char]0xEA39
|
$iconText.Text = [char]0xEA39
|
||||||
$iconText.Foreground = $msgWindow.FindResource('ErrorIconColor')
|
$iconText.Foreground = $msgWindow.FindResource('IconErrorColor')
|
||||||
$iconText.Visibility = 'Visible'
|
$iconText.Visibility = 'Visible'
|
||||||
}
|
}
|
||||||
'Question' {
|
'Question' {
|
||||||
$iconText.Text = [char]0xE897
|
$iconText.Text = [char]0xE897
|
||||||
$iconText.Foreground = $msgWindow.FindResource('QuestionIconColor')
|
$iconText.Foreground = $msgWindow.FindResource('IconQuestionColor')
|
||||||
$iconText.Visibility = 'Visible'
|
$iconText.Visibility = 'Visible'
|
||||||
}
|
}
|
||||||
default {
|
default {
|
||||||
@@ -121,6 +121,8 @@ function Show-MessageBox {
|
|||||||
$button1.Content = 'OK'
|
$button1.Content = 'OK'
|
||||||
$button1.Add_Click({ $msgWindow.Tag = 'OK'; $msgWindow.Close() })
|
$button1.Add_Click({ $msgWindow.Tag = 'OK'; $msgWindow.Close() })
|
||||||
$button2.Visibility = 'Collapsed'
|
$button2.Visibility = 'Collapsed'
|
||||||
|
# Right-align sole button by moving it to column 1
|
||||||
|
[System.Windows.Controls.Grid]::SetColumn($button1, 1)
|
||||||
}
|
}
|
||||||
'OKCancel' {
|
'OKCancel' {
|
||||||
$button1.Content = 'OK'
|
$button1.Content = 'OK'
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
function Show-RestoreBackupDialog {
|
function Show-RestoreBackupDialog {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory = $false)]
|
|
||||||
[System.Windows.Window]$Owner = $null
|
[System.Windows.Window]$Owner = $null
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -197,6 +196,10 @@ function Show-RestoreBackupDialog {
|
|||||||
$primaryActionBtn.Visibility = 'Visible'
|
$primaryActionBtn.Visibility = 'Visible'
|
||||||
$primaryActionBtn.IsDefault = $true
|
$primaryActionBtn.IsDefault = $true
|
||||||
$chooseRegistryBtn.IsDefault = $false
|
$chooseRegistryBtn.IsDefault = $false
|
||||||
|
|
||||||
|
# Show intro panel so user can configure scope & auto-detect
|
||||||
|
$startMenuAutoBackupCheck.IsChecked = $true
|
||||||
|
$state.SelectedStartMenuBackupFilePath = $null
|
||||||
& $refreshStartMenuUi
|
& $refreshStartMenuUi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,27 +327,14 @@ function Show-RestoreBackupDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (-not $useManualBackupFile) {
|
if (-not $useManualBackupFile) {
|
||||||
$autoBackupExists = $false
|
$scopeInfo = & $getStartMenuScopeInfo
|
||||||
if ($scope -eq 'AllUsers') {
|
$autoBackupPath = Get-StartMenuBackupPath -Scope $scopeInfo.Scope
|
||||||
$userPathString = GetUserDirectory -userName "*" -fileName "AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState"
|
if ($null -eq $autoBackupPath) {
|
||||||
$usersStartMenuPaths = Get-ChildItem -Path $userPathString -ErrorAction SilentlyContinue
|
$scopeText = $scopeInfo.SummaryText
|
||||||
foreach ($startMenuPath in $usersStartMenuPaths) {
|
Show-MessageBox -Owner $window -Title 'No Backup Found' -Message "No Start Menu backup file was found for $scopeText. Uncheck 'Automatically find Start Menu backup' to select a backup file manually." -Button 'OK' -Icon 'Warning' | Out-Null
|
||||||
if (Test-Path -LiteralPath (Join-Path $startMenuPath.FullName 'start2.bin.bak')) {
|
|
||||||
$autoBackupExists = $true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$autoBackupPath = "$env:LOCALAPPDATA\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin.bak"
|
|
||||||
$autoBackupExists = Test-Path -LiteralPath $autoBackupPath
|
|
||||||
}
|
|
||||||
|
|
||||||
if (-not $autoBackupExists) {
|
|
||||||
$scopeText = (& $getStartMenuScopeInfo).SummaryText
|
|
||||||
Show-MessageBox -Owner $window -Title 'No Backup Found' -Message "No Start Menu backup file was found. You can uncheck the 'Automatically find Start Menu backup' option to select a backup file manually." -Button 'OK' -Icon 'Warning' | Out-Null
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
$state.SelectedStartMenuBackupFilePath = if ($scopeInfo.Scope -eq 'CurrentUser') { $autoBackupPath } else { $null }
|
||||||
}
|
}
|
||||||
|
|
||||||
$window.Tag = @{
|
$window.Tag = @{
|
||||||
@@ -378,6 +368,7 @@ function Show-RestoreBackupDialog {
|
|||||||
})
|
})
|
||||||
|
|
||||||
$startMenuScopeCombo.Add_SelectionChanged({
|
$startMenuScopeCombo.Add_SelectionChanged({
|
||||||
|
$state.SelectedStartMenuBackupFilePath = $null
|
||||||
& $refreshStartMenuUi
|
& $refreshStartMenuUi
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
function Show-RestoreBackupWindow {
|
function Show-RestoreBackupWindow {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory = $false)]
|
|
||||||
[System.Windows.Window]$Owner = $null
|
[System.Windows.Window]$Owner = $null
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -28,10 +27,17 @@ function Show-RestoreBackupWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "User confirmed registry restore for $($backup.Target)."
|
Write-Host "User confirmed registry restore for $($backup.Target)."
|
||||||
Restore-RegistryBackupState -Backup $backup
|
$restoreOpResult = Restore-RegistryBackupState -Backup $backup
|
||||||
|
if ($restoreOpResult -and $restoreOpResult.Result) {
|
||||||
$restoreResult.RestoredRegistry = $true
|
$restoreResult.RestoredRegistry = $true
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
$successMessage = '[WhatIf] Registry backup would be restored (no changes made).'
|
||||||
|
}
|
||||||
|
else {
|
||||||
$successMessage = 'Registry backup restored successfully. Some changes may require a restart to take effect.'
|
$successMessage = 'Registry backup restored successfully. Some changes may require a restart to take effect.'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
elseif ($dialogResult.Result -eq 'RestoreStartMenu') {
|
elseif ($dialogResult.Result -eq 'RestoreStartMenu') {
|
||||||
$scope = $dialogResult.StartMenuScope
|
$scope = $dialogResult.StartMenuScope
|
||||||
$useManualBackupFile = ($dialogResult.UseManualBackupFile -eq $true)
|
$useManualBackupFile = ($dialogResult.UseManualBackupFile -eq $true)
|
||||||
@@ -68,7 +74,10 @@ function Show-RestoreBackupWindow {
|
|||||||
$warningMessage = "The Start Menu backup was successfully restored for $successCount user(s).`nSome users could not be restored:`n$failureSummary"
|
$warningMessage = "The Start Menu backup was successfully restored for $successCount user(s).`nSome users could not be restored:`n$failureSummary"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ($scope -eq 'AllUsers') {
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
$successMessage = '[WhatIf] Start Menu backup would be restored (no changes made).'
|
||||||
|
}
|
||||||
|
elseif ($scope -eq 'AllUsers') {
|
||||||
$successMessage = "The Start Menu backup was successfully restored for all users. The changes will apply the next time users sign in."
|
$successMessage = "The Start Menu backup was successfully restored for all users. The changes will apply the next time users sign in."
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ param (
|
|||||||
[string]$User,
|
[string]$User,
|
||||||
[switch]$NoRestartExplorer,
|
[switch]$NoRestartExplorer,
|
||||||
[switch]$CreateRestorePoint,
|
[switch]$CreateRestorePoint,
|
||||||
[switch]$RunAppsListGenerator,
|
|
||||||
[switch]$RunDefaults,
|
[switch]$RunDefaults,
|
||||||
[switch]$RunDefaultsLite,
|
[switch]$RunDefaultsLite,
|
||||||
[switch]$RunSavedSettings,
|
[switch]$RunSavedSettings,
|
||||||
@@ -15,7 +14,6 @@ param (
|
|||||||
[string]$Apps,
|
[string]$Apps,
|
||||||
[string]$AppRemovalTarget,
|
[string]$AppRemovalTarget,
|
||||||
[switch]$RemoveApps,
|
[switch]$RemoveApps,
|
||||||
[switch]$RemoveAppsCustom,
|
|
||||||
[switch]$RemoveGamingApps,
|
[switch]$RemoveGamingApps,
|
||||||
[switch]$RemoveHPApps,
|
[switch]$RemoveHPApps,
|
||||||
[switch]$ForceRemoveEdge,
|
[switch]$ForceRemoveEdge,
|
||||||
@@ -152,7 +150,6 @@ if (Test-Path "$configDir") {
|
|||||||
New-Item -ItemType Directory -Path "$backupDir" -Force | Out-Null
|
New-Item -ItemType Directory -Path "$backupDir" -Force | Out-Null
|
||||||
|
|
||||||
$filesToKeep = @(
|
$filesToKeep = @(
|
||||||
'CustomAppsList',
|
|
||||||
'LastUsedSettings.json'
|
'LastUsedSettings.json'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ param (
|
|||||||
[string]$User,
|
[string]$User,
|
||||||
[switch]$NoRestartExplorer,
|
[switch]$NoRestartExplorer,
|
||||||
[switch]$CreateRestorePoint,
|
[switch]$CreateRestorePoint,
|
||||||
[switch]$RunAppsListGenerator,
|
|
||||||
[switch]$RunDefaults,
|
[switch]$RunDefaults,
|
||||||
[switch]$RunDefaultsLite,
|
[switch]$RunDefaultsLite,
|
||||||
[switch]$RunSavedSettings,
|
[switch]$RunSavedSettings,
|
||||||
@@ -15,7 +14,6 @@ param (
|
|||||||
[string]$Apps,
|
[string]$Apps,
|
||||||
[string]$AppRemovalTarget,
|
[string]$AppRemovalTarget,
|
||||||
[switch]$RemoveApps,
|
[switch]$RemoveApps,
|
||||||
[switch]$RemoveAppsCustom,
|
|
||||||
[switch]$RemoveGamingApps,
|
[switch]$RemoveGamingApps,
|
||||||
[switch]$RemoveHPApps,
|
[switch]$RemoveHPApps,
|
||||||
[switch]$ForceRemoveEdge,
|
[switch]$ForceRemoveEdge,
|
||||||
@@ -153,7 +151,6 @@ if (Test-Path "$configDir") {
|
|||||||
New-Item -ItemType Directory -Path "$backupDir" -Force | Out-Null
|
New-Item -ItemType Directory -Path "$backupDir" -Force | Out-Null
|
||||||
|
|
||||||
$filesToKeep = @(
|
$filesToKeep = @(
|
||||||
'CustomAppsList',
|
|
||||||
'LastUsedSettings.json'
|
'LastUsedSettings.json'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -203,6 +203,11 @@ function Invoke-RegistryOperationsFromRegFile {
|
|||||||
$operations = @(Get-RegFileOperations -regFilePath $RegFilePath)
|
$operations = @(Get-RegFileOperations -regFilePath $RegFilePath)
|
||||||
$totalOperations = $operations.Count
|
$totalOperations = $operations.Count
|
||||||
|
|
||||||
|
if ($script:Params.ContainsKey("WhatIf")) {
|
||||||
|
Write-Host "[WhatIf] Apply $totalOperations registry changes from '$RegFilePath'" -ForegroundColor Cyan
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($operation in $operations) {
|
foreach ($operation in $operations) {
|
||||||
try {
|
try {
|
||||||
Invoke-RegistryOperation -Operation $operation -RegFilePath $RegFilePath
|
Invoke-RegistryOperation -Operation $operation -RegFilePath $RegFilePath
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ function ConfirmUnsafeAppRemoval {
|
|||||||
if ($SelectedApps -contains "Microsoft.WindowsStore") {
|
if ($SelectedApps -contains "Microsoft.WindowsStore") {
|
||||||
$result = Show-MessageBox -Message 'Are you sure that you wish to uninstall the Microsoft Store? This app cannot easily be reinstalled.' -Title 'Are you sure?' -Button 'YesNo' -Icon 'Warning' -Owner $Owner
|
$result = Show-MessageBox -Message 'Are you sure that you wish to uninstall the Microsoft Store? This app cannot easily be reinstalled.' -Title 'Are you sure?' -Button 'YesNo' -Icon 'Warning' -Owner $Owner
|
||||||
|
|
||||||
if ($result -eq 'No') {
|
if ($result -ne 'Yes') {
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ function ConfirmUnsafeAppRemoval {
|
|||||||
if ($SelectedApps -contains "Microsoft.WindowsTerminal") {
|
if ($SelectedApps -contains "Microsoft.WindowsTerminal") {
|
||||||
$result = Show-MessageBox -Message 'Are you sure that you wish to remove Windows Terminal? Windows Terminal is the default command-line app for Windows. Ensure you are not running Win11Debloat via Windows Terminal before proceeding to avoid a mid-process failure.' -Title 'Are you sure?' -Button 'YesNo' -Icon 'Warning' -Owner $Owner
|
$result = Show-MessageBox -Message 'Are you sure that you wish to remove Windows Terminal? Windows Terminal is the default command-line app for Windows. Ensure you are not running Win11Debloat via Windows Terminal before proceeding to avoid a mid-process failure.' -Title 'Are you sure?' -Button 'YesNo' -Icon 'Warning' -Owner $Owner
|
||||||
|
|
||||||
if ($result -eq 'No') {
|
if ($result -ne 'Yes') {
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
# Operation type constants, used to indicate the type of operation for each registry entry
|
||||||
|
$script:OpType_RemoveKey = 'DeleteKey'
|
||||||
|
$script:OpType_RemoveValue = 'DeleteValue'
|
||||||
|
$script:OpType_Store = 'SetValue'
|
||||||
|
|
||||||
function Get-RegFileOperations {
|
function Get-RegFileOperations {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
@@ -26,6 +31,7 @@ function Get-RegFileOperations {
|
|||||||
$operations = @()
|
$operations = @()
|
||||||
$currentKeyPath = $null
|
$currentKeyPath = $null
|
||||||
$isDeletedKey = $false
|
$isDeletedKey = $false
|
||||||
|
$opRef = $script:OpType_RemoveKey
|
||||||
|
|
||||||
foreach ($rawLine in $lines) {
|
foreach ($rawLine in $lines) {
|
||||||
$line = $rawLine.Trim()
|
$line = $rawLine.Trim()
|
||||||
@@ -43,7 +49,7 @@ function Get-RegFileOperations {
|
|||||||
|
|
||||||
if ($isDeletedKey) {
|
if ($isDeletedKey) {
|
||||||
$operations += [PSCustomObject]@{
|
$operations += [PSCustomObject]@{
|
||||||
OperationType = 'DeleteKey'
|
OperationType = $opRef
|
||||||
KeyPath = $currentKeyPath
|
KeyPath = $currentKeyPath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -87,10 +93,12 @@ function Convert-RegValueData {
|
|||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
[string]$valueData
|
[string]$valueData
|
||||||
)
|
)
|
||||||
|
$opStore = $script:OpType_Store
|
||||||
|
$opRemove = $script:OpType_RemoveValue
|
||||||
|
|
||||||
if ($valueData -eq '-') {
|
if ($valueData -eq '-') {
|
||||||
return [PSCustomObject]@{
|
return [PSCustomObject]@{
|
||||||
OperationType = 'DeleteValue'
|
OperationType = $opRemove
|
||||||
ValueType = $null
|
ValueType = $null
|
||||||
ValueData = $null
|
ValueData = $null
|
||||||
}
|
}
|
||||||
@@ -98,7 +106,7 @@ function Convert-RegValueData {
|
|||||||
|
|
||||||
if ($valueData -match '^dword:(?<value>[0-9a-fA-F]{1,8})$') {
|
if ($valueData -match '^dword:(?<value>[0-9a-fA-F]{1,8})$') {
|
||||||
return [PSCustomObject]@{
|
return [PSCustomObject]@{
|
||||||
OperationType = 'SetValue'
|
OperationType = $opStore
|
||||||
ValueType = 'DWord'
|
ValueType = 'DWord'
|
||||||
ValueData = [uint32]::Parse($matches.value, [System.Globalization.NumberStyles]::HexNumber)
|
ValueData = [uint32]::Parse($matches.value, [System.Globalization.NumberStyles]::HexNumber)
|
||||||
}
|
}
|
||||||
@@ -106,7 +114,7 @@ function Convert-RegValueData {
|
|||||||
|
|
||||||
if ($valueData -match '^qword:(?<value>[0-9a-fA-F]{1,16})$') {
|
if ($valueData -match '^qword:(?<value>[0-9a-fA-F]{1,16})$') {
|
||||||
return [PSCustomObject]@{
|
return [PSCustomObject]@{
|
||||||
OperationType = 'SetValue'
|
OperationType = $opStore
|
||||||
ValueType = 'QWord'
|
ValueType = 'QWord'
|
||||||
ValueData = [uint64]::Parse($matches.value, [System.Globalization.NumberStyles]::HexNumber)
|
ValueData = [uint64]::Parse($matches.value, [System.Globalization.NumberStyles]::HexNumber)
|
||||||
}
|
}
|
||||||
@@ -122,7 +130,7 @@ function Convert-RegValueData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return [PSCustomObject]@{
|
return [PSCustomObject]@{
|
||||||
OperationType = 'SetValue'
|
OperationType = $opStore
|
||||||
ValueType = $valueType
|
ValueType = $valueType
|
||||||
ValueData = $value
|
ValueData = $value
|
||||||
}
|
}
|
||||||
@@ -133,7 +141,7 @@ function Convert-RegValueData {
|
|||||||
# Unescape registry string escape sequences
|
# Unescape registry string escape sequences
|
||||||
$stringValue = $stringValue -replace '\\"', '"' -replace '\\\\', '\'
|
$stringValue = $stringValue -replace '\\"', '"' -replace '\\\\', '\'
|
||||||
return [PSCustomObject]@{
|
return [PSCustomObject]@{
|
||||||
OperationType = 'SetValue'
|
OperationType = $opStore
|
||||||
ValueType = 'String'
|
ValueType = 'String'
|
||||||
ValueData = $stringValue
|
ValueData = $stringValue
|
||||||
}
|
}
|
||||||
@@ -149,13 +157,9 @@ function Convert-HexStringToByteArray {
|
|||||||
)
|
)
|
||||||
|
|
||||||
$parts = $hexValue.Split(',') | ForEach-Object { $_.Trim() } | Where-Object { $_ }
|
$parts = $hexValue.Split(',') | ForEach-Object { $_.Trim() } | Where-Object { $_ }
|
||||||
$bytes = New-Object byte[] $parts.Count
|
return [System.Linq.Enumerable]::Select($parts, [Func[object, byte]] {
|
||||||
|
param($h) [System.Convert]::ToByte($h, 16)
|
||||||
for ($i = 0; $i -lt $parts.Count; $i++) {
|
}) -as [byte[]]
|
||||||
$bytes[$i] = [byte]::Parse($parts[$i], [System.Globalization.NumberStyles]::HexNumber)
|
|
||||||
}
|
|
||||||
|
|
||||||
return $bytes
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Convert-RegistryByteArrayToString {
|
function Convert-RegistryByteArrayToString {
|
||||||
|
|||||||
@@ -81,3 +81,4 @@ function Get-RegistryFilePathForFeature {
|
|||||||
|
|
||||||
return Join-Path $script:RegfilesPath $RegistryKey
|
return Join-Path $script:RegfilesPath $RegistryKey
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ function Invoke-NonBlocking {
|
|||||||
|
|
||||||
$result = $ps.EndInvoke($handle)
|
$result = $ps.EndInvoke($handle)
|
||||||
|
|
||||||
|
# Surface non-terminating errors raised inside the runspace so GUI-mode operations
|
||||||
|
# (e.g. failed app removals) don't fail silently - the runspace keeps its own error
|
||||||
|
# stream that is otherwise discarded on Dispose.
|
||||||
|
if ($ps.HadErrors) {
|
||||||
|
foreach ($runspaceError in $ps.Streams.Error) {
|
||||||
|
Write-Error -ErrorRecord $runspaceError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($result.Count -eq 0) { return $null }
|
if ($result.Count -eq 0) { return $null }
|
||||||
if ($result.Count -eq 1) { return $result[0] }
|
if ($result.Count -eq 1) { return $result[0] }
|
||||||
return @($result)
|
return @($result)
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ param (
|
|||||||
[string]$User,
|
[string]$User,
|
||||||
[switch]$NoRestartExplorer,
|
[switch]$NoRestartExplorer,
|
||||||
[switch]$CreateRestorePoint,
|
[switch]$CreateRestorePoint,
|
||||||
[switch]$RunAppsListGenerator,
|
|
||||||
[switch]$RunDefaults,
|
[switch]$RunDefaults,
|
||||||
[switch]$RunDefaultsLite,
|
[switch]$RunDefaultsLite,
|
||||||
[switch]$RunSavedSettings,
|
[switch]$RunSavedSettings,
|
||||||
@@ -15,7 +14,6 @@ param (
|
|||||||
[string]$Apps,
|
[string]$Apps,
|
||||||
[string]$AppRemovalTarget,
|
[string]$AppRemovalTarget,
|
||||||
[switch]$RemoveApps,
|
[switch]$RemoveApps,
|
||||||
[switch]$RemoveAppsCustom,
|
|
||||||
[switch]$RemoveGamingApps,
|
[switch]$RemoveGamingApps,
|
||||||
[switch]$RemoveHPApps,
|
[switch]$RemoveHPApps,
|
||||||
[switch]$ForceRemoveEdge,
|
[switch]$ForceRemoveEdge,
|
||||||
@@ -139,7 +137,7 @@ if (-not $isAdmin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Define script-level variables & paths
|
# Define script-level variables & paths
|
||||||
$script:Version = "2026.06.10"
|
$script:Version = "2026.06.24"
|
||||||
$configPath = Join-Path $PSScriptRoot 'Config'
|
$configPath = Join-Path $PSScriptRoot 'Config'
|
||||||
$logsPath = Join-Path $PSScriptRoot 'Logs'
|
$logsPath = Join-Path $PSScriptRoot 'Logs'
|
||||||
$schemasPath = Join-Path $PSScriptRoot 'Schemas'
|
$schemasPath = Join-Path $PSScriptRoot 'Schemas'
|
||||||
@@ -149,14 +147,13 @@ $script:AppsListFilePath = Join-Path $configPath 'Apps.json'
|
|||||||
$script:DefaultSettingsFilePath = Join-Path $configPath 'DefaultSettings.json'
|
$script:DefaultSettingsFilePath = Join-Path $configPath 'DefaultSettings.json'
|
||||||
$script:FeaturesFilePath = Join-Path $configPath 'Features.json'
|
$script:FeaturesFilePath = Join-Path $configPath 'Features.json'
|
||||||
$script:SavedSettingsFilePath = Join-Path $configPath 'LastUsedSettings.json'
|
$script:SavedSettingsFilePath = Join-Path $configPath 'LastUsedSettings.json'
|
||||||
$script:CustomAppsListFilePath = Join-Path $configPath 'CustomAppsList'
|
|
||||||
$script:DefaultLogPath = Join-Path $logsPath 'Win11Debloat.log'
|
$script:DefaultLogPath = Join-Path $logsPath 'Win11Debloat.log'
|
||||||
$script:RegfilesPath = Join-Path $PSScriptRoot 'Regfiles'
|
$script:RegfilesPath = Join-Path $PSScriptRoot 'Regfiles'
|
||||||
$script:RegistryBackupsPath = Join-Path $PSScriptRoot 'Backups'
|
$script:RegistryBackupsPath = Join-Path $PSScriptRoot 'Backups'
|
||||||
$script:AssetsPath = Join-Path $PSScriptRoot 'Assets'
|
$script:AssetsPath = Join-Path $PSScriptRoot 'Assets'
|
||||||
$script:AppSelectionSchema = Join-Path $schemasPath 'AppSelectionWindow.xaml'
|
$script:AppSelectionSchema = Join-Path $schemasPath 'AppSelectionWindow.xaml'
|
||||||
$script:MainWindowSchema = Join-Path $schemasPath 'MainWindow.xaml'
|
$script:MainWindowSchema = Join-Path $schemasPath 'MainWindow.xaml'
|
||||||
$script:MessageBoxSchema = Join-Path $schemasPath 'MessageBoxWindow.xaml'
|
$script:MessageBoxSchema = Join-Path $schemasPath 'MessageBox.xaml'
|
||||||
$script:AboutWindowSchema = Join-Path $schemasPath 'AboutWindow.xaml'
|
$script:AboutWindowSchema = Join-Path $schemasPath 'AboutWindow.xaml'
|
||||||
$script:ApplyChangesWindowSchema = Join-Path $schemasPath 'ApplyChangesWindow.xaml'
|
$script:ApplyChangesWindowSchema = Join-Path $schemasPath 'ApplyChangesWindow.xaml'
|
||||||
$script:SharedStylesSchema = Join-Path $schemasPath 'SharedStyles.xaml'
|
$script:SharedStylesSchema = Join-Path $schemasPath 'SharedStyles.xaml'
|
||||||
@@ -164,8 +161,9 @@ $script:BubbleHintSchema = Join-Path $schemasPath 'BubbleHint.xaml'
|
|||||||
$script:ImportExportConfigSchema = Join-Path $schemasPath 'ImportExportConfigWindow.xaml'
|
$script:ImportExportConfigSchema = Join-Path $schemasPath 'ImportExportConfigWindow.xaml'
|
||||||
$script:RestoreBackupWindowSchema = Join-Path $schemasPath 'RestoreBackupWindow.xaml'
|
$script:RestoreBackupWindowSchema = Join-Path $schemasPath 'RestoreBackupWindow.xaml'
|
||||||
$script:LoadAppsDetailsScriptPath = Join-Path (Join-Path $scriptsPath 'FileIO') 'LoadAppsDetailsFromJson.ps1'
|
$script:LoadAppsDetailsScriptPath = Join-Path (Join-Path $scriptsPath 'FileIO') 'LoadAppsDetailsFromJson.ps1'
|
||||||
|
$script:TestAppInWingetListScriptPath = Join-Path (Join-Path $scriptsPath 'AppRemoval') 'Test-AppInWingetList.ps1'
|
||||||
|
|
||||||
$script:ControlParams = 'WhatIf', 'Confirm', 'Verbose', 'Debug', 'LogPath', 'Silent', 'Sysprep', 'User', 'NoRestartExplorer', 'RunDefaults', 'RunDefaultsLite', 'RunSavedSettings', 'Config', 'RunAppsListGenerator', 'CLI', 'AppRemovalTarget'
|
$script:ControlParams = 'WhatIf', 'Confirm', 'Verbose', 'Debug', 'LogPath', 'Silent', 'Sysprep', 'User', 'NoRestartExplorer', 'RunDefaults', 'RunDefaultsLite', 'RunSavedSettings', 'Config', 'CLI', 'AppRemovalTarget'
|
||||||
|
|
||||||
# Script-level variables for GUI elements
|
# Script-level variables for GUI elements
|
||||||
$script:GuiWindow = $null
|
$script:GuiWindow = $null
|
||||||
@@ -209,7 +207,8 @@ Write-Host " " -NoNewline; Write-Host " (" -ForegroundColor
|
|||||||
Write-Host " " -NoNewline; Write-Host " ( " -ForegroundColor DarkYellow -NoNewline; Write-Host "'" -ForegroundColor Red -NoNewline; Write-Host " ) " -ForegroundColor DarkYellow -NoNewline; Write-Host "*" -ForegroundColor Yellow
|
Write-Host " " -NoNewline; Write-Host " ( " -ForegroundColor DarkYellow -NoNewline; Write-Host "'" -ForegroundColor Red -NoNewline; Write-Host " ) " -ForegroundColor DarkYellow -NoNewline; Write-Host "*" -ForegroundColor Yellow
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
Write-Host " Win11Debloat is launching..." -ForegroundColor White
|
Write-Host " Win11Debloat is launching..." -ForegroundColor White
|
||||||
Write-Host " Leave this window open" -ForegroundColor DarkGray
|
Write-Host " Keep this window open" -ForegroundColor DarkGray
|
||||||
|
Write-Host ""
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
|
|
||||||
# Log script output to 'Win11Debloat.log' at the specified path
|
# Log script output to 'Win11Debloat.log' at the specified path
|
||||||
@@ -220,6 +219,15 @@ else {
|
|||||||
Start-Transcript -Path $script:DefaultLogPath -Append -IncludeInvocationHeader -Force | Out-Null
|
Start-Transcript -Path $script:DefaultLogPath -Append -IncludeInvocationHeader -Force | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check if the device is domain-joined and warn the user (Group Policy may override changes)
|
||||||
|
try {
|
||||||
|
$computerSystem = Get-CimInstance Win32_ComputerSystem -ErrorAction SilentlyContinue
|
||||||
|
if ($null -ne $computerSystem -and $computerSystem.PartOfDomain) {
|
||||||
|
Write-Warning "This machine is domain-joined. Group Policy may override changes made by Win11Debloat."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
# Check if script has all required files
|
# Check if script has all required files
|
||||||
if (-not ((Test-Path $script:DefaultSettingsFilePath) -and (Test-Path $script:AppsListFilePath) -and (Test-Path $script:RegfilesPath) -and (Test-Path $script:AssetsPath) -and (Test-Path $script:AppSelectionSchema) -and (Test-Path $script:ApplyChangesWindowSchema) -and (Test-Path $script:SharedStylesSchema) -and (Test-Path $script:BubbleHintSchema) -and (Test-Path $script:RestoreBackupWindowSchema) -and (Test-Path $script:FeaturesFilePath))) {
|
if (-not ((Test-Path $script:DefaultSettingsFilePath) -and (Test-Path $script:AppsListFilePath) -and (Test-Path $script:RegfilesPath) -and (Test-Path $script:AssetsPath) -and (Test-Path $script:AppSelectionSchema) -and (Test-Path $script:ApplyChangesWindowSchema) -and (Test-Path $script:SharedStylesSchema) -and (Test-Path $script:BubbleHintSchema) -and (Test-Path $script:RestoreBackupWindowSchema) -and (Test-Path $script:FeaturesFilePath))) {
|
||||||
Write-Error "Win11Debloat is unable to find required files, please ensure all script files are present"
|
Write-Error "Win11Debloat is unable to find required files, please ensure all script files are present"
|
||||||
@@ -234,6 +242,10 @@ $script:Features = @{}
|
|||||||
try {
|
try {
|
||||||
$featuresData = Get-Content -Path $script:FeaturesFilePath -Raw | ConvertFrom-Json
|
$featuresData = Get-Content -Path $script:FeaturesFilePath -Raw | ConvertFrom-Json
|
||||||
foreach ($feature in $featuresData.Features) {
|
foreach ($feature in $featuresData.Features) {
|
||||||
|
if ([string]::IsNullOrWhiteSpace([string]$feature.FeatureId) -or [string]::IsNullOrWhiteSpace([string]$feature.Label) -or [string]::IsNullOrWhiteSpace([string]$feature.ApplyText)) {
|
||||||
|
Write-Warning "Feature '$($feature.FeatureId)' is missing a FeatureId, Label, or ApplyText in Features.json and will be skipped."
|
||||||
|
continue
|
||||||
|
}
|
||||||
$script:Features[$feature.FeatureId] = $feature
|
$script:Features[$feature.FeatureId] = $feature
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -279,6 +291,7 @@ if (-not $script:WingetInstalled -and -not $Silent) {
|
|||||||
. "$PSScriptRoot/Scripts/AppRemoval/ForceRemoveEdge.ps1"
|
. "$PSScriptRoot/Scripts/AppRemoval/ForceRemoveEdge.ps1"
|
||||||
. "$PSScriptRoot/Scripts/AppRemoval/RemoveApps.ps1"
|
. "$PSScriptRoot/Scripts/AppRemoval/RemoveApps.ps1"
|
||||||
. "$PSScriptRoot/Scripts/AppRemoval/GetInstalledAppsViaWinget.ps1"
|
. "$PSScriptRoot/Scripts/AppRemoval/GetInstalledAppsViaWinget.ps1"
|
||||||
|
. "$PSScriptRoot/Scripts/AppRemoval/Test-AppInWingetList.ps1"
|
||||||
|
|
||||||
# CLI functions
|
# CLI functions
|
||||||
. "$PSScriptRoot/Scripts/CLI/AwaitKeyToExit.ps1"
|
. "$PSScriptRoot/Scripts/CLI/AwaitKeyToExit.ps1"
|
||||||
@@ -292,7 +305,7 @@ if (-not $script:WingetInstalled -and -not $Silent) {
|
|||||||
|
|
||||||
# Features functions
|
# Features functions
|
||||||
. "$PSScriptRoot/Scripts/Features/GetCurrentTweakState.ps1"
|
. "$PSScriptRoot/Scripts/Features/GetCurrentTweakState.ps1"
|
||||||
. "$PSScriptRoot/Scripts/Features/ExecuteChanges.ps1"
|
. "$PSScriptRoot/Scripts/Features/InvokeChanges.ps1"
|
||||||
. "$PSScriptRoot/Scripts/Features/CreateSystemRestorePoint.ps1"
|
. "$PSScriptRoot/Scripts/Features/CreateSystemRestorePoint.ps1"
|
||||||
. "$PSScriptRoot/Scripts/Features/BackupRegistryFeatureSelection.ps1"
|
. "$PSScriptRoot/Scripts/Features/BackupRegistryFeatureSelection.ps1"
|
||||||
. "$PSScriptRoot/Scripts/Features/BackupRegistrySnapshotCapture.ps1"
|
. "$PSScriptRoot/Scripts/Features/BackupRegistrySnapshotCapture.ps1"
|
||||||
@@ -300,7 +313,8 @@ if (-not $script:WingetInstalled -and -not $Silent) {
|
|||||||
. "$PSScriptRoot/Scripts/Features/RegistryBackupValidation.ps1"
|
. "$PSScriptRoot/Scripts/Features/RegistryBackupValidation.ps1"
|
||||||
. "$PSScriptRoot/Scripts/Features/RestoreRegistryApplyState.ps1"
|
. "$PSScriptRoot/Scripts/Features/RestoreRegistryApplyState.ps1"
|
||||||
. "$PSScriptRoot/Scripts/Features/RestoreRegistryBackup.ps1"
|
. "$PSScriptRoot/Scripts/Features/RestoreRegistryBackup.ps1"
|
||||||
. "$PSScriptRoot/Scripts/Features/DisableStoreSearchSuggestions.ps1"
|
. "$PSScriptRoot/Scripts/Features/StoreSearchSuggestions.ps1"
|
||||||
|
. "$PSScriptRoot/Scripts/Features/TelemetryScheduledTasks.ps1"
|
||||||
. "$PSScriptRoot/Scripts/Features/WindowsOptionalFeatures.ps1"
|
. "$PSScriptRoot/Scripts/Features/WindowsOptionalFeatures.ps1"
|
||||||
. "$PSScriptRoot/Scripts/Features/ImportRegistryFile.ps1"
|
. "$PSScriptRoot/Scripts/Features/ImportRegistryFile.ps1"
|
||||||
. "$PSScriptRoot/Scripts/Features/ReplaceStartMenu.ps1"
|
. "$PSScriptRoot/Scripts/Features/ReplaceStartMenu.ps1"
|
||||||
@@ -311,7 +325,6 @@ if (-not $script:WingetInstalled -and -not $Silent) {
|
|||||||
. "$PSScriptRoot/Scripts/FileIO/SaveToFile.ps1"
|
. "$PSScriptRoot/Scripts/FileIO/SaveToFile.ps1"
|
||||||
. "$PSScriptRoot/Scripts/FileIO/SaveSettings.ps1"
|
. "$PSScriptRoot/Scripts/FileIO/SaveSettings.ps1"
|
||||||
. "$PSScriptRoot/Scripts/FileIO/LoadSettings.ps1"
|
. "$PSScriptRoot/Scripts/FileIO/LoadSettings.ps1"
|
||||||
. "$PSScriptRoot/Scripts/FileIO/SaveCustomAppsListToFile.ps1"
|
|
||||||
. "$PSScriptRoot/Scripts/FileIO/ValidateAppslist.ps1"
|
. "$PSScriptRoot/Scripts/FileIO/ValidateAppslist.ps1"
|
||||||
. "$PSScriptRoot/Scripts/FileIO/LoadAppsFromFile.ps1"
|
. "$PSScriptRoot/Scripts/FileIO/LoadAppsFromFile.ps1"
|
||||||
. "$PSScriptRoot/Scripts/FileIO/LoadAppsDetailsFromJson.ps1"
|
. "$PSScriptRoot/Scripts/FileIO/LoadAppsDetailsFromJson.ps1"
|
||||||
@@ -422,7 +435,11 @@ if ($script:Params.ContainsKey("User")) {
|
|||||||
GetUserDirectory -userName $script:Params.Item("User") | Out-Null
|
GetUserDirectory -userName $script:Params.Item("User") | Out-Null
|
||||||
}
|
}
|
||||||
if ($script:Params.ContainsKey("AppRemovalTarget")) {
|
if ($script:Params.ContainsKey("AppRemovalTarget")) {
|
||||||
GetUserDirectory -userName $script:Params.Item("AppRemovalTarget") | Out-Null
|
$appRemovalTargetValue = $script:Params.Item("AppRemovalTarget")
|
||||||
|
# 'AllUsers' / 'CurrentUser' are sentinel scope values, not real usernames - don't resolve them as a profile
|
||||||
|
if ($appRemovalTargetValue -notin @('AllUsers', 'CurrentUser')) {
|
||||||
|
GetUserDirectory -userName $appRemovalTargetValue | Out-Null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Remove LastUsedSettings.json file if it exists and is empty
|
# Remove LastUsedSettings.json file if it exists and is empty
|
||||||
@@ -433,24 +450,6 @@ if ((Test-Path $script:SavedSettingsFilePath) -and ([String]::IsNullOrWhiteSpace
|
|||||||
# Default to CLI mode for deployment-targeted parameters.
|
# Default to CLI mode for deployment-targeted parameters.
|
||||||
$launchInCLI = $CLI -or $script:Params.ContainsKey("User") -or $script:Params.ContainsKey("Sysprep") -or $script:Params.ContainsKey("AppRemovalTarget")
|
$launchInCLI = $CLI -or $script:Params.ContainsKey("User") -or $script:Params.ContainsKey("Sysprep") -or $script:Params.ContainsKey("AppRemovalTarget")
|
||||||
|
|
||||||
# Only run the app selection form if the 'RunAppsListGenerator' parameter was passed to the script
|
|
||||||
if ($RunAppsListGenerator) {
|
|
||||||
PrintHeader "Custom Apps List Generator"
|
|
||||||
|
|
||||||
$result = Show-AppSelectionWindow
|
|
||||||
|
|
||||||
# Show different message based on whether the app selection was saved or cancelled
|
|
||||||
if ($result -ne $true) {
|
|
||||||
Write-Host "Application selection window was closed without saving." -ForegroundColor Red
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Write-Output "Your app selection was saved to the 'CustomAppsList' file, found at:"
|
|
||||||
Write-Host "$PSScriptRoot" -ForegroundColor Yellow
|
|
||||||
}
|
|
||||||
|
|
||||||
AwaitKeyToExit
|
|
||||||
}
|
|
||||||
|
|
||||||
# Change script execution based on provided parameters or user input
|
# Change script execution based on provided parameters or user input
|
||||||
if ((-not $script:Params.Count) -or $RunDefaults -or $RunDefaultsLite -or $RunSavedSettings -or $Config -or ($controlParamsCount -eq $script:Params.Count)) {
|
if ((-not $script:Params.Count) -or $RunDefaults -or $RunDefaultsLite -or $RunSavedSettings -or $Config -or ($controlParamsCount -eq $script:Params.Count)) {
|
||||||
if ($RunDefaults -or $RunDefaultsLite) {
|
if ($RunDefaults -or $RunDefaultsLite) {
|
||||||
@@ -488,7 +487,11 @@ if ((-not $script:Params.Count) -or $RunDefaults -or $RunDefaultsLite -or $RunSa
|
|||||||
try {
|
try {
|
||||||
$result = Show-MainWindow
|
$result = Show-MainWindow
|
||||||
|
|
||||||
|
try {
|
||||||
Stop-Transcript
|
Stop-Transcript
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
Exit
|
Exit
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
@@ -535,7 +538,7 @@ if (($controlParamsCount -eq $script:Params.Keys.Count) -or ($script:Params.Keys
|
|||||||
|
|
||||||
# Execute all selected/provided parameters using the consolidated function
|
# Execute all selected/provided parameters using the consolidated function
|
||||||
# (This also handles restore point creation if requested)
|
# (This also handles restore point creation if requested)
|
||||||
ExecuteAllChanges
|
Invoke-AllChanges
|
||||||
|
|
||||||
RestartExplorer
|
RestartExplorer
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user