mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-04-05 22:28:31 +00:00
Compare commits
10 Commits
751b7ef79c
...
26.02.24
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ba3a5d324 | ||
|
|
f854d14117 | ||
|
|
19204534a2 | ||
|
|
a9d9b148db | ||
|
|
d5d0bf25f0 | ||
|
|
da3fd87f9a | ||
|
|
9e8cefc973 | ||
|
|
a532e9ec9d | ||
|
|
844979fee7 | ||
|
|
78302934ef |
7
.github/workflows/auto-merge-docs.yaml
vendored
7
.github/workflows/auto-merge-docs.yaml
vendored
@@ -8,7 +8,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
auto-merge:
|
auto-merge:
|
||||||
if: github.event.pull_request.head.ref == 'docs-update' && github.event.pull_request.user.login == 'github-actions[bot]'
|
if: github.event.pull_request.head.ref == 'docs-update' && (github.event.pull_request.user.login == 'ChrisTitusTech' || github.event.pull_request.user.login == 'github-actions[bot]')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
@@ -18,13 +18,14 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Auto-approve PR
|
- name: Auto-approve PR
|
||||||
|
if: github.event.pull_request.user.login == 'github-actions[bot]'
|
||||||
run: gh pr review "$PR_NUMBER" --approve
|
run: gh pr review "$PR_NUMBER" --approve
|
||||||
env:
|
env:
|
||||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||||
GH_TOKEN: ${{ secrets.AUTO_MERGE }}
|
GH_TOKEN: ${{ secrets.AUTO_MERGE }}
|
||||||
|
|
||||||
- name: Enable auto-merge
|
- name: Enable auto-merge
|
||||||
run: gh pr merge "$PR_NUMBER" --squash --auto --delete-branch
|
run: gh pr merge "$PR_NUMBER" --squash --delete-branch --admin
|
||||||
env:
|
env:
|
||||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.AUTO_MERGE }}
|
||||||
|
|||||||
15
.github/workflows/docs.yaml
vendored
15
.github/workflows/docs.yaml
vendored
@@ -12,7 +12,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
pages: write
|
pages: write
|
||||||
id-token: write
|
id-token: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
@@ -47,22 +47,27 @@ jobs:
|
|||||||
- name: Setup Pages
|
- name: Setup Pages
|
||||||
id: pages
|
id: pages
|
||||||
uses: actions/configure-pages@v5
|
uses: actions/configure-pages@v5
|
||||||
|
|
||||||
- name: Generate Dev Docs from JSON
|
- name: Generate Dev Docs from JSON
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
Set-Location tools
|
Set-Location tools
|
||||||
./devdocs-generator.ps1
|
./devdocs-generator.ps1
|
||||||
|
|
||||||
- name: Create Pull Request 🚀
|
- name: Create Pull Request
|
||||||
id: cpr
|
id: cpr
|
||||||
uses: peter-evans/create-pull-request@v6
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.AUTO_MERGE }}
|
||||||
commit-message: 'Update generated documentation'
|
commit-message: 'chore: Update generated dev docs'
|
||||||
title: 'chore: Update Generated Dev Docs'
|
title: 'chore: Update Generated Dev Docs'
|
||||||
body: 'Automated update of generated documentation from JSON sources'
|
body: 'Automated update of generated documentation from JSON sources'
|
||||||
branch: docs-update
|
branch: docs-update
|
||||||
delete-branch: true
|
delete-branch: true
|
||||||
|
add-paths: |
|
||||||
|
docs/content/dev/
|
||||||
|
config/tweaks.json
|
||||||
|
config/feature.json
|
||||||
labels: |
|
labels: |
|
||||||
automated
|
automated
|
||||||
documentation
|
documentation
|
||||||
|
|||||||
37
.github/workflows/pre-release.yaml
vendored
37
.github/workflows/pre-release.yaml
vendored
@@ -3,6 +3,7 @@ name: Pre-Release WinUtil
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
actions: read
|
actions: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # Manual trigger added
|
workflow_dispatch: # Manual trigger added
|
||||||
@@ -22,25 +23,35 @@ jobs:
|
|||||||
Set-Location tools
|
Set-Location tools
|
||||||
./devdocs-generator.ps1
|
./devdocs-generator.ps1
|
||||||
|
|
||||||
- name: Commit Updated JSON Links
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git add config/tweaks.json config/feature.json
|
|
||||||
$changes = git diff --cached --quiet; if ($LASTEXITCODE -ne 0) {
|
|
||||||
git commit -m "Update documentation links in JSON configs"
|
|
||||||
git push
|
|
||||||
} else {
|
|
||||||
Write-Host "No JSON link changes to commit"
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Compile project
|
- name: Compile project
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
Set-ExecutionPolicy Bypass -Scope Process -Force; ./Compile.ps1
|
Set-ExecutionPolicy Bypass -Scope Process -Force; ./Compile.ps1
|
||||||
continue-on-error: false # Directly fail the job on error, removing the need for a separate check
|
continue-on-error: false # Directly fail the job on error, removing the need for a separate check
|
||||||
|
|
||||||
|
- name: Create Pull Request for Updated JSON Links
|
||||||
|
id: cpr
|
||||||
|
uses: peter-evans/create-pull-request@v8
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.AUTO_MERGE }}
|
||||||
|
commit-message: 'chore: Update documentation links in JSON configs'
|
||||||
|
title: 'chore: Update Generated Dev Docs'
|
||||||
|
body: 'Automated update of documentation links in JSON configs from pre-release build'
|
||||||
|
branch: docs-update
|
||||||
|
delete-branch: true
|
||||||
|
add-paths: |
|
||||||
|
config/tweaks.json
|
||||||
|
config/feature.json
|
||||||
|
labels: |
|
||||||
|
automated
|
||||||
|
documentation
|
||||||
|
|
||||||
|
- name: Check outputs
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
||||||
|
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
||||||
|
|
||||||
- name: Set Version to Todays Date
|
- name: Set Version to Todays Date
|
||||||
id: extract_version
|
id: extract_version
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
2
.github/workflows/sponsors.yaml
vendored
2
.github/workflows/sponsors.yaml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Create Pull Request 🚀
|
- name: Create Pull Request 🚀
|
||||||
id: cpr
|
id: cpr
|
||||||
uses: peter-evans/create-pull-request@v6
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
commit-message: 'Update sponsors in README'
|
commit-message: 'Update sponsors in README'
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
],
|
],
|
||||||
"Minimal": [
|
"Minimal": [
|
||||||
"WPFTweaksConsumerFeatures",
|
"WPFTweaksConsumerFeatures",
|
||||||
"WPFTweaksDisableExplorerAutoDiscovery",
|
|
||||||
"WPFTweaksWPBT",
|
"WPFTweaksWPBT",
|
||||||
"WPFTweaksServices",
|
"WPFTweaksServices",
|
||||||
"WPFTweaksTelemetry"
|
"WPFTweaksTelemetry"
|
||||||
|
|||||||
@@ -2615,7 +2615,7 @@
|
|||||||
},
|
},
|
||||||
"WPFTweaksDisableExplorerAutoDiscovery": {
|
"WPFTweaksDisableExplorerAutoDiscovery": {
|
||||||
"Content": "Disable Explorer Automatic Folder Discovery",
|
"Content": "Disable Explorer Automatic Folder Discovery",
|
||||||
"Description": "Windows Explorer automatically tries to guess the type of the folder based on its contents, slowing down the browsing experience.",
|
"Description": "Windows Explorer automatically tries to guess the type of the folder based on its contents, slowing down the browsing experience. WARNING! Will disable file explorer grouping",
|
||||||
"category": "Essential Tweaks",
|
"category": "Essential Tweaks",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ title: "Disable Legacy F8 Boot Recovery"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/feature.json",linenos=inline,linenostart=107}
|
```json {filename="config/feature.json",linenos=inline,linenostart=100}
|
||||||
"WPFFeatureDisableLegacyRecovery": {
|
"WPFFeatureDisableLegacyRecovery": {
|
||||||
"Content": "Disable Legacy F8 Boot Recovery",
|
"Content": "Disable Legacy F8 Boot Recovery",
|
||||||
"Description": "Disables Advanced Boot Options screen that lets you start Windows in advanced troubleshooting modes.",
|
"Description": "Disables Advanced Boot Options screen that lets you start Windows in advanced troubleshooting modes.",
|
||||||
"category": "Features",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a019_",
|
|
||||||
"feature": [],
|
"feature": [],
|
||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
"bcdedit /set bootmenupolicy standard"
|
"bcdedit /set bootmenupolicy standard"
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ title: "Enable Legacy F8 Boot Recovery"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/feature.json",linenos=inline,linenostart=95}
|
```json {filename="config/feature.json",linenos=inline,linenostart=89}
|
||||||
"WPFFeatureEnableLegacyRecovery": {
|
"WPFFeatureEnableLegacyRecovery": {
|
||||||
"Content": "Enable Legacy F8 Boot Recovery",
|
"Content": "Enable Legacy F8 Boot Recovery",
|
||||||
"Description": "Enables Advanced Boot Options screen that lets you start Windows in advanced troubleshooting modes.",
|
"Description": "Enables Advanced Boot Options screen that lets you start Windows in advanced troubleshooting modes.",
|
||||||
"category": "Features",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a018_",
|
|
||||||
"feature": [],
|
"feature": [],
|
||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
"bcdedit /set bootmenupolicy legacy"
|
"bcdedit /set bootmenupolicy legacy"
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ title: "Enable Daily Registry Backup Task 12.30am"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/feature.json",linenos=inline,linenostart=77}
|
```json {filename="config/feature.json",linenos=inline,linenostart=72}
|
||||||
"WPFFeatureRegBackup": {
|
"WPFFeatureRegBackup": {
|
||||||
"Content": "Enable Daily Registry Backup Task 12.30am",
|
"Content": "Enable Daily Registry Backup Task 12.30am",
|
||||||
"Description": "Enables daily registry backup, previously disabled by Microsoft in Windows 10 1803.",
|
"Description": "Enables daily registry backup, previously disabled by Microsoft in Windows 10 1803.",
|
||||||
"category": "Features",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a017_",
|
|
||||||
"feature": [],
|
"feature": [],
|
||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ title: "Windows Sandbox"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/feature.json",linenos=inline,linenostart=119}
|
```json {filename="config/feature.json",linenos=inline,linenostart=111}
|
||||||
"WPFFeaturesSandbox": {
|
"WPFFeaturesSandbox": {
|
||||||
"Content": "Windows Sandbox",
|
"Content": "Windows Sandbox",
|
||||||
"Description": "Windows Sandbox is a lightweight virtual machine that provides a temporary desktop environment to safely run applications and programs in isolation.",
|
"Description": "Windows Sandbox is a lightweight virtual machine that provides a temporary desktop environment to safely run applications and programs in isolation.",
|
||||||
"category": "Features",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a021_",
|
|
||||||
"feature": [
|
"feature": [
|
||||||
"Containers-DisposableClientVM"
|
"Containers-DisposableClientVM"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ description: ""
|
|||||||
"Description": ".NET and .NET Framework is a developer platform made up of tools, programming languages, and libraries for building many different types of applications.",
|
"Description": ".NET and .NET Framework is a developer platform made up of tools, programming languages, and libraries for building many different types of applications.",
|
||||||
"category": "Features",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a010_",
|
|
||||||
"feature": [
|
"feature": [
|
||||||
"NetFx4-AdvSrvs",
|
"NetFx4-AdvSrvs",
|
||||||
"NetFx3"
|
"NetFx3"
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ title: "HyperV Virtualization"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/feature.json",linenos=inline,linenostart=15}
|
```json {filename="config/feature.json",linenos=inline,linenostart=14}
|
||||||
"WPFFeatureshyperv": {
|
"WPFFeatureshyperv": {
|
||||||
"Content": "HyperV Virtualization",
|
"Content": "HyperV Virtualization",
|
||||||
"Description": "Hyper-V is a hardware virtualization product developed by Microsoft that allows users to create and manage virtual machines.",
|
"Description": "Hyper-V is a hardware virtualization product developed by Microsoft that allows users to create and manage virtual machines.",
|
||||||
"category": "Features",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a011_",
|
|
||||||
"feature": [
|
"feature": [
|
||||||
"Microsoft-Hyper-V-All"
|
"Microsoft-Hyper-V-All"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ title: "Legacy Media (WMP, DirectPlay)"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/feature.json",linenos=inline,linenostart=29}
|
```json {filename="config/feature.json",linenos=inline,linenostart=27}
|
||||||
"WPFFeatureslegacymedia": {
|
"WPFFeatureslegacymedia": {
|
||||||
"Content": "Legacy Media (WMP, DirectPlay)",
|
"Content": "Legacy Media (WMP, DirectPlay)",
|
||||||
"Description": "Enables legacy programs from previous versions of windows",
|
"Description": "Enables legacy programs from previous versions of windows",
|
||||||
"category": "Features",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a012_",
|
|
||||||
"feature": [
|
"feature": [
|
||||||
"WindowsMediaPlayer",
|
"WindowsMediaPlayer",
|
||||||
"MediaPlayback",
|
"MediaPlayback",
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ title: "NFS - Network File System"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/feature.json",linenos=inline,linenostart=57}
|
```json {filename="config/feature.json",linenos=inline,linenostart=53}
|
||||||
"WPFFeaturenfs": {
|
"WPFFeaturenfs": {
|
||||||
"Content": "NFS - Network File System",
|
"Content": "NFS - Network File System",
|
||||||
"Description": "Network File System (NFS) is a mechanism for storing files on a network.",
|
"Description": "Network File System (NFS) is a mechanism for storing files on a network.",
|
||||||
"category": "Features",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a014_",
|
|
||||||
"feature": [
|
"feature": [
|
||||||
"ServicesForNFS-ClientOnly",
|
"ServicesForNFS-ClientOnly",
|
||||||
"ClientForNFS-Infrastructure",
|
"ClientForNFS-Infrastructure",
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ title: "Windows Subsystem for Linux"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```json {filename="config/feature.json",linenos=inline,linenostart=44}
|
```json {filename="config/feature.json",linenos=inline,linenostart=41}
|
||||||
"WPFFeaturewsl": {
|
"WPFFeaturewsl": {
|
||||||
"Content": "Windows Subsystem for Linux",
|
"Content": "Windows Subsystem for Linux",
|
||||||
"Description": "Windows Subsystem for Linux is an optional feature of Windows that allows Linux programs to run natively on Windows without the need for a separate virtual machine or dual booting.",
|
"Description": "Windows Subsystem for Linux is an optional feature of Windows that allows Linux programs to run natively on Windows without the need for a separate virtual machine or dual booting.",
|
||||||
"category": "Features",
|
"category": "Features",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"Order": "a020_",
|
|
||||||
"feature": [
|
"feature": [
|
||||||
"VirtualMachinePlatform",
|
"VirtualMachinePlatform",
|
||||||
"Microsoft-Windows-Subsystem-Linux"
|
"Microsoft-Windows-Subsystem-Linux"
|
||||||
|
|||||||
@@ -8,13 +8,15 @@ function Invoke-WPFSystemRepair {
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Checks for system corruption using SFC, and DISM
|
Checks for system corruption using SFC, and DISM
|
||||||
|
Checks for disk failure using Chkdsk
|
||||||
|
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
1. SFC - Fixes system file corruption, and fixes DISM if it was corrupted
|
1. Chkdsk - Checks for disk errors, which can cause system file corruption and notifies of early disk failure
|
||||||
2. DISM - Fixes system image corruption, and fixes SFC's system image if it was corrupted
|
2. SFC - scans protected system files for corruption and fixes them
|
||||||
3. Chkdsk - Checks for disk errors, which can cause system file corruption and notifies of early disk failure
|
3. DISM - Repair a corrupted Windows operating system image
|
||||||
#>
|
#>
|
||||||
Start-Process cmd.exe -ArgumentList "/c chkdsk.exe /scan /perf" -NoNewWindow -Wait
|
|
||||||
|
Start-Process cmd.exe -ArgumentList "/c chkdsk /scan /perf" -NoNewWindow -Wait
|
||||||
Start-Process cmd.exe -ArgumentList "/c sfc /scannow" -NoNewWindow -Wait
|
Start-Process cmd.exe -ArgumentList "/c sfc /scannow" -NoNewWindow -Wait
|
||||||
Start-Process cmd.exe -ArgumentList "/c dism /online /cleanup-image /restorehealth" -NoNewWindow -Wait
|
Start-Process cmd.exe -ArgumentList "/c dism /online /cleanup-image /restorehealth" -NoNewWindow -Wait
|
||||||
|
|
||||||
|
|||||||
@@ -3,31 +3,14 @@ title: "Computer Management"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```powershell {filename="functions/public/Invoke-WPFControlPanel.ps1",linenos=inline,linenostart=1}
|
```json {filename="config/feature.json",linenos=inline,linenostart=186}
|
||||||
function Invoke-WPFControlPanel {
|
"WPFPanelComputer": {
|
||||||
<#
|
"Content": "Computer Management",
|
||||||
|
"category": "Legacy Windows Panels",
|
||||||
.SYNOPSIS
|
"panel": "2",
|
||||||
Opens the requested legacy panel
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
.PARAMETER Panel
|
"InvokeScript": [
|
||||||
The panel to open
|
"compmgmt.msc"
|
||||||
|
],
|
||||||
#>
|
|
||||||
param($Panel)
|
|
||||||
|
|
||||||
switch ($Panel) {
|
|
||||||
"WPFPanelControl" {control}
|
|
||||||
"WPFPanelComputer" {compmgmt.msc}
|
|
||||||
"WPFPanelNetwork" {ncpa.cpl}
|
|
||||||
"WPFPanelPower" {powercfg.cpl}
|
|
||||||
"WPFPanelPrinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
|
||||||
"WPFPanelRegion" {intl.cpl}
|
|
||||||
"WPFPanelRestore" {rstrui.exe}
|
|
||||||
"WPFPanelSound" {mmsys.cpl}
|
|
||||||
"WPFPanelSystem" {sysdm.cpl}
|
|
||||||
"WPFPanelTimedate" {timedate.cpl}
|
|
||||||
"WPFPanelUser" {control userpasswords2}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -3,31 +3,14 @@ title: "Control Panel"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```powershell {filename="functions/public/Invoke-WPFControlPanel.ps1",linenos=inline,linenostart=1}
|
```json {filename="config/feature.json",linenos=inline,linenostart=175}
|
||||||
function Invoke-WPFControlPanel {
|
"WPFPanelControl": {
|
||||||
<#
|
"Content": "Control Panel",
|
||||||
|
"category": "Legacy Windows Panels",
|
||||||
.SYNOPSIS
|
"panel": "2",
|
||||||
Opens the requested legacy panel
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
.PARAMETER Panel
|
"InvokeScript": [
|
||||||
The panel to open
|
"control"
|
||||||
|
],
|
||||||
#>
|
|
||||||
param($Panel)
|
|
||||||
|
|
||||||
switch ($Panel) {
|
|
||||||
"WPFPanelControl" {control}
|
|
||||||
"WPFPanelComputer" {compmgmt.msc}
|
|
||||||
"WPFPanelNetwork" {ncpa.cpl}
|
|
||||||
"WPFPanelPower" {powercfg.cpl}
|
|
||||||
"WPFPanelPrinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
|
||||||
"WPFPanelRegion" {intl.cpl}
|
|
||||||
"WPFPanelRestore" {rstrui.exe}
|
|
||||||
"WPFPanelSound" {mmsys.cpl}
|
|
||||||
"WPFPanelSystem" {sysdm.cpl}
|
|
||||||
"WPFPanelTimedate" {timedate.cpl}
|
|
||||||
"WPFPanelUser" {control userpasswords2}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -3,31 +3,14 @@ title: "Network Connections"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```powershell {filename="functions/public/Invoke-WPFControlPanel.ps1",linenos=inline,linenostart=1}
|
```json {filename="config/feature.json",linenos=inline,linenostart=197}
|
||||||
function Invoke-WPFControlPanel {
|
"WPFPanelNetwork": {
|
||||||
<#
|
"Content": "Network Connections",
|
||||||
|
"category": "Legacy Windows Panels",
|
||||||
.SYNOPSIS
|
"panel": "2",
|
||||||
Opens the requested legacy panel
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
.PARAMETER Panel
|
"InvokeScript": [
|
||||||
The panel to open
|
"ncpa.cpl"
|
||||||
|
],
|
||||||
#>
|
|
||||||
param($Panel)
|
|
||||||
|
|
||||||
switch ($Panel) {
|
|
||||||
"WPFPanelControl" {control}
|
|
||||||
"WPFPanelComputer" {compmgmt.msc}
|
|
||||||
"WPFPanelNetwork" {ncpa.cpl}
|
|
||||||
"WPFPanelPower" {powercfg.cpl}
|
|
||||||
"WPFPanelPrinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
|
||||||
"WPFPanelRegion" {intl.cpl}
|
|
||||||
"WPFPanelRestore" {rstrui.exe}
|
|
||||||
"WPFPanelSound" {mmsys.cpl}
|
|
||||||
"WPFPanelSystem" {sysdm.cpl}
|
|
||||||
"WPFPanelTimedate" {timedate.cpl}
|
|
||||||
"WPFPanelUser" {control userpasswords2}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -3,31 +3,14 @@ title: "Power Panel"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```powershell {filename="functions/public/Invoke-WPFControlPanel.ps1",linenos=inline,linenostart=1}
|
```json {filename="config/feature.json",linenos=inline,linenostart=208}
|
||||||
function Invoke-WPFControlPanel {
|
"WPFPanelPower": {
|
||||||
<#
|
"Content": "Power Panel",
|
||||||
|
"category": "Legacy Windows Panels",
|
||||||
.SYNOPSIS
|
"panel": "2",
|
||||||
Opens the requested legacy panel
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
.PARAMETER Panel
|
"InvokeScript": [
|
||||||
The panel to open
|
"powercfg.cpl"
|
||||||
|
],
|
||||||
#>
|
|
||||||
param($Panel)
|
|
||||||
|
|
||||||
switch ($Panel) {
|
|
||||||
"WPFPanelControl" {control}
|
|
||||||
"WPFPanelComputer" {compmgmt.msc}
|
|
||||||
"WPFPanelNetwork" {ncpa.cpl}
|
|
||||||
"WPFPanelPower" {powercfg.cpl}
|
|
||||||
"WPFPanelPrinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
|
||||||
"WPFPanelRegion" {intl.cpl}
|
|
||||||
"WPFPanelRestore" {rstrui.exe}
|
|
||||||
"WPFPanelSound" {mmsys.cpl}
|
|
||||||
"WPFPanelSystem" {sysdm.cpl}
|
|
||||||
"WPFPanelTimedate" {timedate.cpl}
|
|
||||||
"WPFPanelUser" {control userpasswords2}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -3,31 +3,14 @@ title: "Printer Panel"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```powershell {filename="functions/public/Invoke-WPFControlPanel.ps1",linenos=inline,linenostart=1}
|
```json {filename="config/feature.json",linenos=inline,linenostart=219}
|
||||||
function Invoke-WPFControlPanel {
|
"WPFPanelPrinter": {
|
||||||
<#
|
"Content": "Printer Panel",
|
||||||
|
"category": "Legacy Windows Panels",
|
||||||
.SYNOPSIS
|
"panel": "2",
|
||||||
Opens the requested legacy panel
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
.PARAMETER Panel
|
"InvokeScript": [
|
||||||
The panel to open
|
"Start-Process 'shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}'"
|
||||||
|
],
|
||||||
#>
|
|
||||||
param($Panel)
|
|
||||||
|
|
||||||
switch ($Panel) {
|
|
||||||
"WPFPanelControl" {control}
|
|
||||||
"WPFPanelComputer" {compmgmt.msc}
|
|
||||||
"WPFPanelNetwork" {ncpa.cpl}
|
|
||||||
"WPFPanelPower" {powercfg.cpl}
|
|
||||||
"WPFPanelPrinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
|
||||||
"WPFPanelRegion" {intl.cpl}
|
|
||||||
"WPFPanelRestore" {rstrui.exe}
|
|
||||||
"WPFPanelSound" {mmsys.cpl}
|
|
||||||
"WPFPanelSystem" {sysdm.cpl}
|
|
||||||
"WPFPanelTimedate" {timedate.cpl}
|
|
||||||
"WPFPanelUser" {control userpasswords2}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -3,31 +3,14 @@ title: "Region"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```powershell {filename="functions/public/Invoke-WPFControlPanel.ps1",linenos=inline,linenostart=1}
|
```json {filename="config/feature.json",linenos=inline,linenostart=230}
|
||||||
function Invoke-WPFControlPanel {
|
"WPFPanelRegion": {
|
||||||
<#
|
"Content": "Region",
|
||||||
|
"category": "Legacy Windows Panels",
|
||||||
.SYNOPSIS
|
"panel": "2",
|
||||||
Opens the requested legacy panel
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
.PARAMETER Panel
|
"InvokeScript": [
|
||||||
The panel to open
|
"intl.cpl"
|
||||||
|
],
|
||||||
#>
|
|
||||||
param($Panel)
|
|
||||||
|
|
||||||
switch ($Panel) {
|
|
||||||
"WPFPanelControl" {control}
|
|
||||||
"WPFPanelComputer" {compmgmt.msc}
|
|
||||||
"WPFPanelNetwork" {ncpa.cpl}
|
|
||||||
"WPFPanelPower" {powercfg.cpl}
|
|
||||||
"WPFPanelPrinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
|
||||||
"WPFPanelRegion" {intl.cpl}
|
|
||||||
"WPFPanelRestore" {rstrui.exe}
|
|
||||||
"WPFPanelSound" {mmsys.cpl}
|
|
||||||
"WPFPanelSystem" {sysdm.cpl}
|
|
||||||
"WPFPanelTimedate" {timedate.cpl}
|
|
||||||
"WPFPanelUser" {control userpasswords2}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -3,31 +3,14 @@ title: "Windows Restore"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```powershell {filename="functions/public/Invoke-WPFControlPanel.ps1",linenos=inline,linenostart=1}
|
```json {filename="config/feature.json",linenos=inline,linenostart=241}
|
||||||
function Invoke-WPFControlPanel {
|
"WPFPanelRestore": {
|
||||||
<#
|
"Content": "Windows Restore",
|
||||||
|
"category": "Legacy Windows Panels",
|
||||||
.SYNOPSIS
|
"panel": "2",
|
||||||
Opens the requested legacy panel
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
.PARAMETER Panel
|
"InvokeScript": [
|
||||||
The panel to open
|
"rstrui.exe"
|
||||||
|
],
|
||||||
#>
|
|
||||||
param($Panel)
|
|
||||||
|
|
||||||
switch ($Panel) {
|
|
||||||
"WPFPanelControl" {control}
|
|
||||||
"WPFPanelComputer" {compmgmt.msc}
|
|
||||||
"WPFPanelNetwork" {ncpa.cpl}
|
|
||||||
"WPFPanelPower" {powercfg.cpl}
|
|
||||||
"WPFPanelPrinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
|
||||||
"WPFPanelRegion" {intl.cpl}
|
|
||||||
"WPFPanelRestore" {rstrui.exe}
|
|
||||||
"WPFPanelSound" {mmsys.cpl}
|
|
||||||
"WPFPanelSystem" {sysdm.cpl}
|
|
||||||
"WPFPanelTimedate" {timedate.cpl}
|
|
||||||
"WPFPanelUser" {control userpasswords2}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -3,31 +3,14 @@ title: "Sound Settings"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```powershell {filename="functions/public/Invoke-WPFControlPanel.ps1",linenos=inline,linenostart=1}
|
```json {filename="config/feature.json",linenos=inline,linenostart=252}
|
||||||
function Invoke-WPFControlPanel {
|
"WPFPanelSound": {
|
||||||
<#
|
"Content": "Sound Settings",
|
||||||
|
"category": "Legacy Windows Panels",
|
||||||
.SYNOPSIS
|
"panel": "2",
|
||||||
Opens the requested legacy panel
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
.PARAMETER Panel
|
"InvokeScript": [
|
||||||
The panel to open
|
"mmsys.cpl"
|
||||||
|
],
|
||||||
#>
|
|
||||||
param($Panel)
|
|
||||||
|
|
||||||
switch ($Panel) {
|
|
||||||
"WPFPanelControl" {control}
|
|
||||||
"WPFPanelComputer" {compmgmt.msc}
|
|
||||||
"WPFPanelNetwork" {ncpa.cpl}
|
|
||||||
"WPFPanelPower" {powercfg.cpl}
|
|
||||||
"WPFPanelPrinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
|
||||||
"WPFPanelRegion" {intl.cpl}
|
|
||||||
"WPFPanelRestore" {rstrui.exe}
|
|
||||||
"WPFPanelSound" {mmsys.cpl}
|
|
||||||
"WPFPanelSystem" {sysdm.cpl}
|
|
||||||
"WPFPanelTimedate" {timedate.cpl}
|
|
||||||
"WPFPanelUser" {control userpasswords2}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -3,31 +3,14 @@ title: "System Properties"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```powershell {filename="functions/public/Invoke-WPFControlPanel.ps1",linenos=inline,linenostart=1}
|
```json {filename="config/feature.json",linenos=inline,linenostart=263}
|
||||||
function Invoke-WPFControlPanel {
|
"WPFPanelSystem": {
|
||||||
<#
|
"Content": "System Properties",
|
||||||
|
"category": "Legacy Windows Panels",
|
||||||
.SYNOPSIS
|
"panel": "2",
|
||||||
Opens the requested legacy panel
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
.PARAMETER Panel
|
"InvokeScript": [
|
||||||
The panel to open
|
"sysdm.cpl"
|
||||||
|
],
|
||||||
#>
|
|
||||||
param($Panel)
|
|
||||||
|
|
||||||
switch ($Panel) {
|
|
||||||
"WPFPanelControl" {control}
|
|
||||||
"WPFPanelComputer" {compmgmt.msc}
|
|
||||||
"WPFPanelNetwork" {ncpa.cpl}
|
|
||||||
"WPFPanelPower" {powercfg.cpl}
|
|
||||||
"WPFPanelPrinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
|
||||||
"WPFPanelRegion" {intl.cpl}
|
|
||||||
"WPFPanelRestore" {rstrui.exe}
|
|
||||||
"WPFPanelSound" {mmsys.cpl}
|
|
||||||
"WPFPanelSystem" {sysdm.cpl}
|
|
||||||
"WPFPanelTimedate" {timedate.cpl}
|
|
||||||
"WPFPanelUser" {control userpasswords2}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -3,31 +3,14 @@ title: "Time and Date"
|
|||||||
description: ""
|
description: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
```powershell {filename="functions/public/Invoke-WPFControlPanel.ps1",linenos=inline,linenostart=1}
|
```json {filename="config/feature.json",linenos=inline,linenostart=274}
|
||||||
function Invoke-WPFControlPanel {
|
"WPFPanelTimedate": {
|
||||||
<#
|
"Content": "Time and Date",
|
||||||
|
"category": "Legacy Windows Panels",
|
||||||
.SYNOPSIS
|
"panel": "2",
|
||||||
Opens the requested legacy panel
|
"Type": "Button",
|
||||||
|
"ButtonWidth": "300",
|
||||||
.PARAMETER Panel
|
"InvokeScript": [
|
||||||
The panel to open
|
"timedate.cpl"
|
||||||
|
],
|
||||||
#>
|
|
||||||
param($Panel)
|
|
||||||
|
|
||||||
switch ($Panel) {
|
|
||||||
"WPFPanelControl" {control}
|
|
||||||
"WPFPanelComputer" {compmgmt.msc}
|
|
||||||
"WPFPanelNetwork" {ncpa.cpl}
|
|
||||||
"WPFPanelPower" {powercfg.cpl}
|
|
||||||
"WPFPanelPrinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
|
||||||
"WPFPanelRegion" {intl.cpl}
|
|
||||||
"WPFPanelRestore" {rstrui.exe}
|
|
||||||
"WPFPanelSound" {mmsys.cpl}
|
|
||||||
"WPFPanelSystem" {sysdm.cpl}
|
|
||||||
"WPFPanelTimedate" {timedate.cpl}
|
|
||||||
"WPFPanelUser" {control userpasswords2}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "Install CTT PowerShell Profile"
|
||||||
|
description: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
```powershell {filename="functions/private/Invoke-WinUtilInstallPSProfile.ps1",linenos=inline,linenostart=1}
|
||||||
|
function Invoke-WinUtilInstallPSProfile {
|
||||||
|
|
||||||
|
if (Test-Path $Profile) {
|
||||||
|
Rename-Item $Profile -NewName ($Profile + '.bak')
|
||||||
|
}
|
||||||
|
|
||||||
|
Start-Process pwsh -ArgumentList '-Command "irm https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1 | iex"'
|
||||||
|
}
|
||||||
|
```
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
title: "Uninstall CTT PowerShell Profile"
|
||||||
|
description: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
```powershell {filename="functions/private/Invoke-WinUtilUninstallPSProfile.ps1",linenos=inline,linenostart=1}
|
||||||
|
function Invoke-WinUtilUninstallPSProfile {
|
||||||
|
if (Test-Path ($Profile + '.bak')) {
|
||||||
|
Remove-Item $Profile
|
||||||
|
Rename-Item ($Profile + '.bak') -NewName $Profile
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Remove-Item $Profile
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Successfully uninstalled CTT Powershell Profile" -ForegroundColor Green
|
||||||
|
}
|
||||||
|
```
|
||||||
24
docs/content/dev/features/Remote-Access/SSHServer.md
Normal file
24
docs/content/dev/features/Remote-Access/SSHServer.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
title: "Enable OpenSSH Server"
|
||||||
|
description: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
```powershell {filename="functions/public/Invoke-WPFSSHServer.ps1",linenos=inline,linenostart=1}
|
||||||
|
function Invoke-WPFSSHServer {
|
||||||
|
<#
|
||||||
|
|
||||||
|
.SYNOPSIS
|
||||||
|
Invokes the OpenSSH Server install in a runspace
|
||||||
|
|
||||||
|
#>
|
||||||
|
|
||||||
|
Invoke-WPFRunspace -ScriptBlock {
|
||||||
|
|
||||||
|
Invoke-WinUtilSSHServer
|
||||||
|
|
||||||
|
Write-Host "======================================="
|
||||||
|
Write-Host "-- OpenSSH Server installed! ---"
|
||||||
|
Write-Host "======================================="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
@@ -6,7 +6,7 @@ description: ""
|
|||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=2616}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=2616}
|
||||||
"WPFTweaksDisableExplorerAutoDiscovery": {
|
"WPFTweaksDisableExplorerAutoDiscovery": {
|
||||||
"Content": "Disable Explorer Automatic Folder Discovery",
|
"Content": "Disable Explorer Automatic Folder Discovery",
|
||||||
"Description": "Windows Explorer automatically tries to guess the type of the folder based on its contents, slowing down the browsing experience.",
|
"Description": "Windows Explorer automatically tries to guess the type of the folder based on its contents, slowing down the browsing experience. WARNING! Will disable file explorer grouping",
|
||||||
"category": "Essential Tweaks",
|
"category": "Essential Tweaks",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
|
|||||||
@@ -967,46 +967,3 @@ description: ""
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
```
|
```
|
||||||
#Function
|
|
||||||
```powershell {filename="functions/private/Set-WinUtilService.ps1",linenos=inline,linenostart=1}
|
|
||||||
Function Set-WinUtilService {
|
|
||||||
<#
|
|
||||||
|
|
||||||
.SYNOPSIS
|
|
||||||
Changes the startup type of the given service
|
|
||||||
|
|
||||||
.PARAMETER Name
|
|
||||||
The name of the service to modify
|
|
||||||
|
|
||||||
.PARAMETER StartupType
|
|
||||||
The startup type to set the service to
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
Set-WinUtilService -Name "HomeGroupListener" -StartupType "Manual"
|
|
||||||
|
|
||||||
#>
|
|
||||||
param (
|
|
||||||
$Name,
|
|
||||||
$StartupType
|
|
||||||
)
|
|
||||||
try {
|
|
||||||
Write-Host "Setting Service $Name to $StartupType"
|
|
||||||
|
|
||||||
# Check if the service exists
|
|
||||||
$service = Get-Service -Name $Name -ErrorAction Stop
|
|
||||||
|
|
||||||
# Service exists, proceed with changing properties -- while handling auto delayed start for PWSH 5
|
|
||||||
if (($PSVersionTable.PSVersion.Major -lt 7) -and ($StartupType -eq "AutomaticDelayedStart")) {
|
|
||||||
sc.exe config $Name start=delayed-auto
|
|
||||||
} else {
|
|
||||||
$service | Set-Service -StartupType $StartupType -ErrorAction Stop
|
|
||||||
}
|
|
||||||
} catch [System.ServiceProcess.ServiceNotFoundException] {
|
|
||||||
Write-Warning "Service $Name was not found"
|
|
||||||
} catch {
|
|
||||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
|
||||||
Write-Warning $_.Exception.Message
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: ""
|
|||||||
```json {filename="config/tweaks.json",linenos=inline,linenostart=1908}
|
```json {filename="config/tweaks.json",linenos=inline,linenostart=1908}
|
||||||
"WPFTweaksRazerBlock": {
|
"WPFTweaksRazerBlock": {
|
||||||
"Content": "Block Razer Software Installs",
|
"Content": "Block Razer Software Installs",
|
||||||
"Description": "Blocks ALL Razer Software installations. The hardware works fine without any software. WARNING: this will also block all Windows third-party driver installations.",
|
"Description": "Blocks ALL Razer Software installations. The hardware works fine without any software.",
|
||||||
"category": "z__Advanced Tweaks - CAUTION",
|
"category": "z__Advanced Tweaks - CAUTION",
|
||||||
"panel": "1",
|
"panel": "1",
|
||||||
"registry": [
|
"registry": [
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ function Write-Win11ISOLog {
|
|||||||
} else {
|
} else {
|
||||||
$sync["WPFWin11ISOStatusLog"].Text += "`n[$timestamp] $Message"
|
$sync["WPFWin11ISOStatusLog"].Text += "`n[$timestamp] $Message"
|
||||||
}
|
}
|
||||||
|
$sync["WPFWin11ISOStatusLog"].CaretIndex = $sync["WPFWin11ISOStatusLog"].Text.Length
|
||||||
$sync["WPFWin11ISOStatusLog"].ScrollToEnd()
|
$sync["WPFWin11ISOStatusLog"].ScrollToEnd()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -98,10 +99,10 @@ function Invoke-WinUtilISOMountAndVerify {
|
|||||||
# ── Read edition / architecture info ──
|
# ── Read edition / architecture info ──
|
||||||
Set-WinUtilProgressBar -Label "Reading image metadata..." -Percent 55
|
Set-WinUtilProgressBar -Label "Reading image metadata..." -Percent 55
|
||||||
|
|
||||||
$editions = Get-WindowsImage -ImagePath $activeWim | Select-Object -ExpandProperty ImageName
|
$imageInfo = Get-WindowsImage -ImagePath $activeWim | Select-Object ImageIndex, ImageName
|
||||||
|
|
||||||
# ── Verify at least one Win11 edition is present ──
|
# ── Verify at least one Win11 edition is present ──
|
||||||
$isWin11 = $editions | Where-Object { $_ -match "Windows 11" }
|
$isWin11 = $imageInfo | Where-Object { $_.ImageName -match "Windows 11" }
|
||||||
if (-not $isWin11) {
|
if (-not $isWin11) {
|
||||||
Dismount-DiskImage -ImagePath $isoPath | Out-Null
|
Dismount-DiskImage -ImagePath $isoPath | Out-Null
|
||||||
Write-Win11ISOLog "ERROR: No 'Windows 11' edition found in the image."
|
Write-Win11ISOLog "ERROR: No 'Windows 11' edition found in the image."
|
||||||
@@ -112,9 +113,20 @@ function Invoke-WinUtilISOMountAndVerify {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Store edition info for later index lookup
|
||||||
|
$sync["Win11ISOImageInfo"] = $imageInfo
|
||||||
|
|
||||||
# ── Populate UI ──
|
# ── Populate UI ──
|
||||||
$sync["WPFWin11ISOMountDriveLetter"].Text = "Mounted at: $driveLetter | Image file: $(Split-Path $activeWim -Leaf)"
|
$sync["WPFWin11ISOMountDriveLetter"].Text = "Mounted at: $driveLetter | Image file: $(Split-Path $activeWim -Leaf)"
|
||||||
$sync["WPFWin11ISOEditionList"].Text = ($editions -join "`n")
|
$sync["WPFWin11ISOEditionComboBox"].Dispatcher.Invoke([action]{
|
||||||
|
$sync["WPFWin11ISOEditionComboBox"].Items.Clear()
|
||||||
|
foreach ($img in $imageInfo) {
|
||||||
|
[void]$sync["WPFWin11ISOEditionComboBox"].Items.Add("$($img.ImageIndex): $($img.ImageName)")
|
||||||
|
}
|
||||||
|
if ($sync["WPFWin11ISOEditionComboBox"].Items.Count -gt 0) {
|
||||||
|
$sync["WPFWin11ISOEditionComboBox"].SelectedIndex = 0
|
||||||
|
}
|
||||||
|
})
|
||||||
$sync["WPFWin11ISOVerifyResultPanel"].Visibility = "Visible"
|
$sync["WPFWin11ISOVerifyResultPanel"].Visibility = "Visible"
|
||||||
|
|
||||||
# Store for later steps
|
# Store for later steps
|
||||||
@@ -126,7 +138,7 @@ function Invoke-WinUtilISOMountAndVerify {
|
|||||||
$sync["WPFWin11ISOModifySection"].Visibility = "Visible"
|
$sync["WPFWin11ISOModifySection"].Visibility = "Visible"
|
||||||
|
|
||||||
Set-WinUtilProgressBar -Label "ISO verified ✔" -Percent 100
|
Set-WinUtilProgressBar -Label "ISO verified ✔" -Percent 100
|
||||||
Write-Win11ISOLog "ISO verified OK. Editions found: $($editions.Count)"
|
Write-Win11ISOLog "ISO verified OK. Editions found: $($imageInfo.Count)"
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Win11ISOLog "ERROR during mount/verify: $_"
|
Write-Win11ISOLog "ERROR during mount/verify: $_"
|
||||||
@@ -162,10 +174,41 @@ function Invoke-WinUtilISOModify {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ── Resolve selected edition index from the ComboBox ──
|
||||||
|
$selectedItem = $sync["WPFWin11ISOEditionComboBox"].SelectedItem
|
||||||
|
$selectedWimIndex = 1 # default fallback
|
||||||
|
if ($selectedItem -and $selectedItem -match '^(\d+):') {
|
||||||
|
$selectedWimIndex = [int]$Matches[1]
|
||||||
|
} elseif ($sync["Win11ISOImageInfo"]) {
|
||||||
|
$selectedWimIndex = $sync["Win11ISOImageInfo"][0].ImageIndex
|
||||||
|
}
|
||||||
|
$selectedEditionName = if ($selectedItem) { ($selectedItem -replace '^\d+:\s*', '') } else { "Unknown" }
|
||||||
|
Write-Win11ISOLog "Selected edition: $selectedEditionName (Index $selectedWimIndex)"
|
||||||
|
|
||||||
# Disable the modify button to prevent double-click
|
# Disable the modify button to prevent double-click
|
||||||
$sync["WPFWin11ISOModifyButton"].IsEnabled = $false
|
$sync["WPFWin11ISOModifyButton"].IsEnabled = $false
|
||||||
|
|
||||||
$workDir = Join-Path $env:TEMP "WinUtil_Win11ISO_$(Get-Date -Format 'yyyyMMdd_HHmmss')"
|
$existingWorkDir = Get-Item -Path (Join-Path $env:TEMP "WinUtil_Win11ISO*") -ErrorAction SilentlyContinue |
|
||||||
|
Where-Object { $_.PSIsContainer } |
|
||||||
|
Sort-Object LastWriteTime -Descending |
|
||||||
|
Select-Object -First 1
|
||||||
|
|
||||||
|
$workDir = if ($existingWorkDir) {
|
||||||
|
Write-Win11ISOLog "Reusing existing temp directory: $($existingWorkDir.FullName)"
|
||||||
|
$existingWorkDir.FullName
|
||||||
|
} else {
|
||||||
|
Join-Path $env:TEMP "WinUtil_Win11ISO_$(Get-Date -Format 'yyyyMMdd_HHmmss')"
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── Resolve autounattend.xml content ──────────────────────────────────────
|
||||||
|
# Compiled winutil.ps1 sets $WinUtilAutounattendXml before main.ps1 runs.
|
||||||
|
# In dev/source mode fall back to reading tools\autounattend.xml directly.
|
||||||
|
$autounattendContent = if ($WinUtilAutounattendXml) {
|
||||||
|
$WinUtilAutounattendXml
|
||||||
|
} else {
|
||||||
|
$toolsXml = Join-Path $PSScriptRoot "..\..\tools\autounattend.xml"
|
||||||
|
if (Test-Path $toolsXml) { Get-Content $toolsXml -Raw } else { "" }
|
||||||
|
}
|
||||||
|
|
||||||
# ── Run modification in a background runspace ──
|
# ── Run modification in a background runspace ──
|
||||||
$runspace = [Management.Automation.Runspaces.RunspaceFactory]::CreateRunspace()
|
$runspace = [Management.Automation.Runspaces.RunspaceFactory]::CreateRunspace()
|
||||||
@@ -177,6 +220,9 @@ function Invoke-WinUtilISOModify {
|
|||||||
$runspace.SessionStateProxy.SetVariable("driveLetter", $driveLetter)
|
$runspace.SessionStateProxy.SetVariable("driveLetter", $driveLetter)
|
||||||
$runspace.SessionStateProxy.SetVariable("wimPath", $wimPath)
|
$runspace.SessionStateProxy.SetVariable("wimPath", $wimPath)
|
||||||
$runspace.SessionStateProxy.SetVariable("workDir", $workDir)
|
$runspace.SessionStateProxy.SetVariable("workDir", $workDir)
|
||||||
|
$runspace.SessionStateProxy.SetVariable("selectedWimIndex", $selectedWimIndex)
|
||||||
|
$runspace.SessionStateProxy.SetVariable("selectedEditionName", $selectedEditionName)
|
||||||
|
$runspace.SessionStateProxy.SetVariable("autounattendContent", $autounattendContent)
|
||||||
|
|
||||||
# Serialize functions so they are available inside the runspace
|
# Serialize functions so they are available inside the runspace
|
||||||
$isoScriptFuncDef = "function Invoke-WinUtilISOScript {`n" + `
|
$isoScriptFuncDef = "function Invoke-WinUtilISOScript {`n" + `
|
||||||
@@ -204,6 +250,7 @@ function Invoke-WinUtilISOModify {
|
|||||||
$ts = (Get-Date).ToString("HH:mm:ss")
|
$ts = (Get-Date).ToString("HH:mm:ss")
|
||||||
$sync["WPFWin11ISOStatusLog"].Dispatcher.Invoke([action]{
|
$sync["WPFWin11ISOStatusLog"].Dispatcher.Invoke([action]{
|
||||||
$sync["WPFWin11ISOStatusLog"].Text += "`n[$ts] $msg"
|
$sync["WPFWin11ISOStatusLog"].Text += "`n[$ts] $msg"
|
||||||
|
$sync["WPFWin11ISOStatusLog"].CaretIndex = $sync["WPFWin11ISOStatusLog"].Text.Length
|
||||||
$sync["WPFWin11ISOStatusLog"].ScrollToEnd()
|
$sync["WPFWin11ISOStatusLog"].ScrollToEnd()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -217,6 +264,27 @@ function Invoke-WinUtilISOModify {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
# ── Hide Steps 1-3 while modification is running; expand log to fill screen ──
|
||||||
|
$sync["WPFWin11ISOStatusLog"].Dispatcher.Invoke([action]{
|
||||||
|
$sync["WPFWin11ISOSelectSection"].Visibility = "Collapsed"
|
||||||
|
$sync["WPFWin11ISOMountSection"].Visibility = "Collapsed"
|
||||||
|
$sync["WPFWin11ISOModifySection"].Visibility = "Collapsed"
|
||||||
|
$expandedHeight = [Math]::Max(400, $sync["Form"].ActualHeight - 100)
|
||||||
|
$sync["WPFWin11ISOStatusLog"].Height = $expandedHeight
|
||||||
|
$sync["Win11ISOLogExpanded"] = $true
|
||||||
|
# Register the resize handler once so the log tracks window resizes
|
||||||
|
if (-not $sync["Win11ISOResizeHandlerAdded"]) {
|
||||||
|
$sync["Form"].add_SizeChanged({
|
||||||
|
if ($sync["Win11ISOLogExpanded"]) {
|
||||||
|
$sync["WPFWin11ISOStatusLog"].Height = [Math]::Max(400, $sync["Form"].ActualHeight - 100)
|
||||||
|
$sync["WPFWin11ISOStatusLog"].CaretIndex = $sync["WPFWin11ISOStatusLog"].Text.Length
|
||||||
|
$sync["WPFWin11ISOStatusLog"].ScrollToEnd()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
$sync["Win11ISOResizeHandlerAdded"] = $true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
# ── 1. Create working directory structure ──
|
# ── 1. Create working directory structure ──
|
||||||
Log "Creating working directory: $workDir"
|
Log "Creating working directory: $workDir"
|
||||||
$isoContents = Join-Path $workDir "iso_contents"
|
$isoContents = Join-Path $workDir "iso_contents"
|
||||||
@@ -240,20 +308,47 @@ function Invoke-WinUtilISOModify {
|
|||||||
# Ensure the file is writable
|
# Ensure the file is writable
|
||||||
Set-ItemProperty -Path $localWim -Name IsReadOnly -Value $false
|
Set-ItemProperty -Path $localWim -Name IsReadOnly -Value $false
|
||||||
|
|
||||||
# ── 4. Mount the first index of install.wim ──
|
# ── 4. Mount the selected edition of install.wim ──
|
||||||
Log "Mounting install.wim (Index 1) at $mountDir..."
|
Log "Mounting install.wim (Index ${selectedWimIndex}: $selectedEditionName) at $mountDir..."
|
||||||
Mount-WindowsImage -ImagePath $localWim -Index 1 -Path $mountDir -ErrorAction Stop | Out-Null
|
Mount-WindowsImage -ImagePath $localWim -Index $selectedWimIndex -Path $mountDir -ErrorAction Stop | Out-Null
|
||||||
SetProgress "Modifying install.wim..." 45
|
SetProgress "Modifying install.wim..." 45
|
||||||
|
|
||||||
# ── Apply all WinUtil modifications via Invoke-WinUtilISOScript ──
|
# ── Apply all WinUtil modifications via Invoke-WinUtilISOScript ──
|
||||||
Log "Applying WinUtil modifications to install.wim..."
|
Log "Applying WinUtil modifications to install.wim..."
|
||||||
Invoke-WinUtilISOScript -ScratchDir $mountDir -Log { param($m) Log $m }
|
Invoke-WinUtilISOScript -ScratchDir $mountDir -ISOContentsDir $isoContents -AutoUnattendXml $autounattendContent -Log { param($m) Log $m }
|
||||||
|
|
||||||
|
# ── 4b. DISM component store cleanup ──
|
||||||
|
# /ResetBase removes all superseded component versions from WinSxS,
|
||||||
|
# which is the single largest space saving possible (typically 300–800 MB).
|
||||||
|
# This must be done while the image is still mounted.
|
||||||
|
SetProgress "Cleaning up component store (WinSxS)..." 56
|
||||||
|
Log "Running DISM component store cleanup (/ResetBase)..."
|
||||||
|
& dism /English "/image:$mountDir" /Cleanup-Image /StartComponentCleanup /ResetBase | ForEach-Object { Log $_ }
|
||||||
|
Log "Component store cleanup complete."
|
||||||
|
|
||||||
# ── 5. Save and dismount the WIM ──
|
# ── 5. Save and dismount the WIM ──
|
||||||
SetProgress "Saving modified install.wim..." 65
|
SetProgress "Saving modified install.wim..." 65
|
||||||
Log "Dismounting and saving install.wim..."
|
Log "Dismounting and saving install.wim. This will take several minutes..."
|
||||||
Dismount-WindowsImage -Path $mountDir -Save -ErrorAction Stop | Out-Null
|
Dismount-WindowsImage -Path $mountDir -Save -ErrorAction Stop | Out-Null
|
||||||
Log "install.wim saved."
|
Log "install.wim saved."
|
||||||
|
|
||||||
|
# ── 5b. Strip unused editions — export only the selected index ──
|
||||||
|
# A standard multi-edition install.wim can be 4–5 GB; exporting a
|
||||||
|
# single index typically drops it to ~3 GB, saving 1–2 GB in the ISO.
|
||||||
|
SetProgress "Removing unused editions from install.wim..." 70
|
||||||
|
Log "Exporting edition '$selectedEditionName' (Index $selectedWimIndex) to a single-edition install.wim..."
|
||||||
|
$exportWim = Join-Path $isoContents "sources\install_export.wim"
|
||||||
|
Export-WindowsImage `
|
||||||
|
-SourceImagePath $localWim `
|
||||||
|
-SourceIndex $selectedWimIndex `
|
||||||
|
-DestinationImagePath $exportWim `
|
||||||
|
-ErrorAction Stop | Out-Null
|
||||||
|
Remove-Item -Path $localWim -Force
|
||||||
|
Rename-Item -Path $exportWim -NewName "install.wim" -Force
|
||||||
|
# Update local path so later steps (e.g. ISO build) reference the new file
|
||||||
|
$localWim = Join-Path $isoContents "sources\install.wim"
|
||||||
|
Log "Unused editions removed. install.wim now contains only '$selectedEditionName'."
|
||||||
|
|
||||||
SetProgress "Dismounting source ISO..." 80
|
SetProgress "Dismounting source ISO..." 80
|
||||||
|
|
||||||
# ── 6. Dismount the original ISO ──
|
# ── 6. Dismount the original ISO ──
|
||||||
@@ -265,16 +360,54 @@ function Invoke-WinUtilISOModify {
|
|||||||
$sync["Win11ISOContentsDir"] = $isoContents
|
$sync["Win11ISOContentsDir"] = $isoContents
|
||||||
|
|
||||||
SetProgress "Modification complete ✔" 100
|
SetProgress "Modification complete ✔" 100
|
||||||
Log "install.wim modification complete. Select an output option in Step 4."
|
Log "install.wim modification complete. Choose an output option in Step 4."
|
||||||
|
|
||||||
# ── Reveal Step 4 on the UI thread ──
|
# ── Reveal Step 4 on the UI thread ──
|
||||||
|
# Note: USB drive enumeration (Get-Disk) is intentionally deferred to
|
||||||
|
# when the user explicitly selects the USB option, to avoid blocking
|
||||||
|
# the UI thread here.
|
||||||
$sync["WPFWin11ISOOutputSection"].Dispatcher.Invoke([action]{
|
$sync["WPFWin11ISOOutputSection"].Dispatcher.Invoke([action]{
|
||||||
$sync["WPFWin11ISOOutputSection"].Visibility = "Visible"
|
$sync["WPFWin11ISOOutputSection"].Visibility = "Visible"
|
||||||
Invoke-WinUtilISORefreshUSBDrives
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Log "ERROR during modification: $_"
|
Log "ERROR during modification: $_"
|
||||||
|
|
||||||
|
# ── Cleanup: dismount WIM if still mounted ──
|
||||||
|
try {
|
||||||
|
if (Test-Path $mountDir) {
|
||||||
|
$mountedImages = Get-WindowsImage -Mounted -ErrorAction SilentlyContinue |
|
||||||
|
Where-Object { $_.Path -eq $mountDir }
|
||||||
|
if ($mountedImages) {
|
||||||
|
Log "Cleaning up: dismounting install.wim (discarding changes)..."
|
||||||
|
Dismount-WindowsImage -Path $mountDir -Discard -ErrorAction SilentlyContinue | Out-Null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Log "Warning: could not dismount install.wim during cleanup: $_"
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── Cleanup: dismount the source ISO ──
|
||||||
|
try {
|
||||||
|
$mountedISO = Get-DiskImage -ImagePath $isoPath -ErrorAction SilentlyContinue
|
||||||
|
if ($mountedISO -and $mountedISO.Attached) {
|
||||||
|
Log "Cleaning up: dismounting source ISO..."
|
||||||
|
Dismount-DiskImage -ImagePath $isoPath -ErrorAction SilentlyContinue | Out-Null
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Log "Warning: could not dismount ISO during cleanup: $_"
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── Cleanup: remove temp working directory ──
|
||||||
|
try {
|
||||||
|
if (Test-Path $workDir) {
|
||||||
|
Log "Cleaning up: removing temp directory $workDir..."
|
||||||
|
Remove-Item -Path $workDir -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Log "Warning: could not remove temp directory during cleanup: $_"
|
||||||
|
}
|
||||||
|
|
||||||
$sync["WPFWin11ISOStatusLog"].Dispatcher.Invoke([action]{
|
$sync["WPFWin11ISOStatusLog"].Dispatcher.Invoke([action]{
|
||||||
[System.Windows.MessageBox]::Show(
|
[System.Windows.MessageBox]::Show(
|
||||||
"An error occurred during install.wim modification:`n`n$_",
|
"An error occurred during install.wim modification:`n`n$_",
|
||||||
@@ -288,6 +421,16 @@ function Invoke-WinUtilISOModify {
|
|||||||
$sync.progressBarTextBlock.ToolTip = ""
|
$sync.progressBarTextBlock.ToolTip = ""
|
||||||
$sync.ProgressBar.Value = 0
|
$sync.ProgressBar.Value = 0
|
||||||
$sync["WPFWin11ISOModifyButton"].IsEnabled = $true
|
$sync["WPFWin11ISOModifyButton"].IsEnabled = $true
|
||||||
|
# ── Only restore steps 1-3 if Step 4 was NOT successfully shown ──
|
||||||
|
# When modification succeeds, Step 4 is visible and steps 1-3 stay
|
||||||
|
# hidden until the user clicks Clean & Reset.
|
||||||
|
if ($sync["WPFWin11ISOOutputSection"].Visibility -ne "Visible") {
|
||||||
|
$sync["WPFWin11ISOSelectSection"].Visibility = "Visible"
|
||||||
|
$sync["WPFWin11ISOMountSection"].Visibility = "Visible"
|
||||||
|
$sync["WPFWin11ISOModifySection"].Visibility = "Visible"
|
||||||
|
}
|
||||||
|
$sync["Win11ISOLogExpanded"] = $false
|
||||||
|
$sync["WPFWin11ISOStatusLog"].Height = 140
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}) | Out-Null
|
}) | Out-Null
|
||||||
@@ -295,6 +438,53 @@ function Invoke-WinUtilISOModify {
|
|||||||
$script.BeginInvoke() | Out-Null
|
$script.BeginInvoke() | Out-Null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Invoke-WinUtilISOCleanAndReset {
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Deletes the temporary working directory created during ISO modification
|
||||||
|
and resets the entire ISO UI back to its initial state (Step 1 only).
|
||||||
|
#>
|
||||||
|
|
||||||
|
$workDir = $sync["Win11ISOWorkDir"]
|
||||||
|
|
||||||
|
if ($workDir -and (Test-Path $workDir)) {
|
||||||
|
$confirm = [System.Windows.MessageBox]::Show(
|
||||||
|
"This will delete the temporary working directory:`n`n$workDir`n`nAnd reset the interface back to the start.`n`nContinue?",
|
||||||
|
"Clean & Reset", "YesNo", "Warning")
|
||||||
|
if ($confirm -ne "Yes") { return }
|
||||||
|
|
||||||
|
try {
|
||||||
|
Write-Win11ISOLog "Deleting temp directory: $workDir"
|
||||||
|
Remove-Item -Path $workDir -Recurse -Force -ErrorAction Stop
|
||||||
|
Write-Win11ISOLog "Temp directory deleted."
|
||||||
|
} catch {
|
||||||
|
Write-Win11ISOLog "WARNING: could not fully delete temp directory: $_"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Clear all stored ISO state
|
||||||
|
$sync["Win11ISOWorkDir"] = $null
|
||||||
|
$sync["Win11ISOContentsDir"] = $null
|
||||||
|
$sync["Win11ISOImagePath"] = $null
|
||||||
|
$sync["Win11ISODriveLetter"] = $null
|
||||||
|
$sync["Win11ISOWimPath"] = $null
|
||||||
|
$sync["Win11ISOImageInfo"] = $null
|
||||||
|
$sync["Win11ISOUSBDisks"] = $null
|
||||||
|
|
||||||
|
# Reset the UI to the initial state
|
||||||
|
$sync["WPFWin11ISOPath"].Text = "No ISO selected..."
|
||||||
|
$sync["WPFWin11ISOFileInfo"].Visibility = "Collapsed"
|
||||||
|
$sync["WPFWin11ISOVerifyResultPanel"].Visibility = "Collapsed"
|
||||||
|
$sync["WPFWin11ISOOptionUSB"].Visibility = "Collapsed"
|
||||||
|
$sync["WPFWin11ISOOutputSection"].Visibility = "Collapsed"
|
||||||
|
$sync["WPFWin11ISOModifySection"].Visibility = "Collapsed"
|
||||||
|
$sync["WPFWin11ISOMountSection"].Visibility = "Collapsed"
|
||||||
|
$sync["WPFWin11ISOSelectSection"].Visibility = "Visible"
|
||||||
|
$sync["WPFWin11ISOStatusLog"].Text = "Ready. Please select a Windows 11 ISO to begin."
|
||||||
|
$sync["WPFWin11ISOStatusLog"].Height = 140
|
||||||
|
$sync["WPFWin11ISOModifyButton"].IsEnabled = $true
|
||||||
|
}
|
||||||
|
|
||||||
function Invoke-WinUtilISOExport {
|
function Invoke-WinUtilISOExport {
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
@@ -329,14 +519,30 @@ function Invoke-WinUtilISOExport {
|
|||||||
$oscdimg = Get-ChildItem "C:\Program Files (x86)\Windows Kits" -Recurse -Filter "oscdimg.exe" -ErrorAction SilentlyContinue |
|
$oscdimg = Get-ChildItem "C:\Program Files (x86)\Windows Kits" -Recurse -Filter "oscdimg.exe" -ErrorAction SilentlyContinue |
|
||||||
Select-Object -First 1 -ExpandProperty FullName
|
Select-Object -First 1 -ExpandProperty FullName
|
||||||
|
|
||||||
|
if (-not $oscdimg) {
|
||||||
|
Write-Win11ISOLog "oscdimg.exe not found. Attempting to install via winget..."
|
||||||
|
Set-WinUtilProgressBar -Label "Installing oscdimg..." -Percent 5
|
||||||
|
try {
|
||||||
|
$winget = Get-Command winget -ErrorAction Stop
|
||||||
|
$result = & $winget install -e --id Microsoft.OSCDIMG --accept-package-agreements --accept-source-agreements 2>&1
|
||||||
|
Write-Win11ISOLog "winget output: $result"
|
||||||
|
# Re-scan for oscdimg after install
|
||||||
|
$oscdimg = Get-ChildItem "C:\Program Files (x86)\Windows Kits" -Recurse -Filter "oscdimg.exe" -ErrorAction SilentlyContinue |
|
||||||
|
Select-Object -First 1 -ExpandProperty FullName
|
||||||
|
} catch {
|
||||||
|
Write-Win11ISOLog "winget not available or install failed: $_"
|
||||||
|
}
|
||||||
|
|
||||||
if (-not $oscdimg) {
|
if (-not $oscdimg) {
|
||||||
Set-WinUtilProgressBar -Label "" -Percent 0
|
Set-WinUtilProgressBar -Label "" -Percent 0
|
||||||
Write-Win11ISOLog "oscdimg.exe not found. Install Windows ADK to enable ISO export."
|
Write-Win11ISOLog "oscdimg.exe still not found after install attempt."
|
||||||
[System.Windows.MessageBox]::Show(
|
[System.Windows.MessageBox]::Show(
|
||||||
"oscdimg.exe was not found.`n`nTo export an ISO you need the Windows Assessment and Deployment Kit (ADK).`n`nDownload it from: https://learn.microsoft.com/windows-hardware/get-started/adk-install",
|
"oscdimg.exe could not be found or installed automatically.`n`nPlease install it manually:`n winget install -e --id Microsoft.OSCDIMG`n`nOr install the Windows ADK from:`nhttps://learn.microsoft.com/windows-hardware/get-started/adk-install",
|
||||||
"Windows ADK Required", "OK", "Warning")
|
"oscdimg Not Found", "OK", "Warning")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Write-Win11ISOLog "oscdimg.exe installed successfully."
|
||||||
|
}
|
||||||
|
|
||||||
# Build boot parameters (BIOS + UEFI dual-boot)
|
# Build boot parameters (BIOS + UEFI dual-boot)
|
||||||
$bootData = "2#p0,e,b`"$contentsDir\boot\etfsboot.com`"#pEF,e,b`"$contentsDir\efi\microsoft\boot\efisys.bin`""
|
$bootData = "2#p0,e,b`"$contentsDir\boot\etfsboot.com`"#pEF,e,b`"$contentsDir\efi\microsoft\boot\efisys.bin`""
|
||||||
@@ -462,6 +668,7 @@ function Invoke-WinUtilISOWriteUSB {
|
|||||||
$ts = (Get-Date).ToString("HH:mm:ss")
|
$ts = (Get-Date).ToString("HH:mm:ss")
|
||||||
$sync["WPFWin11ISOStatusLog"].Dispatcher.Invoke([action]{
|
$sync["WPFWin11ISOStatusLog"].Dispatcher.Invoke([action]{
|
||||||
$sync["WPFWin11ISOStatusLog"].Text += "`n[$ts] $msg"
|
$sync["WPFWin11ISOStatusLog"].Text += "`n[$ts] $msg"
|
||||||
|
$sync["WPFWin11ISOStatusLog"].CaretIndex = $sync["WPFWin11ISOStatusLog"].Text.Length
|
||||||
$sync["WPFWin11ISOStatusLog"].ScrollToEnd()
|
$sync["WPFWin11ISOStatusLog"].ScrollToEnd()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +1,65 @@
|
|||||||
function Invoke-WinUtilISOScript {
|
function Invoke-WinUtilISOScript {
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Applies the standard WinUtil modifications to a mounted Windows 11 install.wim image.
|
Applies WinUtil modifications to a mounted Windows 11 install.wim image.
|
||||||
|
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
Removes bloatware AppX packages, Edge, OneDrive, applies privacy/telemetry
|
Performs the following operations against an already-mounted WIM image:
|
||||||
registry tweaks, disables sponsored-app delivery, bypasses hardware checks,
|
|
||||||
copies autounattend.xml for local-account OOBE, and deletes unwanted
|
1. Removes provisioned AppX bloatware packages via DISM.
|
||||||
scheduled-task definition files — all against an already-mounted WIM image.
|
2. Deletes Microsoft Edge program files.
|
||||||
|
3. Removes OneDriveSetup.exe from the system image.
|
||||||
|
4. Loads offline registry hives (COMPONENTS, DEFAULT, NTUSER, SOFTWARE, SYSTEM)
|
||||||
|
and applies the following tweaks:
|
||||||
|
- Bypasses hardware requirement checks (CPU, RAM, SecureBoot, Storage, TPM).
|
||||||
|
- Disables sponsored-app delivery and ContentDeliveryManager features.
|
||||||
|
- Enables local-account OOBE path (BypassNRO).
|
||||||
|
- Writes autounattend.xml to the Sysprep directory inside the WIM and,
|
||||||
|
optionally, to the ISO/USB root so Windows Setup picks it up at boot.
|
||||||
|
- Disables reserved storage.
|
||||||
|
- Disables BitLocker device encryption.
|
||||||
|
- Hides the Chat (Teams) taskbar icon.
|
||||||
|
- Removes Edge uninstall registry entries.
|
||||||
|
- Disables OneDrive folder backup (KFM).
|
||||||
|
- Disables telemetry, advertising ID, and input personalization.
|
||||||
|
- Blocks post-install delivery of DevHome, Outlook, and Teams.
|
||||||
|
- Disables Windows Copilot.
|
||||||
|
- Disables Windows Update during OOBE.
|
||||||
|
5. Deletes unwanted scheduled-task XML definition files (CEIP, Appraiser, etc.).
|
||||||
|
6. Removes the support\ folder from the ISO contents directory (if supplied).
|
||||||
|
|
||||||
Mounting and dismounting the WIM is the responsibility of the caller
|
Mounting and dismounting the WIM is the responsibility of the caller
|
||||||
(e.g. Invoke-WinUtilISOModify).
|
(e.g. Invoke-WinUtilISO).
|
||||||
|
|
||||||
.PARAMETER ScratchDir
|
.PARAMETER ScratchDir
|
||||||
Full path to the directory where the Windows image is currently mounted
|
Mandatory. Full path to the directory where the Windows image is currently mounted.
|
||||||
(the "scratchdir"). Example: C:\Temp\WinUtil_Win11ISO_20260222\wim_mount
|
Example: C:\Users\USERNAME\AppData\Local\Temp\WinUtil_Win11ISO_20260222\wim_mount
|
||||||
|
|
||||||
|
.PARAMETER ISOContentsDir
|
||||||
|
Optional. Root directory of the extracted ISO contents.
|
||||||
|
When supplied, autounattend.xml is also written here so Windows Setup picks it
|
||||||
|
up automatically at boot, and the support\ folder is deleted from that location.
|
||||||
|
|
||||||
|
.PARAMETER AutoUnattendXml
|
||||||
|
Optional. Full XML content for autounattend.xml.
|
||||||
|
In compiled winutil.ps1 this is the embedded $WinUtilAutounattendXml here-string;
|
||||||
|
in dev mode it is read from tools\autounattend.xml.
|
||||||
|
If empty, the OOBE bypass file is skipped and a warning is logged.
|
||||||
|
|
||||||
.PARAMETER Log
|
.PARAMETER Log
|
||||||
Optional ScriptBlock used for progress/status logging.
|
Optional ScriptBlock used for progress/status logging.
|
||||||
Receives a single [string] message argument.
|
Receives a single [string] message argument.
|
||||||
Defaults to Write-Output when not supplied.
|
Defaults to { param($m) Write-Output $m } when not supplied.
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Invoke-WinUtilISOScript -ScratchDir "C:\Temp\wim_mount"
|
Invoke-WinUtilISOScript -ScratchDir "C:\Temp\wim_mount"
|
||||||
Invoke-WinUtilISOScript -ScratchDir $mountDir -Log { param($m) Write-Host $m }
|
|
||||||
|
.EXAMPLE
|
||||||
|
Invoke-WinUtilISOScript `
|
||||||
|
-ScratchDir $mountDir `
|
||||||
|
-ISOContentsDir $isoRoot `
|
||||||
|
-AutoUnattendXml (Get-Content .\tools\autounattend.xml -Raw) `
|
||||||
|
-Log { param($m) Write-Host $m }
|
||||||
|
|
||||||
.NOTES
|
.NOTES
|
||||||
Author : Chris Titus @christitustech
|
Author : Chris Titus @christitustech
|
||||||
@@ -32,6 +68,12 @@ function Invoke-WinUtilISOScript {
|
|||||||
#>
|
#>
|
||||||
param (
|
param (
|
||||||
[Parameter(Mandatory)][string]$ScratchDir,
|
[Parameter(Mandatory)][string]$ScratchDir,
|
||||||
|
# Root directory of the extracted ISO contents. When supplied, autounattend.xml
|
||||||
|
# is written here so Windows Setup picks it up automatically at boot.
|
||||||
|
[string]$ISOContentsDir = "",
|
||||||
|
# Autounattend XML content. In compiled winutil.ps1 this comes from the embedded
|
||||||
|
# $WinUtilAutounattendXml here-string; in dev mode it is read from tools\autounattend.xml.
|
||||||
|
[string]$AutoUnattendXml = "",
|
||||||
[scriptblock]$Log = { param($m) Write-Output $m }
|
[scriptblock]$Log = { param($m) Write-Output $m }
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -40,20 +82,20 @@ function Invoke-WinUtilISOScript {
|
|||||||
$adminGroup = $adminSID.Translate([System.Security.Principal.NTAccount])
|
$adminGroup = $adminSID.Translate([System.Security.Principal.NTAccount])
|
||||||
|
|
||||||
# ── Local helpers ─────────────────────────────────────────────────────────
|
# ── Local helpers ─────────────────────────────────────────────────────────
|
||||||
function _ISOScript-SetReg {
|
function Set-ISOScriptReg {
|
||||||
param ([string]$path, [string]$name, [string]$type, [string]$value)
|
param ([string]$path, [string]$name, [string]$type, [string]$value)
|
||||||
try {
|
try {
|
||||||
& reg add $path /v $name /t $type /d $value /f | Out-Null
|
& reg add $path /v $name /t $type /d $value /f
|
||||||
& $Log "Set registry value: $path\$name"
|
& $Log "Set registry value: $path\$name"
|
||||||
} catch {
|
} catch {
|
||||||
& $Log "Error setting registry value: $_"
|
& $Log "Error setting registry value: $_"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function _ISOScript-DelReg {
|
function Remove-ISOScriptReg {
|
||||||
param ([string]$path)
|
param ([string]$path)
|
||||||
try {
|
try {
|
||||||
& reg delete $path /f | Out-Null
|
& reg delete $path /f
|
||||||
& $Log "Removed registry key: $path"
|
& $Log "Removed registry key: $path"
|
||||||
} catch {
|
} catch {
|
||||||
& $Log "Error removing registry key: $_"
|
& $Log "Error removing registry key: $_"
|
||||||
@@ -108,14 +150,12 @@ function Invoke-WinUtilISOScript {
|
|||||||
'Microsoft.WindowsFeedbackHub',
|
'Microsoft.WindowsFeedbackHub',
|
||||||
'Microsoft.WindowsMaps',
|
'Microsoft.WindowsMaps',
|
||||||
'Microsoft.WindowsSoundRecorder',
|
'Microsoft.WindowsSoundRecorder',
|
||||||
'Microsoft.WindowsTerminal',
|
|
||||||
'Microsoft.ZuneMusic',
|
'Microsoft.ZuneMusic',
|
||||||
'Microsoft.ZuneVideo',
|
'Microsoft.ZuneVideo',
|
||||||
'MicrosoftCorporationII.MicrosoftFamily',
|
'MicrosoftCorporationII.MicrosoftFamily',
|
||||||
'MicrosoftCorporationII.QuickAssist',
|
'MicrosoftCorporationII.QuickAssist',
|
||||||
'MSTeams',
|
'MSTeams',
|
||||||
'MicrosoftTeams',
|
'MicrosoftTeams'
|
||||||
'Microsoft.549981C3F5F10'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
$packagesToRemove = $packages | Where-Object {
|
$packagesToRemove = $packages | Where-Object {
|
||||||
@@ -131,11 +171,6 @@ function Invoke-WinUtilISOScript {
|
|||||||
# ═════════════════════════════════════════════════════════════════════════
|
# ═════════════════════════════════════════════════════════════════════════
|
||||||
& $Log "Removing Edge..."
|
& $Log "Removing Edge..."
|
||||||
Remove-Item -Path "$ScratchDir\Program Files (x86)\Microsoft\Edge" -Recurse -Force -ErrorAction SilentlyContinue
|
Remove-Item -Path "$ScratchDir\Program Files (x86)\Microsoft\Edge" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
Remove-Item -Path "$ScratchDir\Program Files (x86)\Microsoft\EdgeUpdate" -Recurse -Force -ErrorAction SilentlyContinue
|
|
||||||
Remove-Item -Path "$ScratchDir\Program Files (x86)\Microsoft\EdgeCore" -Recurse -Force -ErrorAction SilentlyContinue
|
|
||||||
& takeown /f "$ScratchDir\Windows\System32\Microsoft-Edge-Webview" /r | Out-Null
|
|
||||||
& icacls "$ScratchDir\Windows\System32\Microsoft-Edge-Webview" /grant "$($adminGroup.Value):(F)" /T /C | Out-Null
|
|
||||||
Remove-Item -Path "$ScratchDir\Windows\System32\Microsoft-Edge-Webview" -Recurse -Force -ErrorAction SilentlyContinue
|
|
||||||
|
|
||||||
# ═════════════════════════════════════════════════════════════════════════
|
# ═════════════════════════════════════════════════════════════════════════
|
||||||
# 3. Remove OneDrive
|
# 3. Remove OneDrive
|
||||||
@@ -149,109 +184,127 @@ function Invoke-WinUtilISOScript {
|
|||||||
# 4. Registry tweaks
|
# 4. Registry tweaks
|
||||||
# ═════════════════════════════════════════════════════════════════════════
|
# ═════════════════════════════════════════════════════════════════════════
|
||||||
& $Log "Loading offline registry hives..."
|
& $Log "Loading offline registry hives..."
|
||||||
reg load HKLM\zCOMPONENTS "$ScratchDir\Windows\System32\config\COMPONENTS" | Out-Null
|
reg load HKLM\zCOMPONENTS "$ScratchDir\Windows\System32\config\COMPONENTS"
|
||||||
reg load HKLM\zDEFAULT "$ScratchDir\Windows\System32\config\default" | Out-Null
|
reg load HKLM\zDEFAULT "$ScratchDir\Windows\System32\config\default"
|
||||||
reg load HKLM\zNTUSER "$ScratchDir\Users\Default\ntuser.dat" | Out-Null
|
reg load HKLM\zNTUSER "$ScratchDir\Users\Default\ntuser.dat"
|
||||||
reg load HKLM\zSOFTWARE "$ScratchDir\Windows\System32\config\SOFTWARE" | Out-Null
|
reg load HKLM\zSOFTWARE "$ScratchDir\Windows\System32\config\SOFTWARE"
|
||||||
reg load HKLM\zSYSTEM "$ScratchDir\Windows\System32\config\SYSTEM" | Out-Null
|
reg load HKLM\zSYSTEM "$ScratchDir\Windows\System32\config\SYSTEM"
|
||||||
|
|
||||||
& $Log "Bypassing system requirements..."
|
& $Log "Bypassing system requirements..."
|
||||||
_ISOScript-SetReg 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' 'SV1' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' 'SV1' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' 'SV2' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' 'SV2' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' 'SV1' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' 'SV1' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' 'SV2' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' 'SV2' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassCPUCheck' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassCPUCheck' 'REG_DWORD' '1'
|
||||||
_ISOScript-SetReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassRAMCheck' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassRAMCheck' 'REG_DWORD' '1'
|
||||||
_ISOScript-SetReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassSecureBootCheck' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassSecureBootCheck' 'REG_DWORD' '1'
|
||||||
_ISOScript-SetReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassStorageCheck' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassStorageCheck' 'REG_DWORD' '1'
|
||||||
_ISOScript-SetReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassTPMCheck' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassTPMCheck' 'REG_DWORD' '1'
|
||||||
_ISOScript-SetReg 'HKLM\zSYSTEM\Setup\MoSetup' 'AllowUpgradesWithUnsupportedTPMOrCPU' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSYSTEM\Setup\MoSetup' 'AllowUpgradesWithUnsupportedTPMOrCPU' 'REG_DWORD' '1'
|
||||||
|
|
||||||
& $Log "Disabling sponsored apps..."
|
& $Log "Disabling sponsored apps..."
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'OemPreInstalledAppsEnabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'OemPreInstalledAppsEnabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'PreInstalledAppsEnabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'PreInstalledAppsEnabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SilentInstalledAppsEnabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SilentInstalledAppsEnabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableWindowsConsumerFeatures' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableWindowsConsumerFeatures' 'REG_DWORD' '1'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'ContentDeliveryAllowed' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'ContentDeliveryAllowed' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Microsoft\PolicyManager\current\device\Start' 'ConfigureStartPins' 'REG_SZ' '{"pinnedList": [{}]}'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\PolicyManager\current\device\Start' 'ConfigureStartPins' 'REG_SZ' '{"pinnedList": [{}]}'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'FeatureManagementEnabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'FeatureManagementEnabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'PreInstalledAppsEverEnabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'PreInstalledAppsEverEnabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SoftLandingEnabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SoftLandingEnabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContentEnabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContentEnabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-310093Enabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-310093Enabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-338388Enabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-338388Enabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-338389Enabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-338389Enabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-338393Enabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-338393Enabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-353694Enabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-353694Enabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-353696Enabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-353696Enabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SystemPaneSuggestionsEnabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SystemPaneSuggestionsEnabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Policies\Microsoft\PushToInstall' 'DisablePushToInstall' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\PushToInstall' 'DisablePushToInstall' 'REG_DWORD' '1'
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Policies\Microsoft\MRT' 'DontOfferThroughWUAU' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\MRT' 'DontOfferThroughWUAU' 'REG_DWORD' '1'
|
||||||
_ISOScript-DelReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\Subscriptions'
|
Remove-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\Subscriptions'
|
||||||
_ISOScript-DelReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\SuggestedApps'
|
Remove-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\SuggestedApps'
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableConsumerAccountStateContent' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableConsumerAccountStateContent' 'REG_DWORD' '1'
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableCloudOptimizedContent' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableCloudOptimizedContent' 'REG_DWORD' '1'
|
||||||
|
|
||||||
& $Log "Enabling local accounts on OOBE..."
|
& $Log "Enabling local accounts on OOBE..."
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE' 'BypassNRO' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE' 'BypassNRO' 'REG_DWORD' '1'
|
||||||
|
|
||||||
|
if ($AutoUnattendXml) {
|
||||||
|
# ── Place autounattend.xml inside the WIM (Sysprep) ──────────────────
|
||||||
$sysprepDest = "$ScratchDir\Windows\System32\Sysprep\autounattend.xml"
|
$sysprepDest = "$ScratchDir\Windows\System32\Sysprep\autounattend.xml"
|
||||||
Set-Content -Path $sysprepDest -Value $WinUtilAutounattendXml -Encoding UTF8 -Force
|
Set-Content -Path $sysprepDest -Value $AutoUnattendXml -Encoding UTF8 -Force
|
||||||
& $Log "Written autounattend.xml to Sysprep directory."
|
& $Log "Written autounattend.xml to Sysprep directory."
|
||||||
|
|
||||||
|
# ── Place autounattend.xml at the ISO / USB root ──────────────────────
|
||||||
|
# Windows Setup reads this file first (before booting into the OS),
|
||||||
|
# which is what drives the local-account / OOBE bypass at install time.
|
||||||
|
if ($ISOContentsDir -and (Test-Path $ISOContentsDir)) {
|
||||||
|
$isoDest = Join-Path $ISOContentsDir "autounattend.xml"
|
||||||
|
Set-Content -Path $isoDest -Value $AutoUnattendXml -Encoding UTF8 -Force
|
||||||
|
& $Log "Written autounattend.xml to ISO root ($isoDest)."
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
& $Log "Warning: autounattend.xml content is empty — skipping OOBE bypass file."
|
||||||
|
}
|
||||||
|
|
||||||
& $Log "Disabling reserved storage..."
|
& $Log "Disabling reserved storage..."
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager' 'ShippedWithReserves' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager' 'ShippedWithReserves' 'REG_DWORD' '0'
|
||||||
|
|
||||||
& $Log "Disabling BitLocker device encryption..."
|
& $Log "Disabling BitLocker device encryption..."
|
||||||
_ISOScript-SetReg 'HKLM\zSYSTEM\ControlSet001\Control\BitLocker' 'PreventDeviceEncryption' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSYSTEM\ControlSet001\Control\BitLocker' 'PreventDeviceEncryption' 'REG_DWORD' '1'
|
||||||
|
|
||||||
& $Log "Disabling Chat icon..."
|
& $Log "Disabling Chat icon..."
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Chat' 'ChatIcon' 'REG_DWORD' '3'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Chat' 'ChatIcon' 'REG_DWORD' '3'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'TaskbarMn' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'TaskbarMn' 'REG_DWORD' '0'
|
||||||
|
|
||||||
& $Log "Removing Edge registry entries..."
|
& $Log "Removing Edge registry entries..."
|
||||||
_ISOScript-DelReg 'HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge'
|
Remove-ISOScriptReg 'HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge'
|
||||||
_ISOScript-DelReg 'HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update'
|
Remove-ISOScriptReg 'HKLM\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update'
|
||||||
|
|
||||||
& $Log "Disabling OneDrive folder backup..."
|
& $Log "Disabling OneDrive folder backup..."
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\OneDrive' 'DisableFileSyncNGSC' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\OneDrive' 'DisableFileSyncNGSC' 'REG_DWORD' '1'
|
||||||
|
|
||||||
& $Log "Disabling telemetry..."
|
& $Log "Disabling telemetry..."
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo' 'Enabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo' 'Enabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\Privacy' 'TailoredExperiencesWithDiagnosticDataEnabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\Privacy' 'TailoredExperiencesWithDiagnosticDataEnabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy' 'HasAccepted' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy' 'HasAccepted' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Input\TIPC' 'Enabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Input\TIPC' 'Enabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization' 'RestrictImplicitInkCollection' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization' 'RestrictImplicitInkCollection' 'REG_DWORD' '1'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization' 'RestrictImplicitTextCollection' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization' 'RestrictImplicitTextCollection' 'REG_DWORD' '1'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization\TrainedDataStore' 'HarvestContacts' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization\TrainedDataStore' 'HarvestContacts' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zNTUSER\Software\Microsoft\Personalization\Settings' 'AcceptedPrivacyPolicy' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Personalization\Settings' 'AcceptedPrivacyPolicy' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\DataCollection' 'AllowTelemetry' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\DataCollection' 'AllowTelemetry' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zSYSTEM\ControlSet001\Services\dmwappushservice' 'Start' 'REG_DWORD' '4'
|
Set-ISOScriptReg 'HKLM\zSYSTEM\ControlSet001\Services\dmwappushservice' 'Start' 'REG_DWORD' '4'
|
||||||
|
|
||||||
& $Log "Preventing installation of DevHome and Outlook..."
|
& $Log "Preventing installation of DevHome and Outlook..."
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate' 'workCompleted' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate' 'workCompleted' 'REG_DWORD' '1'
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\OutlookUpdate' 'workCompleted' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\OutlookUpdate' 'workCompleted' 'REG_DWORD' '1'
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\DevHomeUpdate' 'workCompleted' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\DevHomeUpdate' 'workCompleted' 'REG_DWORD' '1'
|
||||||
_ISOScript-DelReg 'HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate'
|
Remove-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate'
|
||||||
_ISOScript-DelReg 'HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\DevHomeUpdate'
|
Remove-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\DevHomeUpdate'
|
||||||
|
|
||||||
& $Log "Disabling Copilot..."
|
& $Log "Disabling Copilot..."
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsCopilot' 'TurnOffWindowsCopilot' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsCopilot' 'TurnOffWindowsCopilot' 'REG_DWORD' '1'
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Policies\Microsoft\Edge' 'HubsSidebarEnabled' 'REG_DWORD' '0'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Edge' 'HubsSidebarEnabled' 'REG_DWORD' '0'
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Explorer' 'DisableSearchBoxSuggestions' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Explorer' 'DisableSearchBoxSuggestions' 'REG_DWORD' '1'
|
||||||
|
|
||||||
|
& $Log "Disabling Windows Update during OOBE (re-enabled on first logon via FirstLogon.ps1)..."
|
||||||
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' 'NoAutoUpdate' 'REG_DWORD' '1'
|
||||||
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' 'DisableWindowsUpdateAccess' 'REG_DWORD' '1'
|
||||||
|
|
||||||
& $Log "Preventing installation of Teams..."
|
& $Log "Preventing installation of Teams..."
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Policies\Microsoft\Teams' 'DisableInstallation' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Teams' 'DisableInstallation' 'REG_DWORD' '1'
|
||||||
|
|
||||||
& $Log "Preventing installation of new Outlook..."
|
& $Log "Preventing installation of new Outlook..."
|
||||||
_ISOScript-SetReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Mail' 'PreventRun' 'REG_DWORD' '1'
|
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Mail' 'PreventRun' 'REG_DWORD' '1'
|
||||||
|
|
||||||
& $Log "Unloading offline registry hives..."
|
& $Log "Unloading offline registry hives..."
|
||||||
reg unload HKLM\zCOMPONENTS | Out-Null
|
reg unload HKLM\zCOMPONENTS
|
||||||
reg unload HKLM\zDEFAULT | Out-Null
|
reg unload HKLM\zDEFAULT
|
||||||
reg unload HKLM\zNTUSER | Out-Null
|
reg unload HKLM\zNTUSER
|
||||||
reg unload HKLM\zSOFTWARE | Out-Null
|
reg unload HKLM\zSOFTWARE
|
||||||
reg unload HKLM\zSYSTEM | Out-Null
|
reg unload HKLM\zSYSTEM
|
||||||
|
|
||||||
# ═════════════════════════════════════════════════════════════════════════
|
# ═════════════════════════════════════════════════════════════════════════
|
||||||
# 5. Delete scheduled task definition files
|
# 5. Delete scheduled task definition files
|
||||||
@@ -266,5 +319,13 @@ function Invoke-WinUtilISOScript {
|
|||||||
Remove-Item "$tasksPath\Microsoft\Windows\Windows Error Reporting\QueueReporting" -Force -ErrorAction SilentlyContinue
|
Remove-Item "$tasksPath\Microsoft\Windows\Windows Error Reporting\QueueReporting" -Force -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
& $Log "Scheduled task files deleted."
|
& $Log "Scheduled task files deleted."
|
||||||
}
|
|
||||||
|
|
||||||
|
# ═════════════════════════════════════════════════════════════════════════
|
||||||
|
# 6. Remove ISO support folder (fresh-install only; not needed)
|
||||||
|
# ═════════════════════════════════════════════════════════════════════════
|
||||||
|
if ($ISOContentsDir -and (Test-Path $ISOContentsDir)) {
|
||||||
|
& $Log "Removing ISO support\ folder..."
|
||||||
|
Remove-Item -Path (Join-Path $ISOContentsDir "support") -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
& $Log "ISO support\ folder removed."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -554,11 +554,18 @@ $sync["WPFWin11ISOModifyButton"].Add_Click({
|
|||||||
Invoke-WinUtilISOModify
|
Invoke-WinUtilISOModify
|
||||||
})
|
})
|
||||||
|
|
||||||
$sync["WPFWin11ISOExportButton"].Add_Click({
|
$sync["WPFWin11ISOChooseISOButton"].Add_Click({
|
||||||
Write-Debug "WPFWin11ISOExportButton clicked"
|
Write-Debug "WPFWin11ISOChooseISOButton clicked"
|
||||||
|
$sync["WPFWin11ISOOptionUSB"].Visibility = "Collapsed"
|
||||||
Invoke-WinUtilISOExport
|
Invoke-WinUtilISOExport
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$sync["WPFWin11ISOChooseUSBButton"].Add_Click({
|
||||||
|
Write-Debug "WPFWin11ISOChooseUSBButton clicked"
|
||||||
|
$sync["WPFWin11ISOOptionUSB"].Visibility = "Visible"
|
||||||
|
Invoke-WinUtilISORefreshUSBDrives
|
||||||
|
})
|
||||||
|
|
||||||
$sync["WPFWin11ISORefreshUSBButton"].Add_Click({
|
$sync["WPFWin11ISORefreshUSBButton"].Add_Click({
|
||||||
Write-Debug "WPFWin11ISORefreshUSBButton clicked"
|
Write-Debug "WPFWin11ISORefreshUSBButton clicked"
|
||||||
Invoke-WinUtilISORefreshUSBDrives
|
Invoke-WinUtilISORefreshUSBDrives
|
||||||
@@ -569,6 +576,11 @@ $sync["WPFWin11ISOWriteUSBButton"].Add_Click({
|
|||||||
Invoke-WinUtilISOWriteUSB
|
Invoke-WinUtilISOWriteUSB
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$sync["WPFWin11ISOCleanResetButton"].Add_Click({
|
||||||
|
Write-Debug "WPFWin11ISOCleanResetButton clicked"
|
||||||
|
Invoke-WinUtilISOCleanAndReset
|
||||||
|
})
|
||||||
|
|
||||||
# ──────────────────────────────────────────────────────────────────────────────
|
# ──────────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
$sync["Form"].ShowDialog() | out-null
|
$sync["Form"].ShowDialog() | out-null
|
||||||
|
|||||||
@@ -1,239 +1,507 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
|
||||||
Windows 11 Unattended Installation Answer File
|
<!--https://schneegans.de/windows/unattend-generator/?LanguageMode=Interactive&ProcessorArchitecture=amd64&BypassRequirementsCheck=true&ComputerNameMode=Random&CompactOsMode=Default&TimeZoneMode=Implicit&PartitionMode=Interactive&DiskAssertionMode=Skip&WindowsEditionMode=Interactive&InstallFromMode=Automatic&PEMode=Default&UserAccountMode=InteractiveLocal&PasswordExpirationMode=Unlimited&LockoutMode=Default&HideFiles=Hidden&ClassicContextMenu=true&LaunchToThisPC=true&ShowEndTask=true&TaskbarSearch=Hide&TaskbarIconsMode=Empty&DisableWidgets=true&LeftTaskbar=true&HideTaskViewButton=true&StartTilesMode=Default&StartPinsMode=Empty&EnableLongPaths=true&HideEdgeFre=true&DisableEdgeStartupBoost=true&DeleteWindowsOld=true&EffectsMode=Default&DeleteEdgeDesktopIcon=true&DesktopIconsMode=Default&StartFoldersMode=Default&WifiMode=Skip&ExpressSettings=DisableAll&LockKeysMode=Configure&CapsLockInitial=Off&CapsLockBehavior=Toggle&NumLockInitial=On&NumLockBehavior=Toggle&ScrollLockInitial=Off&ScrollLockBehavior=Toggle&StickyKeysMode=Disabled&ColorMode=Custom&SystemColorTheme=Dark&AppsColorTheme=Dark&AccentColor=%230078d4&WallpaperMode=Default&LockScreenMode=Default&WdacMode=Skip&AppLockerMode=Skip-->
|
||||||
================================================
|
<settings pass="offlineServicing"></settings>
|
||||||
UNIVERSAL — no modification required before use.
|
|
||||||
|
|
||||||
What this file does automatically:
|
|
||||||
• Installs "Windows 11 Pro" from any standard Microsoft ISO
|
|
||||||
• Bypasses the Microsoft-account OOBE requirement (local account)
|
|
||||||
• Skips the EULA, wireless, and privacy nag screens
|
|
||||||
• Leaves timezone, language, region, and user account to the user
|
|
||||||
at the two short OOBE screens that remain
|
|
||||||
|
|
||||||
What the user is prompted for during first-run (OOBE):
|
|
||||||
1. Region / Language / Keyboard (one screen)
|
|
||||||
2. Who will use this PC? (local account name + password)
|
|
||||||
|
|
||||||
Timezone is set to UTC and can be adjusted after login.
|
|
||||||
Computer name is auto-generated; rename at any time.
|
|
||||||
|
|
||||||
Tested against: Windows 11 Home / Pro / Home Single Language (amd64)
|
|
||||||
Pass order: windowsPE → specialize → oobeSystem
|
|
||||||
-->
|
|
||||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
|
||||||
|
|
||||||
<!-- ═══════════════════════════════════════════════════════════════════
|
|
||||||
PASS 1 — windowsPE
|
|
||||||
Runs inside the installer environment before the OS is laid down.
|
|
||||||
Handles disk layout and image selection only.
|
|
||||||
Locale is intentionally omitted so the installer inherits the
|
|
||||||
language of whichever ISO is being used.
|
|
||||||
═══════════════════════════════════════════════════════════════════════ -->
|
|
||||||
<settings pass="windowsPE">
|
<settings pass="windowsPE">
|
||||||
|
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||||
<!-- Setup / image selection -->
|
|
||||||
<component name="Microsoft-Windows-Setup"
|
|
||||||
processorArchitecture="amd64"
|
|
||||||
publicKeyToken="31bf3856ad364e35"
|
|
||||||
language="neutral"
|
|
||||||
versionScope="nonSxS"
|
|
||||||
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
||||||
|
|
||||||
<!-- Disable dynamic updates during setup (keeps installation offline/fast) -->
|
|
||||||
<DynamicUpdate>
|
|
||||||
<Enable>false</Enable>
|
|
||||||
</DynamicUpdate>
|
|
||||||
|
|
||||||
<ImageInstall>
|
|
||||||
<OSImage>
|
|
||||||
<!-- CompactOS saves ~1.5 GB but is slower on spinning drives -->
|
|
||||||
<Compact>false</Compact>
|
|
||||||
<WillShowUI>OnError</WillShowUI>
|
|
||||||
<InstallFrom>
|
|
||||||
<!--
|
|
||||||
Select the edition by NAME rather than by index number.
|
|
||||||
Index numbers vary between ISO builds; the name is stable.
|
|
||||||
Change "Windows 11 Pro" to "Windows 11 Home" etc. if your
|
|
||||||
ISO only contains that edition. To choose interactively,
|
|
||||||
delete this entire <InstallFrom> block.
|
|
||||||
-->
|
|
||||||
<MetaData wcm:action="add">
|
|
||||||
<Key>/IMAGE/NAME</Key>
|
|
||||||
<Value>Windows 11 Pro</Value>
|
|
||||||
</MetaData>
|
|
||||||
</InstallFrom>
|
|
||||||
<!-- InstallTo is omitted — the Windows installer will prompt
|
|
||||||
the user to select the destination disk and partition. -->
|
|
||||||
</OSImage>
|
|
||||||
</ImageInstall>
|
|
||||||
|
|
||||||
<UserData>
|
<UserData>
|
||||||
<AcceptEula>true</AcceptEula>
|
|
||||||
<ProductKey>
|
<ProductKey>
|
||||||
<!--
|
<Key>00000-00000-00000-00000-00000</Key>
|
||||||
Leave <Key> absent to use an existing digital licence or
|
<WillShowUI>Always</WillShowUI>
|
||||||
to be prompted for one after setup.
|
|
||||||
|
|
||||||
Generic setup keys (allow setup to proceed; do NOT activate):
|
|
||||||
Home : YTMG3-N6DKC-DKB77-7M9GH-8HVX7
|
|
||||||
Home Single Language : 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH
|
|
||||||
Pro : VK7JG-NPHTM-C97JM-9MPGT-3V66T
|
|
||||||
Education : YNMGQ-8RYV3-4PGQ3-C8XTP-7CFBY
|
|
||||||
Enterprise : XGVPP-NMH47-7TTHJ-W3FW7-8HV2C
|
|
||||||
-->
|
|
||||||
<WillShowUI>OnError</WillShowUI>
|
|
||||||
</ProductKey>
|
</ProductKey>
|
||||||
|
<AcceptEula>true</AcceptEula>
|
||||||
</UserData>
|
</UserData>
|
||||||
|
<UseConfigurationSet>false</UseConfigurationSet>
|
||||||
|
<RunSynchronous>
|
||||||
|
<RunSynchronousCommand wcm:action="add">
|
||||||
|
<Order>1</Order>
|
||||||
|
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassTPMCheck /t REG_DWORD /d 1 /f</Path>
|
||||||
|
</RunSynchronousCommand>
|
||||||
|
<RunSynchronousCommand wcm:action="add">
|
||||||
|
<Order>2</Order>
|
||||||
|
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassSecureBootCheck /t REG_DWORD /d 1 /f</Path>
|
||||||
|
</RunSynchronousCommand>
|
||||||
|
<RunSynchronousCommand wcm:action="add">
|
||||||
|
<Order>3</Order>
|
||||||
|
<Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassRAMCheck /t REG_DWORD /d 1 /f</Path>
|
||||||
|
</RunSynchronousCommand>
|
||||||
|
</RunSynchronous>
|
||||||
</component>
|
</component>
|
||||||
</settings>
|
</settings>
|
||||||
|
<settings pass="generalize"></settings>
|
||||||
<!-- ═══════════════════════════════════════════════════════════════════
|
|
||||||
PASS 2 — specialize
|
|
||||||
First boot into the installed OS.
|
|
||||||
Machine-level settings that do not vary by user or region.
|
|
||||||
═══════════════════════════════════════════════════════════════════════ -->
|
|
||||||
<settings pass="specialize">
|
<settings pass="specialize">
|
||||||
|
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||||
<component name="Microsoft-Windows-Shell-Setup"
|
<RunSynchronous>
|
||||||
processorArchitecture="amd64"
|
<RunSynchronousCommand wcm:action="add">
|
||||||
publicKeyToken="31bf3856ad364e35"
|
<Order>1</Order>
|
||||||
language="neutral"
|
<Path>powershell.exe -WindowStyle "Normal" -NoProfile -Command "$xml = [xml]::new(); $xml.Load('C:\Windows\Panther\unattend.xml'); $sb = [scriptblock]::Create( $xml.unattend.Extensions.ExtractScript ); Invoke-Command -ScriptBlock $sb -ArgumentList $xml;"</Path>
|
||||||
versionScope="nonSxS"
|
</RunSynchronousCommand>
|
||||||
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
|
<RunSynchronousCommand wcm:action="add">
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
<Order>2</Order>
|
||||||
|
<Path>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\Specialize.ps1"</Path>
|
||||||
<!-- Auto-generate a unique computer name. Rename anytime:
|
</RunSynchronousCommand>
|
||||||
Settings › System › About › Rename this PC -->
|
<RunSynchronousCommand wcm:action="add">
|
||||||
<ComputerName>*</ComputerName>
|
<Order>3</Order>
|
||||||
|
<Path>reg.exe load "HKU\DefaultUser" "C:\Users\Default\NTUSER.DAT"</Path>
|
||||||
<!--
|
</RunSynchronousCommand>
|
||||||
UTC is the only timezone that is correct everywhere on Earth
|
<RunSynchronousCommand wcm:action="add">
|
||||||
without knowing where the machine will be used.
|
<Order>4</Order>
|
||||||
Windows will auto-adjust to local time once the user sets their
|
<Path>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\DefaultUser.ps1"</Path>
|
||||||
region, or they can change it in Settings › Time & Language.
|
</RunSynchronousCommand>
|
||||||
-->
|
<RunSynchronousCommand wcm:action="add">
|
||||||
<TimeZone>UTC</TimeZone>
|
<Order>5</Order>
|
||||||
|
<Path>reg.exe unload "HKU\DefaultUser"</Path>
|
||||||
<!-- Suppress the Teams/Chat auto-install prompt during setup -->
|
</RunSynchronousCommand>
|
||||||
<ConfigureChatAutoInstall>false</ConfigureChatAutoInstall>
|
</RunSynchronous>
|
||||||
|
|
||||||
</component>
|
</component>
|
||||||
|
|
||||||
<!-- Reduce telemetry to the minimum permitted by the licence.
|
|
||||||
0 = Security (Enterprise/Education only; treated as 1 on other SKUs)
|
|
||||||
1 = Basic / Required diagnostic data ← effective minimum for Home/Pro -->
|
|
||||||
<component name="Microsoft-Windows-SQMAPI"
|
|
||||||
processorArchitecture="amd64"
|
|
||||||
publicKeyToken="31bf3856ad364e35"
|
|
||||||
language="neutral"
|
|
||||||
versionScope="nonSxS"
|
|
||||||
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
||||||
<CEIPEnabled>0</CEIPEnabled>
|
|
||||||
</component>
|
|
||||||
|
|
||||||
</settings>
|
</settings>
|
||||||
|
<settings pass="auditSystem"></settings>
|
||||||
<!-- ═══════════════════════════════════════════════════════════════════
|
<settings pass="auditUser"></settings>
|
||||||
PASS 3 — oobeSystem
|
|
||||||
Out-of-Box Experience (first-run wizard).
|
|
||||||
|
|
||||||
Screens shown to the user (everything else is suppressed):
|
|
||||||
① Region / Language / Keyboard layout — user picks their locale
|
|
||||||
② Create a local account — user picks name + password
|
|
||||||
|
|
||||||
Screens suppressed automatically:
|
|
||||||
• EULA
|
|
||||||
• "Sign in with Microsoft" / online account
|
|
||||||
• Wi-Fi selection (can be done after login)
|
|
||||||
• "Let Microsoft and apps use your location", Cortana, etc.
|
|
||||||
|
|
||||||
Locale settings are intentionally omitted here so that Windows
|
|
||||||
applies whatever the user selects on screen ①.
|
|
||||||
═══════════════════════════════════════════════════════════════════════ -->
|
|
||||||
<settings pass="oobeSystem">
|
<settings pass="oobeSystem">
|
||||||
|
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||||
<component name="Microsoft-Windows-Shell-Setup"
|
|
||||||
processorArchitecture="amd64"
|
|
||||||
publicKeyToken="31bf3856ad364e35"
|
|
||||||
language="neutral"
|
|
||||||
versionScope="nonSxS"
|
|
||||||
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
||||||
|
|
||||||
<OOBE>
|
<OOBE>
|
||||||
<!-- Suppress the licence agreement — already accepted in windowsPE -->
|
|
||||||
<HideEULAPage>true</HideEULAPage>
|
|
||||||
|
|
||||||
<!-- KEEP false — this is the screen where the user creates -->
|
|
||||||
<!-- their local account (name + password). Setting it true -->
|
|
||||||
<!-- would skip account creation entirely, leaving only the -->
|
|
||||||
<!-- built-in Administrator account. -->
|
|
||||||
<HideLocalAccountScreen>false</HideLocalAccountScreen>
|
|
||||||
|
|
||||||
<!-- Suppress "Sign in with Microsoft" screens.
|
|
||||||
The user goes straight to local account creation. -->
|
|
||||||
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
|
|
||||||
|
|
||||||
<!-- Skip Wi-Fi setup — can be connected after first login -->
|
|
||||||
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
|
|
||||||
|
|
||||||
<!-- Suppress the privacy / recommended-settings nag screen -->
|
|
||||||
<ProtectYourPC>3</ProtectYourPC>
|
<ProtectYourPC>3</ProtectYourPC>
|
||||||
|
<HideEULAPage>true</HideEULAPage>
|
||||||
|
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
|
||||||
|
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
|
||||||
</OOBE>
|
</OOBE>
|
||||||
|
|
||||||
<!--
|
|
||||||
UserAccounts and AutoLogon are intentionally absent.
|
|
||||||
The user creates their own account on the OOBE screen above.
|
|
||||||
This is the safest and most universally applicable approach:
|
|
||||||
no hardcoded credentials ship inside the answer file.
|
|
||||||
|
|
||||||
If you want to pre-create an account instead, add:
|
|
||||||
|
|
||||||
<UserAccounts>
|
|
||||||
<LocalAccounts>
|
|
||||||
<LocalAccount wcm:action="add">
|
|
||||||
<Name>YourUsername</Name>
|
|
||||||
<Password>
|
|
||||||
<Value>YourPassword</Value>
|
|
||||||
<PlainText>true</PlainText>
|
|
||||||
</Password>
|
|
||||||
<DisplayName>Your Full Name</DisplayName>
|
|
||||||
<Group>Administrators</Group>
|
|
||||||
</LocalAccount>
|
|
||||||
</LocalAccounts>
|
|
||||||
</UserAccounts>
|
|
||||||
<AutoLogon>
|
|
||||||
<Enabled>true</Enabled>
|
|
||||||
<LogonCount>1</LogonCount>
|
|
||||||
<Username>YourUsername</Username>
|
|
||||||
<Password>
|
|
||||||
<Value>YourPassword</Value>
|
|
||||||
<PlainText>true</PlainText>
|
|
||||||
</Password>
|
|
||||||
</AutoLogon>
|
|
||||||
|
|
||||||
And set HideLocalAccountScreen to true above.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Optional: run a script on first logon.
|
|
||||||
Uncomment and adjust the path/command as needed.
|
|
||||||
|
|
||||||
<FirstLogonCommands>
|
<FirstLogonCommands>
|
||||||
<SynchronousCommand wcm:action="add">
|
<SynchronousCommand wcm:action="add">
|
||||||
<Order>1</Order>
|
<Order>1</Order>
|
||||||
<CommandLine>powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://christitus.com/win | iex"</CommandLine>
|
<CommandLine>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\FirstLogon.ps1"</CommandLine>
|
||||||
<Description>Launch WinUtil post-install</Description>
|
|
||||||
<RequiresUserInput>false</RequiresUserInput>
|
|
||||||
</SynchronousCommand>
|
</SynchronousCommand>
|
||||||
</FirstLogonCommands>
|
</FirstLogonCommands>
|
||||||
-->
|
|
||||||
|
|
||||||
</component>
|
</component>
|
||||||
</settings>
|
</settings>
|
||||||
|
<Extensions xmlns="https://schneegans.de/windows/unattend-generator/">
|
||||||
|
<ExtractScript>
|
||||||
|
param(
|
||||||
|
[xml]$Document
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach( $file in $Document.unattend.Extensions.File ) {
|
||||||
|
$path = [System.Environment]::ExpandEnvironmentVariables( $file.GetAttribute( 'path' ) );
|
||||||
|
mkdir -Path( $path | Split-Path -Parent ) -ErrorAction 'SilentlyContinue';
|
||||||
|
$encoding = switch( [System.IO.Path]::GetExtension( $path ) ) {
|
||||||
|
{ $_ -in '.ps1', '.xml' } { [System.Text.Encoding]::UTF8; }
|
||||||
|
{ $_ -in '.reg', '.vbs', '.js' } { [System.Text.UnicodeEncoding]::new( $false, $true ); }
|
||||||
|
default { [System.Text.Encoding]::Default; }
|
||||||
|
};
|
||||||
|
$bytes = $encoding.GetPreamble() + $encoding.GetBytes( $file.InnerText.Trim() );
|
||||||
|
[System.IO.File]::WriteAllBytes( $path, $bytes );
|
||||||
|
}
|
||||||
|
</ExtractScript>
|
||||||
|
<File path="C:\Windows\Setup\Scripts\TaskbarLayoutModification.xml">
|
||||||
|
<LayoutModificationTemplate xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification" xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout" xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout" Version="1">
|
||||||
|
<CustomTaskbarLayoutCollection PinListPlacement="Replace">
|
||||||
|
<defaultlayout:TaskbarLayout>
|
||||||
|
<taskbar:TaskbarPinList>
|
||||||
|
<taskbar:DesktopApp DesktopApplicationLinkPath="#leaveempty" />
|
||||||
|
</taskbar:TaskbarPinList>
|
||||||
|
</defaultlayout:TaskbarLayout>
|
||||||
|
</CustomTaskbarLayoutCollection>
|
||||||
|
</LayoutModificationTemplate>
|
||||||
|
</File>
|
||||||
|
<File path="C:\Windows\Setup\Scripts\UnlockStartLayout.vbs">
|
||||||
|
HKU = &H80000003
|
||||||
|
Set reg = GetObject("winmgmts://./root/default:StdRegProv")
|
||||||
|
Set fso = CreateObject("Scripting.FileSystemObject")
|
||||||
|
|
||||||
|
If reg.EnumKey(HKU, "", sids) = 0 Then
|
||||||
|
If Not IsNull(sids) Then
|
||||||
|
For Each sid In sids
|
||||||
|
key = sid + "\Software\Policies\Microsoft\Windows\Explorer"
|
||||||
|
name = "LockedStartLayout"
|
||||||
|
If reg.GetDWORDValue(HKU, key, name, existing) = 0 Then
|
||||||
|
reg.SetDWORDValue HKU, key, name, 0
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
</File>
|
||||||
|
<File path="C:\Windows\Setup\Scripts\UnlockStartLayout.xml">
|
||||||
|
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
|
||||||
|
<Triggers>
|
||||||
|
<EventTrigger>
|
||||||
|
<Enabled>true</Enabled>
|
||||||
|
<Subscription>&lt;QueryList&gt;&lt;Query Id="0" Path="Application"&gt;&lt;Select Path="Application"&gt;*[System[Provider[@Name='UnattendGenerator'] and EventID=1]]&lt;/Select&gt;&lt;/Query&gt;&lt;/QueryList&gt;</Subscription>
|
||||||
|
</EventTrigger>
|
||||||
|
</Triggers>
|
||||||
|
<Principals>
|
||||||
|
<Principal id="Author">
|
||||||
|
<UserId>S-1-5-18</UserId>
|
||||||
|
<RunLevel>LeastPrivilege</RunLevel>
|
||||||
|
</Principal>
|
||||||
|
</Principals>
|
||||||
|
<Settings>
|
||||||
|
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
|
||||||
|
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
|
||||||
|
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
|
||||||
|
<AllowHardTerminate>true</AllowHardTerminate>
|
||||||
|
<StartWhenAvailable>false</StartWhenAvailable>
|
||||||
|
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
|
||||||
|
<IdleSettings>
|
||||||
|
<StopOnIdleEnd>true</StopOnIdleEnd>
|
||||||
|
<RestartOnIdle>false</RestartOnIdle>
|
||||||
|
</IdleSettings>
|
||||||
|
<AllowStartOnDemand>true</AllowStartOnDemand>
|
||||||
|
<Enabled>true</Enabled>
|
||||||
|
<Hidden>false</Hidden>
|
||||||
|
<RunOnlyIfIdle>false</RunOnlyIfIdle>
|
||||||
|
<WakeToRun>false</WakeToRun>
|
||||||
|
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
|
||||||
|
<Priority>7</Priority>
|
||||||
|
</Settings>
|
||||||
|
<Actions Context="Author">
|
||||||
|
<Exec>
|
||||||
|
<Command>C:\Windows\System32\wscript.exe</Command>
|
||||||
|
<Arguments>C:\Windows\Setup\Scripts\UnlockStartLayout.vbs</Arguments>
|
||||||
|
</Exec>
|
||||||
|
</Actions>
|
||||||
|
</Task>
|
||||||
|
</File>
|
||||||
|
<File path="C:\Windows\Setup\Scripts\SetStartPins.ps1">
|
||||||
|
$json = '{"pinnedList":[]}';
|
||||||
|
if( [System.Environment]::OSVersion.Version.Build -lt 20000 ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$key = 'Registry::HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start';
|
||||||
|
New-Item -Path $key -ItemType 'Directory' -ErrorAction 'SilentlyContinue';
|
||||||
|
Set-ItemProperty -LiteralPath $key -Name 'ConfigureStartPins' -Value $json -Type 'String';
|
||||||
|
</File>
|
||||||
|
<File path="C:\Windows\Setup\Scripts\SetColorTheme.ps1">
|
||||||
|
$lightThemeSystem = 0;
|
||||||
|
$lightThemeApps = 0;
|
||||||
|
$accentColorOnStart = 0;
|
||||||
|
$enableTransparency = 0;
|
||||||
|
$htmlAccentColor = '#0078D4';
|
||||||
|
& {
|
||||||
|
$params = @{
|
||||||
|
LiteralPath = 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize';
|
||||||
|
Force = $true;
|
||||||
|
Type = 'DWord';
|
||||||
|
};
|
||||||
|
Set-ItemProperty @params -Name 'SystemUsesLightTheme' -Value $lightThemeSystem;
|
||||||
|
Set-ItemProperty @params -Name 'AppsUseLightTheme' -Value $lightThemeApps;
|
||||||
|
Set-ItemProperty @params -Name 'ColorPrevalence' -Value $accentColorOnStart;
|
||||||
|
Set-ItemProperty @params -Name 'EnableTransparency' -Value $enableTransparency;
|
||||||
|
};
|
||||||
|
& {
|
||||||
|
Add-Type -AssemblyName 'System.Drawing';
|
||||||
|
$accentColor = [System.Drawing.ColorTranslator]::FromHtml( $htmlAccentColor );
|
||||||
|
|
||||||
|
function ConvertTo-DWord {
|
||||||
|
param(
|
||||||
|
[System.Drawing.Color]
|
||||||
|
$Color
|
||||||
|
);
|
||||||
|
|
||||||
|
[byte[]]$bytes = @(
|
||||||
|
$Color.R;
|
||||||
|
$Color.G;
|
||||||
|
$Color.B;
|
||||||
|
$Color.A;
|
||||||
|
);
|
||||||
|
return [System.BitConverter]::ToUInt32( $bytes, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
$startColor = [System.Drawing.Color]::FromArgb( 0xD2, $accentColor );
|
||||||
|
Set-ItemProperty -LiteralPath 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Accent' -Name 'StartColorMenu' -Value( ConvertTo-DWord -Color $accentColor ) -Type 'DWord' -Force;
|
||||||
|
Set-ItemProperty -LiteralPath 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Accent' -Name 'AccentColorMenu' -Value( ConvertTo-DWord -Color $accentColor ) -Type 'DWord' -Force;
|
||||||
|
Set-ItemProperty -LiteralPath 'Registry::HKCU\Software\Microsoft\Windows\DWM' -Name 'AccentColor' -Value( ConvertTo-DWord -Color $accentColor ) -Type 'DWord' -Force;
|
||||||
|
$params = @{
|
||||||
|
LiteralPath = 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Accent';
|
||||||
|
Name = 'AccentPalette';
|
||||||
|
};
|
||||||
|
$palette = Get-ItemPropertyValue @params;
|
||||||
|
$index = 20;
|
||||||
|
$palette[ $index++ ] = $accentColor.R;
|
||||||
|
$palette[ $index++ ] = $accentColor.G;
|
||||||
|
$palette[ $index++ ] = $accentColor.B;
|
||||||
|
$palette[ $index++ ] = $accentColor.A;
|
||||||
|
Set-ItemProperty @params -Value $palette -Type 'Binary' -Force;
|
||||||
|
};
|
||||||
|
</File>
|
||||||
|
<File path="C:\Windows\Setup\Scripts\Specialize.ps1">
|
||||||
|
$scripts = @(
|
||||||
|
{
|
||||||
|
reg.exe add "HKLM\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
net.exe accounts /maxpwage:UNLIMITED;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableCloudOptimizedContent" /t REG_DWORD /d 1 /f;
|
||||||
|
[System.Diagnostics.EventLog]::CreateEventSource( 'UnattendGenerator', 'Application' );
|
||||||
|
};
|
||||||
|
{
|
||||||
|
Register-ScheduledTask -TaskName 'UnlockStartLayout' -Xml $( Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\UnlockStartLayout.xml' -Raw );
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f
|
||||||
|
};
|
||||||
|
{
|
||||||
|
Remove-Item -LiteralPath 'C:\Users\Public\Desktop\Microsoft Edge.lnk' -ErrorAction 'SilentlyContinue' -Verbose;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Dsh" /v AllowNewsAndInterests /t REG_DWORD /d 0 /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKLM\Software\Policies\Microsoft\Edge" /v HideFirstRunExperience /t REG_DWORD /d 1 /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKLM\Software\Policies\Microsoft\Edge\Recommended" /v BackgroundModeEnabled /t REG_DWORD /d 0 /f;
|
||||||
|
reg.exe add "HKLM\Software\Policies\Microsoft\Edge\Recommended" /v StartupBoostEnabled /t REG_DWORD /d 0 /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
& 'C:\Windows\Setup\Scripts\SetStartPins.ps1';
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKU\.DEFAULT\Control Panel\Accessibility\StickyKeys" /v Flags /t REG_SZ /d 10 /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /t REG_DWORD /d 1 /f;
|
||||||
|
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DisableWindowsUpdateAccess /t REG_DWORD /d 1 /f;
|
||||||
|
};
|
||||||
|
);
|
||||||
|
|
||||||
|
& {
|
||||||
|
[float]$complete = 0;
|
||||||
|
[float]$increment = 100 / $scripts.Count;
|
||||||
|
foreach( $script in $scripts ) {
|
||||||
|
Write-Progress -Id 0 -Activity 'Running scripts to customize your Windows installation. Do not close this window.' -PercentComplete $complete;
|
||||||
|
'*** Will now execute command «{0}».' -f $(
|
||||||
|
$str = $script.ToString().Trim() -replace '\s+', ' ';
|
||||||
|
$max = 100;
|
||||||
|
if( $str.Length -le $max ) {
|
||||||
|
$str;
|
||||||
|
} else {
|
||||||
|
$str.Substring( 0, $max - 1 ) + '…';
|
||||||
|
}
|
||||||
|
);
|
||||||
|
$start = [datetime]::Now;
|
||||||
|
& $script;
|
||||||
|
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
|
||||||
|
"`r`n" * 3;
|
||||||
|
$complete += $increment;
|
||||||
|
}
|
||||||
|
} *>&1 | Out-String -Width 1KB -Stream >> "C:\Windows\Setup\Scripts\Specialize.log";
|
||||||
|
</File>
|
||||||
|
<File path="C:\Windows\Setup\Scripts\UserOnce.ps1">
|
||||||
|
$scripts = @(
|
||||||
|
{
|
||||||
|
[System.Diagnostics.EventLog]::WriteEntry( 'UnattendGenerator', "User '$env:USERNAME' has requested to unlock the Start menu layout.", [System.Diagnostics.EventLogEntryType]::Information, 1 );
|
||||||
|
};
|
||||||
|
{
|
||||||
|
Remove-Item -Path "${env:USERPROFILE}\Desktop\*.lnk" -Force -ErrorAction 'SilentlyContinue';
|
||||||
|
Remove-Item -Path "$env:HOMEDRIVE\Users\Default\Desktop\*.lnk" -Force -ErrorAction 'SilentlyContinue';
|
||||||
|
};
|
||||||
|
{
|
||||||
|
$taskbarPath = "$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar";
|
||||||
|
if( Test-Path $taskbarPath ) {
|
||||||
|
Get-ChildItem -Path $taskbarPath -File | Remove-Item -Force;
|
||||||
|
}
|
||||||
|
Remove-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband' -Name 'FavoritesRemovedChanges' -Force -ErrorAction 'SilentlyContinue';
|
||||||
|
Remove-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband' -Name 'FavoritesChanges' -Force -ErrorAction 'SilentlyContinue';
|
||||||
|
Remove-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband' -Name 'Favorites' -Force -ErrorAction 'SilentlyContinue';
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /ve /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
Set-ItemProperty -LiteralPath 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'LaunchTo' -Type 'DWord' -Value 1;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
Set-ItemProperty -LiteralPath 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Search' -Name 'SearchboxTaskbarMode' -Type 'DWord' -Value 0;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
& 'C:\Windows\Setup\Scripts\SetColorTheme.ps1';
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.Suggested" /f;
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.Suggested" /v Enabled /t REG_DWORD /d 0 /f;
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.StartupApp" /f;
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.StartupApp" /v Enabled /t REG_DWORD /d 0 /f;
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.SkyDrive.Desktop" /f;
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.SkyDrive.Desktop" /v Enabled /t REG_DWORD /d 0 /f;
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.AccountHealth" /f;
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.AccountHealth" /v Enabled /t REG_DWORD /d 0 /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Start" /v AllAppsViewMode /t REG_DWORD /d 2 /f;
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_IrisRecommendations /t REG_DWORD /d 0 /f;
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_AccountNotifications /t REG_DWORD /d 0 /f;
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Start" /v ShowAllPinsList /t REG_DWORD /d 0 /f;
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Start" /v ShowFrequentList /t REG_DWORD /d 0 /f;
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Start" /v ShowRecentList /t REG_DWORD /d 0 /f;
|
||||||
|
reg.exe add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_TrackDocs /t REG_DWORD /d 0 /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
Add-Type -TypeDefinition @"
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
public class Win32Broadcast {
|
||||||
|
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
|
||||||
|
public static extern IntPtr SendMessageTimeout(
|
||||||
|
IntPtr hWnd,
|
||||||
|
uint Msg,
|
||||||
|
IntPtr wParam,
|
||||||
|
string lParam,
|
||||||
|
uint fuFlags,
|
||||||
|
uint uTimeout,
|
||||||
|
out IntPtr lpdwResult);
|
||||||
|
}
|
||||||
|
"@;
|
||||||
|
[Win32Broadcast]::SendMessageTimeout( [IntPtr]0xffff, 0x1A, [IntPtr]::Zero, 'ImmersiveColorSet', 0x2, 100, [ref]([IntPtr]::Zero) );
|
||||||
|
};
|
||||||
|
{
|
||||||
|
Get-Process -Name 'explorer' -ErrorAction 'SilentlyContinue' | Where-Object -FilterScript {
|
||||||
|
$_.SessionId -eq ( Get-Process -Id $PID ).SessionId;
|
||||||
|
} | Stop-Process -Force;
|
||||||
|
};
|
||||||
|
);
|
||||||
|
|
||||||
|
& {
|
||||||
|
[float]$complete = 0;
|
||||||
|
[float]$increment = 100 / $scripts.Count;
|
||||||
|
foreach( $script in $scripts ) {
|
||||||
|
Write-Progress -Id 0 -Activity 'Running scripts to configure this user account. Do not close this window.' -PercentComplete $complete;
|
||||||
|
'*** Will now execute command «{0}».' -f $(
|
||||||
|
$str = $script.ToString().Trim() -replace '\s+', ' ';
|
||||||
|
$max = 100;
|
||||||
|
if( $str.Length -le $max ) {
|
||||||
|
$str;
|
||||||
|
} else {
|
||||||
|
$str.Substring( 0, $max - 1 ) + '…';
|
||||||
|
}
|
||||||
|
);
|
||||||
|
$start = [datetime]::Now;
|
||||||
|
& $script;
|
||||||
|
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
|
||||||
|
"`r`n" * 3;
|
||||||
|
$complete += $increment;
|
||||||
|
}
|
||||||
|
} *>&1 | Out-String -Width 1KB -Stream >> "$env:TEMP\UserOnce.log";
|
||||||
|
</File>
|
||||||
|
<File path="C:\Windows\Setup\Scripts\DefaultUser.ps1">
|
||||||
|
$scripts = @(
|
||||||
|
{
|
||||||
|
reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\Explorer" /v "StartLayoutFile" /t REG_SZ /d "C:\Windows\Setup\Scripts\TaskbarLayoutModification.xml" /f;
|
||||||
|
reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\Explorer" /v "LockedStartLayout" /t REG_DWORD /d 1 /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowTaskViewButton /t REG_DWORD /d 0 /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarAl /t REG_DWORD /d 0 /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
foreach( $root in 'Registry::HKU\.DEFAULT', 'Registry::HKU\DefaultUser' ) {
|
||||||
|
Set-ItemProperty -LiteralPath "$root\Control Panel\Keyboard" -Name 'InitialKeyboardIndicators' -Type 'String' -Value 2 -Force;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\TaskbarDeveloperSettings" /v TaskbarEndTask /t REG_DWORD /d 1 /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKU\DefaultUser\Control Panel\Accessibility\StickyKeys" /v Flags /t REG_SZ /d 10 /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\DWM" /v ColorPrevalence /t REG_DWORD /d 0 /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "UnattendedSetup" /t REG_SZ /d "powershell.exe -WindowStyle \""Normal\"" -ExecutionPolicy \""Unrestricted\"" -NoProfile -File \""C:\Windows\Setup\Scripts\UserOnce.ps1\""" /f;
|
||||||
|
};
|
||||||
|
);
|
||||||
|
|
||||||
|
& {
|
||||||
|
[float]$complete = 0;
|
||||||
|
[float]$increment = 100 / $scripts.Count;
|
||||||
|
foreach( $script in $scripts ) {
|
||||||
|
Write-Progress -Id 0 -Activity 'Running scripts to modify the default user’’s registry hive. Do not close this window.' -PercentComplete $complete;
|
||||||
|
'*** Will now execute command «{0}».' -f $(
|
||||||
|
$str = $script.ToString().Trim() -replace '\s+', ' ';
|
||||||
|
$max = 100;
|
||||||
|
if( $str.Length -le $max ) {
|
||||||
|
$str;
|
||||||
|
} else {
|
||||||
|
$str.Substring( 0, $max - 1 ) + '…';
|
||||||
|
}
|
||||||
|
);
|
||||||
|
$start = [datetime]::Now;
|
||||||
|
& $script;
|
||||||
|
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
|
||||||
|
"`r`n" * 3;
|
||||||
|
$complete += $increment;
|
||||||
|
}
|
||||||
|
} *>&1 | Out-String -Width 1KB -Stream >> "C:\Windows\Setup\Scripts\DefaultUser.log";
|
||||||
|
</File>
|
||||||
|
<File path="C:\Windows\Setup\Scripts\FirstLogon.ps1">
|
||||||
|
$scripts = @(
|
||||||
|
{
|
||||||
|
cmd.exe /c "rmdir C:\Windows.old";
|
||||||
|
};
|
||||||
|
{
|
||||||
|
Remove-Item -LiteralPath @(
|
||||||
|
'C:\Windows\Panther\unattend.xml';
|
||||||
|
'C:\Windows\Panther\unattend-original.xml';
|
||||||
|
'C:\Windows\Setup\Scripts\Wifi.xml';
|
||||||
|
) -Force -ErrorAction 'SilentlyContinue' -Verbose;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
reg.exe delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /f;
|
||||||
|
reg.exe delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DisableWindowsUpdateAccess /f;
|
||||||
|
};
|
||||||
|
{
|
||||||
|
$recallFeature = Get-WindowsOptionalFeature -Online -ErrorAction SilentlyContinue | Where-Object { $_.State -eq 'Enabled' -and $_.FeatureName -like 'Recall' };
|
||||||
|
if( $recallFeature ) {
|
||||||
|
Disable-WindowsOptionalFeature -Online -FeatureName 'Recall' -Remove -ErrorAction SilentlyContinue;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$viveDir = Join-Path $env:TEMP 'ViVeTool';
|
||||||
|
$viveZip = Join-Path $env:TEMP 'ViVeTool.zip';
|
||||||
|
Invoke-WebRequest 'https://github.com/thebookisclosed/ViVe/releases/download/v0.3.4/ViVeTool-v0.3.4-IntelAmd.zip' -OutFile $viveZip;
|
||||||
|
Expand-Archive -Path $viveZip -DestinationPath $viveDir -Force;
|
||||||
|
Remove-Item -Path $viveZip -Force;
|
||||||
|
Start-Process -FilePath (Join-Path $viveDir 'ViVeTool.exe') -ArgumentList '/disable /id:47205210' -Wait -NoNewWindow;
|
||||||
|
Remove-Item -Path $viveDir -Recurse -Force;
|
||||||
|
} catch {}
|
||||||
|
};
|
||||||
|
{
|
||||||
|
if( (Get-BitLockerVolume -MountPoint $Env:SystemDrive).ProtectionStatus -eq 'On' ) {
|
||||||
|
Disable-BitLocker -MountPoint $Env:SystemDrive;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
{
|
||||||
|
if( (bcdedit | Select-String 'path').Count -eq 2 ) {
|
||||||
|
bcdedit /set `{bootmgr`} timeout 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
);
|
||||||
|
|
||||||
|
& {
|
||||||
|
[float]$complete = 0;
|
||||||
|
[float]$increment = 100 / $scripts.Count;
|
||||||
|
foreach( $script in $scripts ) {
|
||||||
|
Write-Progress -Id 0 -Activity 'Running scripts to finalize your Windows installation. Do not close this window.' -PercentComplete $complete;
|
||||||
|
'*** Will now execute command «{0}».' -f $(
|
||||||
|
$str = $script.ToString().Trim() -replace '\s+', ' ';
|
||||||
|
$max = 100;
|
||||||
|
if( $str.Length -le $max ) {
|
||||||
|
$str;
|
||||||
|
} else {
|
||||||
|
$str.Substring( 0, $max - 1 ) + '…';
|
||||||
|
}
|
||||||
|
);
|
||||||
|
$start = [datetime]::Now;
|
||||||
|
& $script;
|
||||||
|
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
|
||||||
|
"`r`n" * 3;
|
||||||
|
$complete += $increment;
|
||||||
|
}
|
||||||
|
} *>&1 | Out-String -Width 1KB -Stream >> "C:\Windows\Setup\Scripts\FirstLogon.log";
|
||||||
|
</File>
|
||||||
|
</Extensions>
|
||||||
</unattend>
|
</unattend>
|
||||||
|
|||||||
@@ -970,11 +970,11 @@
|
|||||||
</TextBlock>
|
</TextBlock>
|
||||||
</ToggleButton.Content>
|
</ToggleButton.Content>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
<ToggleButton Margin="0,0,5,0" Height="{DynamicResource TabButtonHeight}" Width="{DynamicResource TabButtonWidth}"
|
<ToggleButton Margin="0,0,5,0" Height="{DynamicResource TabButtonHeight}" Width="Auto" MinWidth="{DynamicResource TabButtonWidth}"
|
||||||
Background="{DynamicResource ButtonWin11ISOBackgroundColor}" Foreground="{DynamicResource ButtonWin11ISOForegroundColor}" FontWeight="Bold" Name="WPFTab5BT">
|
Background="{DynamicResource ButtonWin11ISOBackgroundColor}" Foreground="{DynamicResource ButtonWin11ISOForegroundColor}" FontWeight="Bold" Name="WPFTab5BT">
|
||||||
<ToggleButton.Content>
|
<ToggleButton.Content>
|
||||||
<TextBlock FontSize="{DynamicResource TabButtonFontSize}" Background="Transparent" Foreground="{DynamicResource ButtonWin11ISOForegroundColor}">
|
<TextBlock FontSize="{DynamicResource TabButtonFontSize}" Background="Transparent" Foreground="{DynamicResource ButtonWin11ISOForegroundColor}">
|
||||||
<Underline>W</Underline>in11ISO
|
<Underline>W</Underline>in11 Creator
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</ToggleButton.Content>
|
</ToggleButton.Content>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
@@ -1353,7 +1353,7 @@
|
|||||||
<!-- ═══════════════════════════════════════════════════════════ -->
|
<!-- ═══════════════════════════════════════════════════════════ -->
|
||||||
<!-- STEP 1 : Select Windows 11 ISO -->
|
<!-- STEP 1 : Select Windows 11 ISO -->
|
||||||
<!-- ═══════════════════════════════════════════════════════════ -->
|
<!-- ═══════════════════════════════════════════════════════════ -->
|
||||||
<Border Grid.Row="0" Style="{StaticResource BorderStyle}">
|
<Border Grid.Row="0" Name="WPFWin11ISOSelectSection" Style="{StaticResource BorderStyle}">
|
||||||
<Grid Margin="5">
|
<Grid Margin="5">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
@@ -1364,13 +1364,17 @@
|
|||||||
<StackPanel Grid.Column="0" Margin="5,5,15,5">
|
<StackPanel Grid.Column="0" Margin="5,5,15,5">
|
||||||
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
|
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
|
||||||
Foreground="{DynamicResource MainForegroundColor}" Margin="0,0,0,8">
|
Foreground="{DynamicResource MainForegroundColor}" Margin="0,0,0,8">
|
||||||
Step 1 — Select Windows 11 ISO
|
Step 1 - Select Windows 11 ISO
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock FontSize="{DynamicResource FontSize}" Foreground="{DynamicResource MainForegroundColor}"
|
<TextBlock FontSize="{DynamicResource FontSize}" Foreground="{DynamicResource MainForegroundColor}"
|
||||||
TextWrapping="Wrap" Margin="0,0,0,12">
|
TextWrapping="Wrap" Margin="0,0,0,6">
|
||||||
Browse to your locally saved Windows 11 ISO file. Only official ISOs
|
Browse to your locally saved Windows 11 ISO file. Only official ISOs
|
||||||
downloaded from Microsoft are supported.
|
downloaded from Microsoft are supported.
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
<TextBlock FontSize="{DynamicResource FontSize}" Foreground="{DynamicResource MainForegroundColor}"
|
||||||
|
TextWrapping="Wrap" Margin="0,0,0,12" FontStyle="Italic">
|
||||||
|
<Run FontWeight="Bold">NOTE:</Run> This is only meant for Fresh and New Windows installs.
|
||||||
|
</TextBlock>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
@@ -1387,7 +1391,7 @@
|
|||||||
Background="{DynamicResource MainBackgroundColor}"/>
|
Background="{DynamicResource MainBackgroundColor}"/>
|
||||||
<Button Grid.Column="1"
|
<Button Grid.Column="1"
|
||||||
Name="WPFWin11ISOBrowseButton"
|
Name="WPFWin11ISOBrowseButton"
|
||||||
Content="Browse…"
|
Content="Browse"
|
||||||
Width="Auto" Padding="12,0"
|
Width="Auto" Padding="12,0"
|
||||||
Height="{DynamicResource ButtonHeight}"/>
|
Height="{DynamicResource ButtonHeight}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -1408,7 +1412,7 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
|
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
|
||||||
Foreground="OrangeRed" Margin="0,0,0,10">
|
Foreground="OrangeRed" Margin="0,0,0,10">
|
||||||
⚠ You must use an official Microsoft ISO
|
!!WARNING!! You must use an official Microsoft ISO
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock FontSize="{DynamicResource FontSize}"
|
<TextBlock FontSize="{DynamicResource FontSize}"
|
||||||
Foreground="{DynamicResource MainForegroundColor}"
|
Foreground="{DynamicResource MainForegroundColor}"
|
||||||
@@ -1425,9 +1429,9 @@
|
|||||||
<TextBlock FontSize="{DynamicResource FontSize}"
|
<TextBlock FontSize="{DynamicResource FontSize}"
|
||||||
Foreground="{DynamicResource MainForegroundColor}"
|
Foreground="{DynamicResource MainForegroundColor}"
|
||||||
TextWrapping="Wrap" Margin="12,0,0,12">
|
TextWrapping="Wrap" Margin="12,0,0,12">
|
||||||
• Edition : Windows 11
|
- Edition : Windows 11
|
||||||
<LineBreak/>• Language : your preferred language
|
<LineBreak/>- Language : your preferred language
|
||||||
<LineBreak/>• Architecture : 64-bit (x64)
|
<LineBreak/>- Architecture : 64-bit (x64)
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Button Name="WPFWin11ISODownloadLink"
|
<Button Name="WPFWin11ISODownloadLink"
|
||||||
Content="Open Microsoft Download Page"
|
Content="Open Microsoft Download Page"
|
||||||
@@ -1455,7 +1459,7 @@
|
|||||||
<StackPanel Grid.Column="0" Margin="0,0,20,0" VerticalAlignment="Top">
|
<StackPanel Grid.Column="0" Margin="0,0,20,0" VerticalAlignment="Top">
|
||||||
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
|
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
|
||||||
Foreground="{DynamicResource MainForegroundColor}" Margin="0,0,0,8">
|
Foreground="{DynamicResource MainForegroundColor}" Margin="0,0,0,8">
|
||||||
Step 2 — Mount & Verify ISO
|
Step 2 - Mount & Verify ISO
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock FontSize="{DynamicResource FontSize}"
|
<TextBlock FontSize="{DynamicResource FontSize}"
|
||||||
Foreground="{DynamicResource MainForegroundColor}"
|
Foreground="{DynamicResource MainForegroundColor}"
|
||||||
@@ -1490,12 +1494,15 @@
|
|||||||
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
|
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
|
||||||
Foreground="{DynamicResource MainForegroundColor}"
|
Foreground="{DynamicResource MainForegroundColor}"
|
||||||
Margin="0,6,0,4">
|
Margin="0,6,0,4">
|
||||||
Available Editions:
|
Select Edition:
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Name="WPFWin11ISOEditionList"
|
<ComboBox Name="WPFWin11ISOEditionComboBox"
|
||||||
FontSize="{DynamicResource FontSize}"
|
FontSize="{DynamicResource FontSize}"
|
||||||
Foreground="{DynamicResource MainForegroundColor}"
|
Foreground="{DynamicResource MainForegroundColor}"
|
||||||
TextWrapping="Wrap"/>
|
Background="{DynamicResource MainBackgroundColor}"
|
||||||
|
BorderBrush="{DynamicResource BorderColor}"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Margin="0,0,0,0"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -1511,7 +1518,7 @@
|
|||||||
<StackPanel Margin="5">
|
<StackPanel Margin="5">
|
||||||
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
|
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
|
||||||
Foreground="{DynamicResource MainForegroundColor}" Margin="0,0,0,8">
|
Foreground="{DynamicResource MainForegroundColor}" Margin="0,0,0,8">
|
||||||
Step 3 — Modify install.wim
|
Step 3 - Modify install.wim
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock FontSize="{DynamicResource FontSize}"
|
<TextBlock FontSize="{DynamicResource FontSize}"
|
||||||
Foreground="{DynamicResource MainForegroundColor}"
|
Foreground="{DynamicResource MainForegroundColor}"
|
||||||
@@ -1522,7 +1529,7 @@
|
|||||||
depending on your hardware.
|
depending on your hardware.
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Button Name="WPFWin11ISOModifyButton"
|
<Button Name="WPFWin11ISOModifyButton"
|
||||||
Content="Run install.wim Modification"
|
Content="Run Windows ISO Modification and Creator"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Width="Auto" Padding="12,0"
|
Width="Auto" Padding="12,0"
|
||||||
Height="{DynamicResource ButtonHeight}"/>
|
Height="{DynamicResource ButtonHeight}"/>
|
||||||
@@ -1534,41 +1541,64 @@
|
|||||||
<!-- ═══════════════════════════════════════════════════════════ -->
|
<!-- ═══════════════════════════════════════════════════════════ -->
|
||||||
<Border Grid.Row="3"
|
<Border Grid.Row="3"
|
||||||
Name="WPFWin11ISOOutputSection"
|
Name="WPFWin11ISOOutputSection"
|
||||||
Style="{StaticResource BorderStyle}"
|
Style="{StaticResource BorderStyle}">
|
||||||
Visibility="Collapsed">
|
|
||||||
<StackPanel Margin="5">
|
<StackPanel Margin="5">
|
||||||
<TextBlock FontSize="{DynamicResource FontSize}" FontWeight="Bold"
|
<!-- Header row: title + Clean & Reset button -->
|
||||||
Foreground="{DynamicResource MainForegroundColor}" Margin="0,0,0,12">
|
<Grid Margin="0,0,0,12">
|
||||||
Step 4 — Output: What would you like to do with the modified ISO?
|
|
||||||
</TextBlock>
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Grid.Column="0" FontSize="{DynamicResource FontSize}" FontWeight="Bold"
|
||||||
<!-- Option 1: Export to ISO -->
|
Foreground="{DynamicResource MainForegroundColor}"
|
||||||
<Border Grid.Column="0" Style="{StaticResource BorderStyle}">
|
VerticalAlignment="Center">
|
||||||
<StackPanel>
|
Step 4 - Output: What would you like to do with the modified image?
|
||||||
<Button Name="WPFWin11ISOExportButton"
|
</TextBlock>
|
||||||
Content="1 — Export to ISO"
|
<Button Grid.Column="1"
|
||||||
HorizontalAlignment="Stretch"
|
Name="WPFWin11ISOCleanResetButton"
|
||||||
|
Content="Clean & Reset"
|
||||||
|
Foreground="OrangeRed"
|
||||||
Width="Auto" Padding="12,0"
|
Width="Auto" Padding="12,0"
|
||||||
Height="{DynamicResource ButtonHeight}"
|
Height="{DynamicResource ButtonHeight}"
|
||||||
Margin="0,0,0,10"/>
|
ToolTip="Delete the temporary working directory and reset the interface back to Step 1"
|
||||||
|
Margin="12,0,0,0"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- ── Choice prompt buttons ── -->
|
||||||
|
<Grid Margin="0,0,0,12">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="16"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Button Grid.Column="0"
|
||||||
|
Name="WPFWin11ISOChooseISOButton"
|
||||||
|
Content="Save as an ISO File"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Width="Auto" Padding="12,0"
|
||||||
|
Height="{DynamicResource ButtonHeight}"/>
|
||||||
|
<Button Grid.Column="2"
|
||||||
|
Name="WPFWin11ISOChooseUSBButton"
|
||||||
|
Content="Write Directly to a USB Drive (erases drive)"
|
||||||
|
Foreground="OrangeRed"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Width="Auto" Padding="12,0"
|
||||||
|
Height="{DynamicResource ButtonHeight}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- ── USB write sub-panel (revealed on USB choice) ── -->
|
||||||
|
<Border Name="WPFWin11ISOOptionUSB"
|
||||||
|
Style="{StaticResource BorderStyle}"
|
||||||
|
Visibility="Collapsed"
|
||||||
|
Margin="0,8,0,0">
|
||||||
|
<StackPanel>
|
||||||
<TextBlock FontSize="{DynamicResource FontSize}"
|
<TextBlock FontSize="{DynamicResource FontSize}"
|
||||||
Foreground="{DynamicResource MainForegroundColor}"
|
Foreground="{DynamicResource MainForegroundColor}"
|
||||||
TextWrapping="Wrap">
|
TextWrapping="Wrap" Margin="0,0,0,8">
|
||||||
Save the modified content as a new bootable ISO file.
|
<Run FontWeight="Bold" Foreground="OrangeRed">!! All data on the selected USB drive will be permanently erased !!</Run>
|
||||||
You can store it, use it in a virtual machine, or later
|
<LineBreak/>
|
||||||
burn it to USB with any tool of your choice.
|
Select a removable USB drive below, then click Erase & Write.
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Option 2: Erase & Write to USB -->
|
|
||||||
<Border Grid.Column="1" Style="{StaticResource BorderStyle}">
|
|
||||||
<StackPanel>
|
|
||||||
<!-- USB drive selector row -->
|
<!-- USB drive selector row -->
|
||||||
<Grid Margin="0,0,0,8">
|
<Grid Margin="0,0,0,8">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -1588,23 +1618,15 @@
|
|||||||
Height="{DynamicResource ButtonHeight}"/>
|
Height="{DynamicResource ButtonHeight}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Button Name="WPFWin11ISOWriteUSBButton"
|
<Button Name="WPFWin11ISOWriteUSBButton"
|
||||||
Content="2 — Erase & Write to USB"
|
Content="Erase & Write to USB"
|
||||||
Foreground="OrangeRed"
|
Foreground="OrangeRed"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Width="Auto" Padding="12,0"
|
Width="Auto" Padding="12,0"
|
||||||
Height="{DynamicResource ButtonHeight}"
|
Height="{DynamicResource ButtonHeight}"
|
||||||
Margin="0,0,0,10"/>
|
Margin="0,0,0,10"/>
|
||||||
<TextBlock FontSize="{DynamicResource FontSize}"
|
|
||||||
Foreground="{DynamicResource MainForegroundColor}"
|
|
||||||
TextWrapping="Wrap">
|
|
||||||
<Run FontWeight="Bold" Foreground="OrangeRed">!! All data on the selected USB drive will be erased !!</Run>
|
|
||||||
<LineBreak/>
|
|
||||||
Select a removable USB drive above, then click the button
|
|
||||||
to write the modified Windows 11 installation directly to it.
|
|
||||||
</TextBlock>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user