Compare commits

..

21 Commits

Author SHA1 Message Date
5621b50762 fix logic 2024-08-25 17:32:30 +02:00
b02294daf9 rework how stuff is ran on automation
- install work
2024-08-25 14:49:32 +02:00
ae87100c61 improve automation
- runs everything at the same time
- does not work without displaying ui
2024-08-24 21:31:28 +02:00
cfb9edbce7 Deploying to main from @ ChrisTitusTech/winutil@bcfbce66fd 🚀 2024-08-24 15:30:45 +00:00
bcfbce66fd Remove test-path (#2585) 2024-08-22 16:02:21 -05:00
2748767a47 [MicroWin] Add custom user settings and other changes (docs/bugfixes) (#2575)
* [MicroWin] Add custom user settings

* Update inputXML.xaml

* Update MicroWin documentation to reflect changes

* Update Invoke-WinUtilMicroWin-Helper.ps1

* Update Invoke-WPFMicrowin.ps1
2024-08-19 14:21:12 -05:00
83fe6c5b12 Auto pushes docs (#2580) 2024-08-19 14:19:37 -05:00
2ea708eeb0 Make "Download" a direct link to download the latest Win11 ISO (#2574) 2024-08-19 14:06:19 -05:00
11d3c66fc0 Deploying to main from @ ChrisTitusTech/winutil@3dd51a6c3c 🚀 2024-08-18 15:30:57 +00:00
3dd51a6c3c Deploying to main from @ ChrisTitusTech/winutil@307980a7ef 🚀 2024-08-16 15:30:52 +00:00
307980a7ef Fixed VMware network driver issues (#2567) 2024-08-16 00:12:44 -05:00
93c96fafd2 Deploying to main from @ ChrisTitusTech/winutil@4d2ea15e19 🚀 2024-08-15 15:31:07 +00:00
4d2ea15e19 [MicroWin] Add try-catch block for AppX packages (#2560) 2024-08-14 14:31:24 -05:00
b0d54e41ad Update contribute.md 2024-08-14 13:54:10 -05:00
d0fa506e4f Update mkdocs.yml 2024-08-14 10:58:33 -05:00
67be99bb7b Update mkdocs.yml 2024-08-14 10:54:52 -05:00
46d9e2c437 Merge branch 'main' of https://github.com/ChrisTitusTech/winutil 2024-08-14 10:34:22 -05:00
863dd83faa Update mkdocs.yml 2024-08-14 10:34:19 -05:00
09eb4eaa00 Deploying to main from @ ChrisTitusTech/winutil@17d523d8f8 🚀 2024-08-14 15:31:03 +00:00
17d523d8f8 change file structure 2024-08-14 10:23:26 -05:00
fa17abdd49 Create SECURITY.md 2024-08-14 09:14:46 -05:00
22 changed files with 320 additions and 195 deletions

View File

5
.github/SECURITY.md vendored Normal file
View File

@ -0,0 +1,5 @@
# Security Policy
If you find a security issue please make post it in the issues tab. If you think it should be private you can email me at contact@christitus.com.
For immediate response check out our discord server @ [![](https://dcbadge.limes.pink/api/server/https://discord.gg/RUbZUZyByQ?theme=default-inverted&style=for-the-badge)](https://discord.gg/RUbZUZyByQ)

View File

@ -1,4 +1,5 @@
site_name: WinUtil Documentation site_name: WinUtil Documentation
docs_dir: '../docs'
repo_url: https://github.com/ChrisTitusTech/winutil repo_url: https://github.com/ChrisTitusTech/winutil
nav: nav:
@ -12,7 +13,7 @@ nav:
theme: theme:
name: material name: material
custom_dir: 'overrides' custom_dir: '../overrides'
features: features:
- navigation.tabs - navigation.tabs
- navigation.sections - navigation.sections

View File

@ -1,15 +1,16 @@
name: GitHub Pages Deploy name: GitHub Pages Deploy
on: on:
release: push:
types: [published, prereleased] paths:
- '.github/mkdocs.yml'
- '.github/requirements.txt'
- 'docs/**'
- 'overrides/**'
workflow_dispatch: workflow_dispatch:
permissions:
contents: write
jobs: jobs:
deploy: build-and-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -22,10 +23,10 @@ jobs:
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: 3.x # Install latest Stable release of Python 3 python-version: 3.x # Install latest Stable release of Python 3
cache: 'pip' # caching pip dependencies cache: 'pip' # Caching pip dependencies
- name: Install Necessary Dependencies using 'pip install -r requirements.txt' - name: Install Necessary Dependencies
run: pip install -r requirements.txt run: pip install -r .github/requirements.txt
- name: Build & Deploy using 'mkdocs' - name: Build & Deploy using mkdocs
run: mkdocs gh-deploy --force run: mkdocs gh-deploy --force -f .github/mkdocs.yml

View File

@ -52,7 +52,7 @@ If you have Issues, refer to [Known Issues](https://christitustech.github.io/win
These are the sponsors that help keep this project alive with monthly contributions. These are the sponsors that help keep this project alive with monthly contributions.
<!-- sponsors --><a href="https://github.com/GregoryNavasarkian"><img src="https://github.com/GregoryNavasarkian.png" width="60px" alt="Gregory Navasarkian" /></a><a href="https://github.com/ysaito8015"><img src="https://github.com/ysaito8015.png" width="60px" alt="Yusuke Saito" /></a><a href="https://github.com/TriHydera"><img src="https://github.com/TriHydera.png" width="60px" alt="TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https://github.com/jozozovko.png" width="60px" alt="" /></a><a href="https://github.com/DelDongo"><img src="https://github.com/DelDongo.png" width="60px" alt="" /></a><a href="https://github.com/markamos"><img src="https://github.com/markamos.png" width="60px" alt="Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://github.com/dwelfusius.png" width="60px" alt="" /></a><a href="https://github.com/mews-se"><img src="https://github.com/mews-se.png" width="60px" alt="" /></a><a href="https://github.com/jdiegmueller"><img src="https://github.com/jdiegmueller.png" width="60px" alt="Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https://github.com/AlanTristar.png" width="60px" alt="" /></a><a href="https://github.com/JennJones89"><img src="https://github.com/JennJones89.png" width="60px" alt="" /></a><a href="https://github.com/zepled112"><img src="https://github.com/zepled112.png" width="60px" alt="wyatt" /></a><a href="https://github.com/altugtekiner"><img src="https://github.com/altugtekiner.png" width="60px" alt="" /></a><a href="https://github.com/getsmor"><img src="https://github.com/getsmor.png" width="60px" alt="" /></a><a href="https://github.com/robertsandrock"><img src="https://github.com/robertsandrock.png" width="60px" alt="" /></a><a href="https://github.com/jeffnesbit"><img src="https://github.com/jeffnesbit.png" width="60px" alt="" /></a><a href="https://github.com/mmomega"><img src="https://github.com/mmomega.png" width="60px" alt="" /></a><a href="https://github.com/KenichiQaz"><img src="https://github.com/KenichiQaz.png" width="60px" alt="Stefan" /></a><a href="https://github.com/thaddl"><img src="https://github.com/thaddl.png" width="60px" alt="thaddl" /></a><a href="https://github.com/paulsheets"><img src="https://github.com/paulsheets.png" width="60px" alt="Paul" /></a><a href="https://github.com/djones369"><img src="https://github.com/djones369.png" width="60px" alt="Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https://github.com/anthonymendez.png" width="60px" alt="Anthony Mendez" /></a><a href="https://github.com/woobe-studio"><img src="https://github.com/woobe-studio.png" width="60px" alt="Michael Wozniak" /></a><a href="https://github.com/xBandaku"><img src="https://github.com/xBandaku.png" width="60px" alt="xPandaku" /></a><!-- sponsors --> <!-- sponsors --><a href="https://github.com/ysaito8015"><img src="https://github.com/ysaito8015.png" width="60px" alt="Yusuke Saito" /></a><a href="https://github.com/TriHydera"><img src="https://github.com/TriHydera.png" width="60px" alt="TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https://github.com/jozozovko.png" width="60px" alt="" /></a><a href="https://github.com/DelDongo"><img src="https://github.com/DelDongo.png" width="60px" alt="" /></a><a href="https://github.com/markamos"><img src="https://github.com/markamos.png" width="60px" alt="Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://github.com/dwelfusius.png" width="60px" alt="" /></a><a href="https://github.com/mews-se"><img src="https://github.com/mews-se.png" width="60px" alt="" /></a><a href="https://github.com/jdiegmueller"><img src="https://github.com/jdiegmueller.png" width="60px" alt="Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https://github.com/AlanTristar.png" width="60px" alt="" /></a><a href="https://github.com/JennJones89"><img src="https://github.com/JennJones89.png" width="60px" alt="" /></a><a href="https://github.com/zepled112"><img src="https://github.com/zepled112.png" width="60px" alt="wyatt" /></a><a href="https://github.com/altugtekiner"><img src="https://github.com/altugtekiner.png" width="60px" alt="" /></a><a href="https://github.com/robertsandrock"><img src="https://github.com/robertsandrock.png" width="60px" alt="" /></a><a href="https://github.com/mmomega"><img src="https://github.com/mmomega.png" width="60px" alt="" /></a><a href="https://github.com/KenichiQaz"><img src="https://github.com/KenichiQaz.png" width="60px" alt="Stefan" /></a><a href="https://github.com/thaddl"><img src="https://github.com/thaddl.png" width="60px" alt="thaddl" /></a><a href="https://github.com/paulsheets"><img src="https://github.com/paulsheets.png" width="60px" alt="Paul" /></a><a href="https://github.com/djones369"><img src="https://github.com/djones369.png" width="60px" alt="Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https://github.com/anthonymendez.png" width="60px" alt="Anthony Mendez" /></a><a href="https://github.com/woobe-studio"><img src="https://github.com/woobe-studio.png" width="60px" alt="Michael Wozniak" /></a><a href="https://github.com/xBandaku"><img src="https://github.com/xBandaku.png" width="60px" alt="xPandaku" /></a><a href="https://github.com/claudemods"><img src="https://github.com/claudemods.png" width="60px" alt="Claudemods" /></a><a href="https://github.com/hkolatan"><img src="https://github.com/hkolatan.png" width="60px" alt="Halil Kolatan" /></a><a href="https://github.com/FatBastard0"><img src="https://github.com/FatBastard0.png" width="60px" alt="" /></a><!-- sponsors -->
## 🏅 Thanks to all Contributors ## 🏅 Thanks to all Contributors
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻. Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.

View File

@ -3091,8 +3091,8 @@
"panel": "1", "panel": "1",
"Order": "a002_", "Order": "a002_",
"InvokeScript": [ "InvokeScript": [
"Get-ChildItem -Path \"C:\\Windows\\Temp\" *.* -Recurse | Remove-Item -Force -Recurse "Get-ChildItem -Path \"C:\\Windows\\Temp\" *.* -Recurse | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue
Get-ChildItem -Path $env:TEMP *.* -Recurse | Remove-Item -Force -Recurse" Get-ChildItem -Path $env:TEMP *.* -Recurse | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue"
], ],
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/DeleteTempFiles" "link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/DeleteTempFiles"
}, },

View File

@ -1,3 +1,3 @@
--8<-- "CONTRIBUTING.md" --8<-- ".github/CONTRIBUTING.md"
<!-- The content is sourced from "CONTRIBUTING.md," located in the root directory of the project. --> <!-- The content is sourced from "CONTRIBUTING.md," located in the root directory of the project. -->

View File

@ -198,26 +198,7 @@ The utility provides three distinct settings for managing Windows updates: Defau
* Selecting a scratch directory will copy the contents of the ISO file to the directory you specify instead of an automatically generated folder in the `%TEMP%` directory. * Selecting a scratch directory will copy the contents of the ISO file to the directory you specify instead of an automatically generated folder in the `%TEMP%` directory.
* You can select an edition of Windows to debloat (**SKU**) using the convenient drop-down menu. * You can select an edition of Windows to debloat (**SKU**) using the convenient drop-down menu.
    By default, MicroWin will debloat the Pro edition, but you can choose any edition you want. By default, MicroWin will debloat the Pro edition, but you can choose any edition you want.
##### Customization options
* **Keep Provisioned Packages**: leaving this option unticked (default) will try to remove every operating system package.
    Some packages may remain after processing. This can happen if the packages in question are permanent or have been superseded by newer versions.
* **Keep Appx Packages**: leaving this option unticked (default) will try to remove every Microsoft Store app from the Windows image.
    This option will exclude some applications that are essential in the event that you want or need to add a Store app later on.
* **Keep Defender**: leaving this option unticked will try to remove every part of Windows Defender, including the Windows Security app.
    Leaving this option unticked is **NOT recommended** unless you plan to use a third-party antivirus solution on your MicroWin installation. In that regard, don't install AVs with bad reputations or rogueware.
* **Keep Edge**: leaving this option unticked will try to remove every part of the Microsoft Edge browser using the best methods available.
    Leaving this option unticked is not recommended because it might break some applications that might depend on the `Edge WebView2` runtime. However, if that happens, you can easily [reinstall it](https://developer.microsoft.com/en-us/microsoft-edge/webview2)
##### Driver integration options ##### Driver integration options
@ -225,7 +206,15 @@ The utility provides three distinct settings for managing Windows updates: Defau
* **Inject drivers** will add the drivers in the folder that you specify to the target Windows image. * **Inject drivers** will add the drivers in the folder that you specify to the target Windows image.
* **Import drivers from the current system** will add every third-party driver that is present in your active installation. * **Import drivers from the current system** will add every third-party driver that is present in your active installation.
    This makes the target image have the same hardware compatibility as the active installation. However, this means that you will only be able to install the target Windows image and take full advantage of it on computers with **the same hardware**. To avoid this, you'll need to customize the `install.wim` file of the target ISO in the 'sources` folder. This makes the target image have the same hardware compatibility as the active installation. However, this means that you will only be able to install the target Windows image and take full advantage of it on computers with **the same hardware**. To avoid this, you'll need to customize the `install.wim` file of the target ISO in the 'sources` folder.
##### Custom user settings
With MicroWin, you can also configure your user before proceeding if you don't want to use the default `User` account. To do this, simply type the account name (20 characters maximum), and a password. Then, let MicroWin do the rest.
!!! info
Please make sure that you remember your password. MicroWin will configure auto-login settings, so you won't have to enter your password. However, if you are required to enter your password, it's best that you don't forget it.
##### Ventoy options ##### Ventoy options

View File

@ -101,7 +101,9 @@ function Remove-Packages {
$_ -NotLike "*DesktopAppInstaller*" -AND $_ -NotLike "*DesktopAppInstaller*" -AND
$_ -NotLike "*WebMediaExtensions*" -AND $_ -NotLike "*WebMediaExtensions*" -AND
$_ -NotLike "*WMIC*" -AND $_ -NotLike "*WMIC*" -AND
$_ -NotLike "*UI.XaML*" $_ -NotLike "*UI.XaML*" -AND
$_ -NotLike "*Ethernet*" -AND
$_ -NotLike "*Wifi*"
} }
foreach ($pkg in $pkglist) { foreach ($pkg in $pkglist) {
@ -132,6 +134,8 @@ function Remove-ProvisionedPackages() {
.EXAMPLE .EXAMPLE
Remove-ProvisionedPackages Remove-ProvisionedPackages
#> #>
try
{
$appxProvisionedPackages = Get-AppxProvisionedPackage -Path "$($scratchDir)" | Where-Object { $appxProvisionedPackages = Get-AppxProvisionedPackage -Path "$($scratchDir)" | Where-Object {
$_.PackageName -NotLike "*AppInstaller*" -AND $_.PackageName -NotLike "*AppInstaller*" -AND
$_.PackageName -NotLike "*Store*" -and $_.PackageName -NotLike "*Store*" -and
@ -141,7 +145,6 @@ function Remove-ProvisionedPackages() {
$_.PackageName -NotLike "*LanguageFeatures*" -and $_.PackageName -NotLike "*LanguageFeatures*" -and
$_.PackageName -NotLike "*Notepad*" -and $_.PackageName -NotLike "*Notepad*" -and
$_.PackageName -NotLike "*Printing*" -and $_.PackageName -NotLike "*Printing*" -and
$_.PackageName -NotLike "*Wifi*" -and
$_.PackageName -NotLike "*Foundation*" -and $_.PackageName -NotLike "*Foundation*" -and
$_.PackageName -NotLike "*YourPhone*" -and $_.PackageName -NotLike "*YourPhone*" -and
$_.PackageName -NotLike "*Xbox*" -and $_.PackageName -NotLike "*Xbox*" -and
@ -153,7 +156,6 @@ function Remove-ProvisionedPackages() {
$_.PackageName -NotLike "*Gaming*" -and $_.PackageName -NotLike "*Gaming*" -and
$_.PackageName -NotLike "*Extension*" -and $_.PackageName -NotLike "*Extension*" -and
$_.PackageName -NotLike "*SecHealthUI*" $_.PackageName -NotLike "*SecHealthUI*"
} }
$counter = 0 $counter = 0
@ -168,6 +170,12 @@ function Remove-ProvisionedPackages() {
} }
} }
Write-Progress -Activity "Removing Provisioned Apps" -Status "Ready" -Completed Write-Progress -Activity "Removing Provisioned Apps" -Status "Ready" -Completed
}
catch
{
# This can happen if getting AppX packages fails
Write-Host "Unable to get information about the AppX packages. MicroWin processing will continue, but AppX packages will not be processed"
}
} }
function Copy-ToUSB([string]$fileToCopy) { function Copy-ToUSB([string]$fileToCopy) {
@ -239,6 +247,11 @@ function Remove-FileOrDirectory([string]$pathToDelete, [string]$mask = "", [swit
function New-Unattend { function New-Unattend {
param (
[Parameter(Mandatory, Position = 0)] [string] $userName,
[Parameter(Position = 1)] [string] $userPassword
)
$unattend = @' $unattend = @'
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend" <unattend xmlns="urn:schemas-microsoft-com:unattend"
@ -261,21 +274,21 @@ function New-Unattend {
<UserAccounts> <UserAccounts>
<LocalAccounts> <LocalAccounts>
<LocalAccount wcm:action="add"> <LocalAccount wcm:action="add">
<Name>User</Name> <Name>USER-REPLACEME</Name>
<Group>Administrators</Group> <Group>Administrators</Group>
<Password> <Password>
<Value></Value> <Value>PW-REPLACEME</Value>
<PlainText>true</PlainText> <PlainText>true</PlainText>
</Password> </Password>
</LocalAccount> </LocalAccount>
</LocalAccounts> </LocalAccounts>
</UserAccounts> </UserAccounts>
<AutoLogon> <AutoLogon>
<Username>User</Username> <Username>USER-REPLACEME</Username>
<Enabled>true</Enabled> <Enabled>true</Enabled>
<LogonCount>1</LogonCount> <LogonCount>1</LogonCount>
<Password> <Password>
<Value></Value> <Value>PW-REPLACEME</Value>
<PlainText>true</PlainText> <PlainText>true</PlainText>
</Password> </Password>
</AutoLogon> </AutoLogon>
@ -535,6 +548,11 @@ function New-Unattend {
# Replace the placeholder text with the Specialize pass # Replace the placeholder text with the Specialize pass
$unattend = $unattend.Replace("<#REPLACEME#>", $specPass).Trim() $unattend = $unattend.Replace("<#REPLACEME#>", $specPass).Trim()
} }
# Replace default User and Password values with the provided parameters
$unattend = $unattend.Replace("USER-REPLACEME", $userName).Trim()
$unattend = $unattend.Replace("PW-REPLACEME", $userPassword).Trim()
# Save unattended answer file with UTF-8 encoding
$unattend | Out-File -FilePath "$env:temp\unattend.xml" -Force -Encoding utf8 $unattend | Out-File -FilePath "$env:temp\unattend.xml" -Force -Encoding utf8
} }

View File

@ -43,6 +43,7 @@ function Set-WinUtilTaskbaritem {
[string]$description [string]$description
) )
try {
if ($value) { if ($value) {
$sync["Form"].taskbarItemInfo.ProgressValue = $value $sync["Form"].taskbarItemInfo.ProgressValue = $value
} }
@ -83,4 +84,7 @@ function Set-WinUtilTaskbaritem {
if ($description) { if ($description) {
$sync["Form"].taskbarItemInfo.Description = $description $sync["Form"].taskbarItemInfo.Description = $description
} }
} catch {
#nothing
}
} }

View File

@ -6,16 +6,26 @@ function Invoke-WPFFeatureInstall {
#> #>
param (
$FeatureConfig
)
if($sync.ProcessRunning) { if($sync.ProcessRunning) {
$msg = "[Invoke-WPFFeatureInstall] Install process is currently running." $msg = "[Invoke-WPFFeatureInstall] Install process is currently running."
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning) [System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
return return
} }
if ($FeatureConfig) {
$Features = $FeatureConfig
$automation = $true
} else {
$Features = (Get-WinUtilCheckBoxes)["WPFFeature"] $Features = (Get-WinUtilCheckBoxes)["WPFFeature"]
$automation = $false
}
Invoke-WPFRunspace -ArgumentList $Features -DebugPreference $DebugPreference -ScriptBlock { Invoke-WPFRunspace -ArgumentList $Features, $automation -DebugPreference $DebugPreference -ScriptBlock {
param($Features, $DebugPreference) param($Features, $automation, $DebugPreference)
$sync.ProcessRunning = $true $sync.ProcessRunning = $true
if ($Features.count -eq 1) { if ($Features.count -eq 1) {
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" }) $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })

View File

@ -6,14 +6,24 @@ function Invoke-WPFInstall {
#> #>
param (
$InstallConfig
)
if($sync.ProcessRunning) { if($sync.ProcessRunning) {
$msg = "[Invoke-WPFInstall] An Install process is currently running." $msg = "[Invoke-WPFInstall] An Install process is currently running."
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning) [System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
return return
} }
if ($InstallConfig) {
$PackagesToInstall = $InstallConfig
$automation = $true
} else {
$PackagesToInstall = (Get-WinUtilCheckBoxes)["Install"] $PackagesToInstall = (Get-WinUtilCheckBoxes)["Install"]
Write-Host $PackagesToInstall $automation = $false
}
if ($PackagesToInstall.Count -eq 0) { if ($PackagesToInstall.Count -eq 0) {
$WarningMsg = "Please select the program(s) to install or upgrade" $WarningMsg = "Please select the program(s) to install or upgrade"
[System.Windows.MessageBox]::Show($WarningMsg, $AppTitle, [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning) [System.Windows.MessageBox]::Show($WarningMsg, $AppTitle, [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
@ -21,8 +31,8 @@ function Invoke-WPFInstall {
} }
Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock { Invoke-WPFRunspace -ArgumentList $PackagesToInstall, $automation -DebugPreference $DebugPreference -ScriptBlock {
param($PackagesToInstall, $DebugPreference) param($PackagesToInstall, $automation, $DebugPreference)
if ($PackagesToInstall.count -eq 1) { if ($PackagesToInstall.count -eq 1) {
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" }) $sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
} else { } else {

View File

@ -178,7 +178,22 @@ public class PowerManagement {
Write-Host "Removal complete!" Write-Host "Removal complete!"
Write-Host "Create unattend.xml" Write-Host "Create unattend.xml"
New-Unattend #New-Unattend
if ($sync.MicrowinUserName.Text -eq "")
{
New-Unattend -userName "User"
}
else
{
if ($sync.MicrowinUserPassword.Password -eq "")
{
New-Unattend -userName "$($sync.MicrowinUserName.Text)"
}
else
{
New-Unattend -userName "$($sync.MicrowinUserName.Text)" -userPassword "$($sync.MicrowinUserPassword.Password)"
}
}
Write-Host "Done Create unattend.xml" Write-Host "Done Create unattend.xml"
Write-Host "Copy unattend.xml file into the ISO" Write-Host "Copy unattend.xml file into the ISO"
New-Item -ItemType Directory -Force -Path "$($scratchDir)\Windows\Panther" New-Item -ItemType Directory -Force -Path "$($scratchDir)\Windows\Panther"

View File

@ -22,9 +22,13 @@ function Invoke-WPFRunspace {
Param ( Param (
$ScriptBlock, $ScriptBlock,
$ArgumentList, $ArgumentList,
$DebugPreference $DebugPreference,
$automation
) )
if ($automation = $true) {
& $ScriptBlock @ArgumentList @DebugPreference
} else {
# Create a PowerShell instance # Create a PowerShell instance
$script:powershell = [powershell]::Create() $script:powershell = [powershell]::Create()
@ -45,4 +49,5 @@ function Invoke-WPFRunspace {
$sync.runspace.Close() $sync.runspace.Close()
[System.GC]::Collect() [System.GC]::Collect()
} }
}
} }

View File

@ -6,13 +6,23 @@ function Invoke-WPFtweaksbutton {
#> #>
param (
$TweaksConfig
)
if($sync.ProcessRunning) { if($sync.ProcessRunning) {
$msg = "[Invoke-WPFtweaksbutton] Install process is currently running." $msg = "[Invoke-WPFtweaksbutton] Install process is currently running."
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning) [System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
return return
} }
if ($TweaksConfig) {
$Tweaks = $TweaksConfig
$automation = $true
} else {
$Tweaks = (Get-WinUtilCheckBoxes)["WPFTweaks"] $Tweaks = (Get-WinUtilCheckBoxes)["WPFTweaks"]
$automation = $false
}
Set-WinUtilDNS -DNSProvider $sync["WPFchangedns"].text Set-WinUtilDNS -DNSProvider $sync["WPFchangedns"].text
@ -24,8 +34,8 @@ function Invoke-WPFtweaksbutton {
Write-Debug "Number of tweaks to process: $($Tweaks.Count)" Write-Debug "Number of tweaks to process: $($Tweaks.Count)"
Invoke-WPFRunspace -ArgumentList $Tweaks -DebugPreference $DebugPreference -ScriptBlock { Invoke-WPFRunspace -ArgumentList $Tweaks, $automation -DebugPreference $DebugPreference -ScriptBlock {
param($Tweaks, $DebugPreference) param($Tweaks, $automation, $DebugPreference)
Write-Debug "Inside Number of tweaks to process: $($Tweaks.Count)" Write-Debug "Inside Number of tweaks to process: $($Tweaks.Count)"
$sync.ProcessRunning = $true $sync.ProcessRunning = $true

View File

@ -1,4 +0,0 @@
Get-ChildItem @(
"$env:SystemRoot\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package*.mum",
"$env:SystemRoot\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package*.mum"
) | ForEach-Object { dism.exe /online /norestart /add-package:"$_" }

View File

@ -146,12 +146,60 @@ Invoke-WPFRunspace -ScriptBlock {
} | Out-Null } | Out-Null
#=========================================================================== #===========================================================================
# Setup and Show the Form # Print Logo into Console
#=========================================================================== #===========================================================================
# Print the logo
Invoke-WPFFormVariables Invoke-WPFFormVariables
#===========================================================================
# Run Automation
#===========================================================================
if ($PARAM_CONFIG) {
if ($PARAM_RUN) {
$installConfig = Get-Content $PARAM_CONFIG -Raw | ConvertFrom-Json
if ($installConfig.WPFInstall) {
write-host "Installing Programs"
# Create a new array to hold the combined install configurations
$combinedInstallConfig = @()
# Iterate over each WPFInstall entry
for ($i = 0; $i -lt $installConfig.WPFInstall.Count; $i++) {
$wpfInstallEntry = $installConfig.WPFInstall[$i]
$installEntry = $installConfig.Install[$i]
# Create a new object with the combined values
$combinedEntry = @{
Name = $wpfInstallEntry
Winget = $installEntry.winget
Choco = $installEntry.choco
}
# Add the combined entry to the array
$combinedInstallConfig += $combinedEntry
}
# Invoke the WPFInstall function with the combined configuration
Invoke-WPFInstall -InstallConfig $combinedInstallConfig
}
if ($installConfig.WPFTweaks) {
write-host "Running Tweaks"
Invoke-WPFtweaksbutton -TweaksConfig $installConfig.WPFTweaks
}
if ($installConfig.WPFFeature) {
write-host "Installing Features"
Invoke-WPFFeatureInstall -FeatureConfig $installConfig.WPFFeature
}
} else {
Invoke-WPFImpex -type "import" -Config $PARAM_CONFIG
}
}
#===========================================================================
# Setup and Show the Form
#===========================================================================
# Progress bar in taskbaritem > Set-WinUtilProgressbar # Progress bar in taskbaritem > Set-WinUtilProgressbar
$sync["Form"].TaskbarItemInfo = New-Object System.Windows.Shell.TaskbarItemInfo $sync["Form"].TaskbarItemInfo = New-Object System.Windows.Shell.TaskbarItemInfo
Set-WinUtilTaskbaritem -state "None" Set-WinUtilTaskbaritem -state "None"
@ -318,42 +366,6 @@ Add-Type @"
Invoke-WPFTab "WPFTab1BT" Invoke-WPFTab "WPFTab1BT"
$sync["Form"].Focus() $sync["Form"].Focus()
# maybe this is not the best place to load and execute config file?
# maybe community can help?
if ($PARAM_CONFIG) {
Invoke-WPFImpex -type "import" -Config $PARAM_CONFIG
if ($PARAM_RUN) {
while ($sync.ProcessRunning) {
Start-Sleep -Seconds 5
}
Start-Sleep -Seconds 5
Write-Host "Applying tweaks..."
Invoke-WPFtweaksbutton
while ($sync.ProcessRunning) {
Start-Sleep -Seconds 5
}
Start-Sleep -Seconds 5
Write-Host "Installing features..."
Invoke-WPFFeatureInstall
while ($sync.ProcessRunning) {
Start-Sleep -Seconds 5
}
Start-Sleep -Seconds 5
Write-Host "Installing applications..."
while ($sync.ProcessRunning) {
Start-Sleep -Seconds 1
}
Invoke-WPFInstall
Start-Sleep -Seconds 5
Write-Host "Done."
}
}
}) })
# Load Checkboxes and Labels outside of the Filter function only once on startup for performance reasons # Load Checkboxes and Labels outside of the Filter function only once on startup for performance reasons
@ -528,5 +540,8 @@ $sync["SponsorMenuItem"].Add_Click({
$Height = $sync.configs.themes.$ctttheme.CustomDialogHeight $Height = $sync.configs.themes.$ctttheme.CustomDialogHeight
Show-CustomDialog -Message $authorInfo -Width $Width -Height $Height -FontSize $FontSize -HeaderFontSize $HeaderFontSize -IconSize $IconSize -EnableScroll $true Show-CustomDialog -Message $authorInfo -Width $Width -Height $Height -FontSize $FontSize -HeaderFontSize $HeaderFontSize -IconSize $IconSize -EnableScroll $true
}) })
$sync["Form"].ShowDialog() | out-null
Stop-Transcript if (!$PARAM_RUN) {
$sync["Form"].ShowDialog() | out-null
Stop-Transcript
}

View File

@ -563,17 +563,17 @@ function Add-LinkAttributeToJson {
} }
Update-Progress "Loading JSON files" 10 Update-Progress "Loading JSON files" 10
$tweaks = Get-Content -Path "config/tweaks.json" | ConvertFrom-Json $tweaks = Get-Content -Path "../config/tweaks.json" | ConvertFrom-Json
$features = Get-Content -Path "config/feature.json" | ConvertFrom-Json $features = Get-Content -Path "../config/feature.json" | ConvertFrom-Json
Update-Progress "Getting last modified dates of the JSON files" 20 Update-Progress "Getting last modified dates of the JSON files" 20
$tweaksLastModified = (Get-Item "config/tweaks.json").LastWriteTime.ToString("yyyy-MM-dd") $tweaksLastModified = (Get-Item "../config/tweaks.json").LastWriteTime.ToString("yyyy-MM-dd")
$featuresLastModified = (Get-Item "config/feature.json").LastWriteTime.ToString("yyyy-MM-dd") $featuresLastModified = (Get-Item "../config/feature.json").LastWriteTime.ToString("yyyy-MM-dd")
$tweaksOutputDir = "docs/dev/tweaks" $tweaksOutputDir = "../docs/dev/tweaks"
$featuresOutputDir = "docs/dev/features" $featuresOutputDir = "../docs/dev/features"
$privateFunctionsDir = "functions/private" $privateFunctionsDir = "../functions/private"
$publicFunctionsDir = "functions/public" $publicFunctionsDir = "../functions/public"
$functions = @{} $functions = @{}
$itemnametocut = "WPF(WinUtil|Toggle|Features?|Tweaks?|Panel|Fix(es)?)?" $itemnametocut = "WPF(WinUtil|Toggle|Features?|Tweaks?|Panel|Fix(es)?)?"
@ -592,7 +592,7 @@ Load-Functions -dir $publicFunctionsDir
Update-Progress "Adding documentation links to JSON files" 50 Update-Progress "Adding documentation links to JSON files" 50
# Define the JSON file paths # Define the JSON file paths
$jsonPaths = @(".\config\feature.json", ".\config\tweaks.json") $jsonPaths = @("../config/feature.json", "../config/tweaks.json")
# Loop through each JSON file path # Loop through each JSON file path
foreach ($jsonPath in $jsonPaths) { foreach ($jsonPath in $jsonPaths) {
@ -612,12 +612,12 @@ foreach ($jsonPath in $jsonPaths) {
Set-Content -Path $jsonPath -Value $jsonString Set-Content -Path $jsonPath -Value $jsonString
} }
Add-LinkAttributeToJson -jsonFilePath "config/tweaks.json" -outputDir "dev/tweaks" Add-LinkAttributeToJson -jsonFilePath "../config/tweaks.json" -outputDir "dev/tweaks"
Add-LinkAttributeToJson -jsonFilePath "config/feature.json" -outputDir "dev/features" Add-LinkAttributeToJson -jsonFilePath "../config/feature.json" -outputDir "dev/features"
Update-Progress "Generating content for documentation" 60 Update-Progress "Generating content for documentation" 60
$tweakResult = Generate-MarkdownFiles -data $tweaks -outputDir $tweaksOutputDir -jsonFilePath "config/tweaks.json" -lastModified $tweaksLastModified -type "tweak" -initialProgress 60 $tweakResult = Generate-MarkdownFiles -data $tweaks -outputDir $tweaksOutputDir -jsonFilePath "../config/tweaks.json" -lastModified $tweaksLastModified -type "tweak" -initialProgress 60
$featureResult = Generate-MarkdownFiles -data $features -outputDir $featuresOutputDir -jsonFilePath "config/feature.json" -lastModified $featuresLastModified -type "feature" -initialProgress 70 $featureResult = Generate-MarkdownFiles -data $features -outputDir $featuresOutputDir -jsonFilePath "../config/feature.json" -lastModified $featuresLastModified -type "feature" -initialProgress 70
Update-Progress "Generating table of contents" 80 Update-Progress "Generating table of contents" 80
$allTocEntries = $tweakResult.TocEntries + $featureResult.TocEntries $allTocEntries = $tweakResult.TocEntries + $featureResult.TocEntries
@ -639,6 +639,6 @@ $indexContent += Process-MultilineStrings @"
\\ \\
"@ "@
$indexContent += $(Generate-TypeSectionContent $featureEntries) + "`r`n" $indexContent += $(Generate-TypeSectionContent $featureEntries) + "`r`n"
Set-Content -Path "docs/devdocs.md" -Value $indexContent -Encoding utf8 Set-Content -Path "../docs/devdocs.md" -Value $indexContent -Encoding utf8
Update-Progress "Process Completed" 100 Update-Progress "Process Completed" 100

View File

@ -566,6 +566,36 @@
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<Style TargetType="PasswordBox">
<Setter Property="Background" Value="{MainBackgroundColor}"/>
<Setter Property="BorderBrush" Value="{MainForegroundColor}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Foreground" Value="{MainForegroundColor}"/>
<Setter Property="FontSize" Value="{FontSize}"/>
<Setter Property="Padding" Value="5"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="PasswordBox">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="5">
<Grid>
<ScrollViewer x:Name="PART_ContentHost" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect ShadowDepth="5" BlurRadius="5" Opacity="{BorderOpacity}" Color="{BorderColor}"/>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ScrollVisibilityRectangle" TargetType="Rectangle"> <Style x:Key="ScrollVisibilityRectangle" TargetType="Rectangle">
<Setter Property="Visibility" Value="Collapsed"/> <Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers> <Style.Triggers>
@ -921,6 +951,23 @@
<Rectangle Fill="{MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/> <Rectangle Fill="{MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
<CheckBox Name="WPFMicrowinCopyToUsb" Content="Copy to Ventoy" Margin="-10,5,0,0" IsChecked="False" ToolTip="Copy to USB disk with a label Ventoy"/> <CheckBox Name="WPFMicrowinCopyToUsb" Content="Copy to Ventoy" Margin="-10,5,0,0" IsChecked="False" ToolTip="Copy to USB disk with a label Ventoy"/>
<Rectangle Fill="{MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/> <Rectangle Fill="{MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap"><Bold>Custom user settings (leave empty for default user)</Bold></TextBlock>
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">User name (20 characters max.):</TextBlock>
<TextBox Name="MicrowinUserName" Background="Transparent" BorderThickness="1" BorderBrush="{MainForegroundColor}"
Margin="6"
Text=""
IsReadOnly="False"
TextWrapping="Wrap"
Foreground="{LabelboxForegroundColor}"
MaxLength="20"
/>
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">Password (characters will not be shown for your security):</TextBlock>
<PasswordBox Name="MicrowinUserPassword" Background="Transparent" BorderThickness="1" BorderBrush="{MainForegroundColor}"
Margin="6"
PasswordChar="*"
Foreground="{LabelboxForegroundColor}"
/>
<Rectangle Fill="{MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
<Button Name="WPFMicrowin" Content="Start the process" Margin="2" Padding="15"/> <Button Name="WPFMicrowin" Content="Start the process" Margin="2" Padding="15"/>
</StackPanel> </StackPanel>
<StackPanel HorizontalAlignment="Left" SnapsToDevicePixels="True" Margin="1" Visibility="Collapsed"> <StackPanel HorizontalAlignment="Left" SnapsToDevicePixels="True" Margin="1" Visibility="Collapsed">
@ -968,15 +1015,14 @@
Foreground="{ComboBoxForegroundColor}"> Foreground="{ComboBoxForegroundColor}">
<Bold>MicroWin features:</Bold><LineBreak/> <Bold>MicroWin features:</Bold><LineBreak/>
- Remove Telemetry and Tracking <LineBreak/> - Remove Telemetry and Tracking <LineBreak/>
- Fast Install using "User" local account <LineBreak/> - Fast Install using either the "User" local account or the account of your choosing <LineBreak/>
- No internet requirement for install <LineBreak/> - No internet requirement for install <LineBreak/>
- Apps debloat <LineBreak/> - Apps debloat <LineBreak/>
<LineBreak/> <LineBreak/>
<LineBreak/> <LineBreak/>
<Bold>INSTRUCTIONS</Bold> <LineBreak/> <Bold>INSTRUCTIONS</Bold> <LineBreak/>
- Download the latest Windows 11 image from Microsoft <LineBreak/> - <TextBlock Name="Win11DownloadLink" Style="{StaticResource HoverTextBlockStyle}" ToolTip="https://www.microsoft.com/software-download/windows11">Download</TextBlock> the latest Windows 11 image from Microsoft <LineBreak/>
LINK: https://www.microsoft.com/software-download/windows11 <LineBreak/>
May take several minutes to process the ISO depending on your machine and connection <LineBreak/> May take several minutes to process the ISO depending on your machine and connection <LineBreak/>
- Put it somewhere on the C:\ drive so it is easily accessible <LineBreak/> - Put it somewhere on the C:\ drive so it is easily accessible <LineBreak/>
- Launch WinUtil and MicroWin <LineBreak/> - Launch WinUtil and MicroWin <LineBreak/>