mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-08-24 12:56:22 -05:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
8622892827 | |||
af09bcbf0b | |||
e2732da2db | |||
3bd6003171 | |||
a921d0c6fa | |||
01c8739a8b |
2
.gitignore
vendored
2
.gitignore
vendored
@ -54,3 +54,5 @@ winutil.ps1
|
|||||||
.github/site/
|
.github/site/
|
||||||
|
|
||||||
binary/
|
binary/
|
||||||
|
|
||||||
|
.preprocessor_hashes.json
|
@ -375,6 +375,14 @@
|
|||||||
"link": "https://discord.com/",
|
"link": "https://discord.com/",
|
||||||
"winget": "Discord.Discord"
|
"winget": "Discord.Discord"
|
||||||
},
|
},
|
||||||
|
"dismtools": {
|
||||||
|
"category": "Microsoft Tools",
|
||||||
|
"choco": "na",
|
||||||
|
"content": "DISMTools",
|
||||||
|
"description": "DISMTools is a front-end for DISM that lets you manage your Windows Imaging (WIM) files and a whole lot more.",
|
||||||
|
"link": "https://github.com/CodingWonders/DISMTools",
|
||||||
|
"winget": "CodingWondersSoftware.DISMTools.Stable"
|
||||||
|
},
|
||||||
"ditto": {
|
"ditto": {
|
||||||
"category": "Utilities",
|
"category": "Utilities",
|
||||||
"choco": "ditto",
|
"choco": "ditto",
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
"ButtonFontFamily": "Arial",
|
"ButtonFontFamily": "Arial",
|
||||||
"ButtonWidth": "200",
|
"ButtonWidth": "200",
|
||||||
"ButtonHeight": "25",
|
"ButtonHeight": "25",
|
||||||
|
"ConfigTabButtonFontSize": "14",
|
||||||
"ConfigUpdateButtonFontSize": "14",
|
"ConfigUpdateButtonFontSize": "14",
|
||||||
"SearchBarWidth": "200",
|
"SearchBarWidth": "200",
|
||||||
"SearchBarHeight": "26",
|
"SearchBarHeight": "26",
|
||||||
|
@ -1585,13 +1585,6 @@
|
|||||||
"Type": "DWord",
|
"Type": "DWord",
|
||||||
"Value": "0",
|
"Value": "0",
|
||||||
"OriginalValue": "<RemoveEntry>"
|
"OriginalValue": "<RemoveEntry>"
|
||||||
},
|
|
||||||
{
|
|
||||||
"Path": "HKLM:\\SOFTWARE\\Policies\\BraveSoftware\\Brave",
|
|
||||||
"Name": "SyncDisabled",
|
|
||||||
"Type": "DWord",
|
|
||||||
"Value": "1",
|
|
||||||
"OriginalValue": "<RemoveEntry>"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -58,6 +58,9 @@ public class PowerManagement {
|
|||||||
$injectDrivers = $sync.MicrowinInjectDrivers.IsChecked
|
$injectDrivers = $sync.MicrowinInjectDrivers.IsChecked
|
||||||
$importDrivers = $sync.MicrowinImportDrivers.IsChecked
|
$importDrivers = $sync.MicrowinImportDrivers.IsChecked
|
||||||
|
|
||||||
|
$WPBT = $sync.MicroWinWPBT.IsChecked
|
||||||
|
$unsupported = $sync.MicroWinUnsupported.IsChecked
|
||||||
|
|
||||||
$importVirtIO = $sync.MicrowinCopyVirtIO.IsChecked
|
$importVirtIO = $sync.MicrowinCopyVirtIO.IsChecked
|
||||||
|
|
||||||
$mountDir = $sync.MicrowinMountDir.Text
|
$mountDir = $sync.MicrowinMountDir.Text
|
||||||
@ -66,7 +69,12 @@ public class PowerManagement {
|
|||||||
# Detect if the Windows image is an ESD file and convert it to WIM
|
# Detect if the Windows image is an ESD file and convert it to WIM
|
||||||
if (-not (Test-Path -Path "$mountDir\sources\install.wim" -PathType Leaf) -and (Test-Path -Path "$mountDir\sources\install.esd" -PathType Leaf)) {
|
if (-not (Test-Path -Path "$mountDir\sources\install.wim" -PathType Leaf) -and (Test-Path -Path "$mountDir\sources\install.esd" -PathType Leaf)) {
|
||||||
Write-Host "Exporting Windows image to a WIM file, keeping the index we want to work on. This can take several minutes, depending on the performance of your computer..."
|
Write-Host "Exporting Windows image to a WIM file, keeping the index we want to work on. This can take several minutes, depending on the performance of your computer..."
|
||||||
Export-WindowsImage -SourceImagePath $mountDir\sources\install.esd -SourceIndex $index -DestinationImagePath $mountDir\sources\install.wim -CompressionType "Max"
|
try {
|
||||||
|
Export-WindowsImage -SourceImagePath "$mountDir\sources\install.esd" -SourceIndex $index -DestinationImagePath "$mountDir\sources\install.wim" -CompressionType "Max"
|
||||||
|
} catch {
|
||||||
|
# Usually the case if it can't find unattend.dll on the host system. Guys, fix your corrupt messes that are your installations!
|
||||||
|
dism /english /export-image /sourceimagefile="$mountDir\sources\install.esd" /sourceindex=$index /destinationimagefile="$mountDir\sources\install.wim" /compress:max
|
||||||
|
}
|
||||||
if ($?) {
|
if ($?) {
|
||||||
Remove-Item -Path "$mountDir\sources\install.esd" -Force
|
Remove-Item -Path "$mountDir\sources\install.esd" -Force
|
||||||
# Since we've already exported the image index we wanted, switch to the first one
|
# Since we've already exported the image index we wanted, switch to the first one
|
||||||
@ -166,6 +174,25 @@ public class PowerManagement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($WPBT) {
|
||||||
|
Write-Host "Disabling WPBT Execution"
|
||||||
|
reg load HKLM\zSYSTEM "$($scratchDir)\Windows\System32\config\SYSTEM"
|
||||||
|
reg add "HKLM\zSYSTEM\ControlSet001\Control\Session Manager" /v DisableWpbtExecution /t REG_DWORD /d 1 /f
|
||||||
|
reg unload HKLM\zSYSTEM
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($unsupported) {
|
||||||
|
Write-Host "Bypassing system requirements (locally)"
|
||||||
|
reg add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d 0 /f
|
||||||
|
reg add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d 0 /f
|
||||||
|
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassCPUCheck" /t REG_DWORD /d 1 /f
|
||||||
|
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d 1 /f
|
||||||
|
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d 1 /f
|
||||||
|
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d 1 /f
|
||||||
|
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d 1 /f
|
||||||
|
reg add "HKLM\SYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d 1 /f
|
||||||
|
}
|
||||||
|
|
||||||
if ($importVirtIO) {
|
if ($importVirtIO) {
|
||||||
Write-Host "Copying VirtIO drivers..."
|
Write-Host "Copying VirtIO drivers..."
|
||||||
Microwin-CopyVirtIO
|
Microwin-CopyVirtIO
|
||||||
@ -221,6 +248,20 @@ public class PowerManagement {
|
|||||||
|
|
||||||
Write-Host "Create unattend.xml"
|
Write-Host "Create unattend.xml"
|
||||||
|
|
||||||
|
if (($sync.MicrowinAutoConfigBox.Text -ne "") -and (Test-Path "$($sync.MicrowinAutoConfigBox.Text)"))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Write-Host "A configuration file has been specified. Copying to WIM file..."
|
||||||
|
Copy-Item "$($sync.MicrowinAutoConfigBox.Text)" "$($scratchDir)\winutil-config.json"
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Write-Host "The config file could not be copied. Continuing without it..."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create unattended answer file with user information - Check condition to learn more about this functionality
|
||||||
if ($sync.MicrowinUserName.Text -eq "")
|
if ($sync.MicrowinUserName.Text -eq "")
|
||||||
{
|
{
|
||||||
Microwin-NewUnattend -userName "User"
|
Microwin-NewUnattend -userName "User"
|
||||||
@ -242,7 +283,6 @@ public class PowerManagement {
|
|||||||
Copy-Item "$env:temp\unattend.xml" "$($scratchDir)\Windows\Panther\unattend.xml" -force
|
Copy-Item "$env:temp\unattend.xml" "$($scratchDir)\Windows\Panther\unattend.xml" -force
|
||||||
New-Item -ItemType Directory -Force -Path "$($scratchDir)\Windows\System32\Sysprep"
|
New-Item -ItemType Directory -Force -Path "$($scratchDir)\Windows\System32\Sysprep"
|
||||||
Copy-Item "$env:temp\unattend.xml" "$($scratchDir)\Windows\System32\Sysprep\unattend.xml" -force
|
Copy-Item "$env:temp\unattend.xml" "$($scratchDir)\Windows\System32\Sysprep\unattend.xml" -force
|
||||||
Copy-Item "$env:temp\unattend.xml" "$($scratchDir)\unattend.xml" -force
|
|
||||||
Write-Host "Done Copy unattend.xml"
|
Write-Host "Done Copy unattend.xml"
|
||||||
|
|
||||||
Write-Host "Create FirstRun"
|
Write-Host "Create FirstRun"
|
||||||
@ -277,7 +317,6 @@ public class PowerManagement {
|
|||||||
reg add "HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Chat" /v ChatIcon /t REG_DWORD /d 2 /f >$null 2>&1
|
reg add "HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Chat" /v ChatIcon /t REG_DWORD /d 2 /f >$null 2>&1
|
||||||
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d 0 /f >$null 2>&1
|
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d 0 /f >$null 2>&1
|
||||||
reg query "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Communications" /v "ConfigureChatAutoInstall" >$null 2>&1
|
reg query "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Communications" /v "ConfigureChatAutoInstall" >$null 2>&1
|
||||||
# Write-Host Error code $LASTEXITCODE
|
|
||||||
Write-Host "Done disabling Teams"
|
Write-Host "Done disabling Teams"
|
||||||
|
|
||||||
Write-Host "Fix Windows Volume Mixer Issue"
|
Write-Host "Fix Windows Volume Mixer Issue"
|
||||||
@ -304,11 +343,6 @@ public class PowerManagement {
|
|||||||
'CrossDeviceUpdate'
|
'CrossDeviceUpdate'
|
||||||
) | ForEach-Object {
|
) | ForEach-Object {
|
||||||
Write-Host "Removing Windows Expedited App: $_"
|
Write-Host "Removing Windows Expedited App: $_"
|
||||||
|
|
||||||
# Copied here After Installation (Online)
|
|
||||||
# reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\$_" /f | Out-Null
|
|
||||||
|
|
||||||
# When in Offline Image
|
|
||||||
reg delete "HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\$_" /f | Out-Null
|
reg delete "HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\$_" /f | Out-Null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -316,7 +350,6 @@ public class PowerManagement {
|
|||||||
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f
|
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f
|
||||||
Write-Host "Setting all services to start manually"
|
Write-Host "Setting all services to start manually"
|
||||||
reg add "HKLM\zSOFTWARE\CurrentControlSet\Services" /v Start /t REG_DWORD /d 3 /f
|
reg add "HKLM\zSOFTWARE\CurrentControlSet\Services" /v Start /t REG_DWORD /d 3 /f
|
||||||
# Write-Host $LASTEXITCODE
|
|
||||||
|
|
||||||
Write-Host "Enabling Local Accounts on OOBE"
|
Write-Host "Enabling Local Accounts on OOBE"
|
||||||
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v "BypassNRO" /t REG_DWORD /d "1" /f
|
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v "BypassNRO" /t REG_DWORD /d "1" /f
|
||||||
@ -371,7 +404,12 @@ public class PowerManagement {
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
Write-Host "Exporting image into $mountDir\sources\install2.wim"
|
Write-Host "Exporting image into $mountDir\sources\install2.wim"
|
||||||
|
try {
|
||||||
Export-WindowsImage -SourceImagePath "$mountDir\sources\install.wim" -SourceIndex $index -DestinationImagePath "$mountDir\sources\install2.wim" -CompressionType "Max"
|
Export-WindowsImage -SourceImagePath "$mountDir\sources\install.wim" -SourceIndex $index -DestinationImagePath "$mountDir\sources\install2.wim" -CompressionType "Max"
|
||||||
|
} catch {
|
||||||
|
# Usually the case if it can't find unattend.dll on the host system. Guys, fix your corrupt messes that are your installations!
|
||||||
|
dism /english /export-image /sourceimagefile="$mountDir\sources\install.wim" /sourceindex=$index /destinationimagefile="$mountDir\sources\install2.wim" /compress:max
|
||||||
|
}
|
||||||
Write-Host "Remove old '$mountDir\sources\install.wim' and rename $mountDir\sources\install2.wim"
|
Write-Host "Remove old '$mountDir\sources\install.wim' and rename $mountDir\sources\install2.wim"
|
||||||
Remove-Item "$mountDir\sources\install.wim"
|
Remove-Item "$mountDir\sources\install.wim"
|
||||||
Rename-Item "$mountDir\sources\install2.wim" "$mountDir\sources\install.wim"
|
Rename-Item "$mountDir\sources\install2.wim" "$mountDir\sources\install.wim"
|
||||||
@ -385,6 +423,20 @@ public class PowerManagement {
|
|||||||
}
|
}
|
||||||
Write-Host "Windows image completed. Continuing with boot.wim."
|
Write-Host "Windows image completed. Continuing with boot.wim."
|
||||||
|
|
||||||
|
$esd = $sync.MicroWinESD.IsChecked
|
||||||
|
if ($esd) {
|
||||||
|
Write-Host "Converting install image to ESD."
|
||||||
|
try {
|
||||||
|
Export-WindowsImage -SourceImagePath "$mountDir\sources\install.wim" -SourceIndex $index -DestinationImagePath "$mountDir\sources\install.esd" -CompressionType "Recovery"
|
||||||
|
Remove-Item "$mountDir\sources\install.wim"
|
||||||
|
Write-Host "Converted install image to ESD."
|
||||||
|
} catch {
|
||||||
|
Start-Process -FilePath "$env:SystemRoot\System32\dism.exe" -ArgumentList "/export-image /sourceimagefile:`"$mountDir\sources\install.wim`" /sourceindex:1 /destinationimagefile:`"$mountDir\sources\install.esd`" /compress:recovery" -Wait -NoNewWindow
|
||||||
|
Remove-Item "$mountDir\sources\install.wim"
|
||||||
|
Write-Host "Converted install image to ESD."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Next step boot image
|
# Next step boot image
|
||||||
Write-Host "Mounting boot image $mountDir\sources\boot.wim into $scratchDir"
|
Write-Host "Mounting boot image $mountDir\sources\boot.wim into $scratchDir"
|
||||||
Mount-WindowsImage -ImagePath "$mountDir\sources\boot.wim" -Index 2 -Path "$scratchDir"
|
Mount-WindowsImage -ImagePath "$mountDir\sources\boot.wim" -Index 2 -Path "$scratchDir"
|
||||||
@ -481,6 +533,7 @@ public class PowerManagement {
|
|||||||
Write-Host "Reason: $($exitCode.Message)"
|
Write-Host "Reason: $($exitCode.Message)"
|
||||||
Invoke-MicrowinBusyInfo -action "warning" -message $exitCode.Message
|
Invoke-MicrowinBusyInfo -action "warning" -message $exitCode.Message
|
||||||
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
||||||
|
[System.Windows.MessageBox]::Show("MicroWin failed to make the ISO.", "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
|
||||||
} catch {
|
} catch {
|
||||||
# Could not get error description from Windows APIs
|
# Could not get error description from Windows APIs
|
||||||
}
|
}
|
||||||
@ -488,7 +541,6 @@ public class PowerManagement {
|
|||||||
|
|
||||||
Toggle-MicrowinPanel 1
|
Toggle-MicrowinPanel 1
|
||||||
|
|
||||||
#$sync.MicrowinFinalIsoLocation.Text = "$env:temp\microwin.iso"
|
|
||||||
$sync.MicrowinFinalIsoLocation.Text = "$($SaveDialog.FileName)"
|
$sync.MicrowinFinalIsoLocation.Text = "$($SaveDialog.FileName)"
|
||||||
# Allow the machine to sleep again (optional)
|
# Allow the machine to sleep again (optional)
|
||||||
[PowerManagement]::SetThreadExecutionState(0)
|
[PowerManagement]::SetThreadExecutionState(0)
|
||||||
|
@ -85,6 +85,14 @@ function Microwin-NewFirstRun {
|
|||||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.StartupApp" /v Enabled /t REG_DWORD /d 0 /f
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.StartupApp" /v Enabled /t REG_DWORD /d 0 /f
|
||||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.SkyDrive.Desktop" /f
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.SkyDrive.Desktop" /f
|
||||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.SkyDrive.Desktop" /v Enabled /t REG_DWORD /d 0 /f
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Microsoft.SkyDrive.Desktop" /v Enabled /t REG_DWORD /d 0 /f
|
||||||
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.AccountHealth" /f
|
||||||
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.AccountHealth" /v Enabled /t REG_DWORD /d 0 /f
|
||||||
|
|
||||||
|
if (Test-Path -Path "$env:HOMEDRIVE\winutil-config.json")
|
||||||
|
{
|
||||||
|
Write-Host "Configuration file detected. Applying..."
|
||||||
|
iex "& { $(irm christitus.com/win) } -Config `"$env:HOMEDRIVE\winutil-config.json`" -Run"
|
||||||
|
}
|
||||||
|
|
||||||
'@
|
'@
|
||||||
$firstRun | Out-File -FilePath "$env:temp\FirstStartup.ps1" -Force
|
$firstRun | Out-File -FilePath "$env:temp\FirstStartup.ps1" -Force
|
||||||
|
@ -25,10 +25,12 @@ function Invoke-WinUtilFontScaling {
|
|||||||
|
|
||||||
# Define an array for resources to be scaled
|
# Define an array for resources to be scaled
|
||||||
$fontResources = @(
|
$fontResources = @(
|
||||||
|
# Fonts
|
||||||
"FontSize",
|
"FontSize",
|
||||||
"ButtonFontSize",
|
"ButtonFontSize",
|
||||||
"HeaderFontSize",
|
"HeaderFontSize",
|
||||||
"TabButtonFontSize",
|
"TabButtonFontSize",
|
||||||
|
"ConfigTabButtonFontSize",
|
||||||
"IconFontSize",
|
"IconFontSize",
|
||||||
"SettingsIconFontSize",
|
"SettingsIconFontSize",
|
||||||
"CloseIconFontSize",
|
"CloseIconFontSize",
|
||||||
@ -38,7 +40,21 @@ function Invoke-WinUtilFontScaling {
|
|||||||
"CustomDialogFontSize",
|
"CustomDialogFontSize",
|
||||||
"CustomDialogFontSizeHeader",
|
"CustomDialogFontSizeHeader",
|
||||||
"ConfigUpdateButtonFontSize",
|
"ConfigUpdateButtonFontSize",
|
||||||
"CheckBoxBulletDecoratorSize"
|
# Buttons and UI
|
||||||
|
"CheckBoxBulletDecoratorSize",
|
||||||
|
"ButtonWidth",
|
||||||
|
"ButtonHeight",
|
||||||
|
"TabButtonWidth",
|
||||||
|
"TabButtonHeight",
|
||||||
|
"IconButtonSize",
|
||||||
|
"AppEntryWidth",
|
||||||
|
"SearchBarWidth",
|
||||||
|
"SearchBarHeight",
|
||||||
|
"CustomDialogWidth",
|
||||||
|
"CustomDialogHeight",
|
||||||
|
"CustomDialogLogoSize",
|
||||||
|
"MicroWinLogoSize",
|
||||||
|
"ToolTipWidth"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Apply scaling to each resource
|
# Apply scaling to each resource
|
||||||
|
24
functions/public/Invoke-AutoConfigDialog.ps1
Normal file
24
functions/public/Invoke-AutoConfigDialog.ps1
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
function Invoke-AutoConfigDialog {
|
||||||
|
|
||||||
|
<#
|
||||||
|
|
||||||
|
.SYNOPSIS
|
||||||
|
Sets the automatic configuration file based on a specified JSON file
|
||||||
|
|
||||||
|
#>
|
||||||
|
|
||||||
|
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
|
||||||
|
$OFD = New-Object System.Windows.Forms.OpenFileDialog
|
||||||
|
$OFD.Filter = "JSON Files (*.json)|*.json"
|
||||||
|
$OFD.ShowDialog()
|
||||||
|
|
||||||
|
if (($OFD.FileName -eq "") -and ($sync.MicrowinAutoConfigBox.Text -eq ""))
|
||||||
|
{
|
||||||
|
Write-Host "No automatic config file has been selected. Continuing without one..."
|
||||||
|
return
|
||||||
|
}
|
||||||
|
elseif ($OFD.FileName -ne "")
|
||||||
|
{
|
||||||
|
$sync.MicrowinAutoConfigBox.Text = "$($OFD.FileName)"
|
||||||
|
}
|
||||||
|
}
|
@ -64,5 +64,6 @@ function Invoke-WPFButton {
|
|||||||
"WPFWinUtilSSHServer" {Invoke-WPFSSHServer}
|
"WPFWinUtilSSHServer" {Invoke-WPFSSHServer}
|
||||||
"WPFselectedAppsButton" {$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen}
|
"WPFselectedAppsButton" {$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen}
|
||||||
"WPFMicrowinPanelBack" {Toggle-MicrowinPanel 1}
|
"WPFMicrowinPanelBack" {Toggle-MicrowinPanel 1}
|
||||||
|
"MicrowinAutoConfigBtn" {Invoke-AutoConfigDialog}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,6 @@ function Invoke-WPFInstall {
|
|||||||
$password = $passwordBox.Text | ConvertTo-SecureString -AsPlainText -Force
|
$password = $passwordBox.Text | ConvertTo-SecureString -AsPlainText -Force
|
||||||
if ($password) {
|
if ($password) {
|
||||||
Set-LocalUser -Name $user -Password $password
|
Set-LocalUser -Name $user -Password $password
|
||||||
$password.Close()
|
|
||||||
$Form.Close()
|
$Form.Close()
|
||||||
} else {
|
} else {
|
||||||
[System.Windows.Forms.MessageBox]::Show('No password entered!')
|
[System.Windows.Forms.MessageBox]::Show('No password entered!')
|
||||||
|
@ -315,33 +315,40 @@ $sync["Form"].Add_ContentRendered({
|
|||||||
|
|
||||||
# maybe this is not the best place to load and execute config file?
|
# maybe this is not the best place to load and execute config file?
|
||||||
# maybe community can help?
|
# maybe community can help?
|
||||||
if ($PARAM_CONFIG) {
|
if ($PARAM_CONFIG -and -not [string]::IsNullOrWhiteSpace($PARAM_CONFIG)) {
|
||||||
Invoke-WPFImpex -type "import" -Config $PARAM_CONFIG
|
Invoke-WPFImpex -type "import" -Config $PARAM_CONFIG
|
||||||
if ($PARAM_RUN) {
|
if ($PARAM_RUN) {
|
||||||
|
# Wait for any existing process to complete before starting
|
||||||
while ($sync.ProcessRunning) {
|
while ($sync.ProcessRunning) {
|
||||||
Start-Sleep -Seconds 5
|
Start-Sleep -Seconds 5
|
||||||
}
|
}
|
||||||
Start-Sleep -Seconds 5
|
Start-Sleep -Seconds 5
|
||||||
|
|
||||||
Write-Host "Applying tweaks..."
|
Write-Host "Applying tweaks..."
|
||||||
|
if (-not $sync.ProcessRunning) {
|
||||||
Invoke-WPFtweaksbutton
|
Invoke-WPFtweaksbutton
|
||||||
while ($sync.ProcessRunning) {
|
while ($sync.ProcessRunning) {
|
||||||
Start-Sleep -Seconds 5
|
Start-Sleep -Seconds 5
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Start-Sleep -Seconds 5
|
Start-Sleep -Seconds 5
|
||||||
|
|
||||||
Write-Host "Installing features..."
|
Write-Host "Installing features..."
|
||||||
|
if (-not $sync.ProcessRunning) {
|
||||||
Invoke-WPFFeatureInstall
|
Invoke-WPFFeatureInstall
|
||||||
while ($sync.ProcessRunning) {
|
while ($sync.ProcessRunning) {
|
||||||
Start-Sleep -Seconds 5
|
Start-Sleep -Seconds 5
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Start-Sleep -Seconds 5
|
Start-Sleep -Seconds 5
|
||||||
|
|
||||||
Write-Host "Installing applications..."
|
Write-Host "Installing applications..."
|
||||||
|
if (-not $sync.ProcessRunning) {
|
||||||
|
Invoke-WPFInstall
|
||||||
while ($sync.ProcessRunning) {
|
while ($sync.ProcessRunning) {
|
||||||
Start-Sleep -Seconds 1
|
Start-Sleep -Seconds 1
|
||||||
}
|
}
|
||||||
Invoke-WPFInstall
|
}
|
||||||
Start-Sleep -Seconds 5
|
Start-Sleep -Seconds 5
|
||||||
|
|
||||||
Write-Host "Done."
|
Write-Host "Done."
|
||||||
@ -481,7 +488,7 @@ $sync["AboutMenuItem"].Add_Click({
|
|||||||
Author : <a href="https://github.com/ChrisTitusTech">@christitustech</a>
|
Author : <a href="https://github.com/ChrisTitusTech">@christitustech</a>
|
||||||
UI : <a href="https://github.com/MyDrift-user">@MyDrift-user</a>, <a href="https://github.com/Marterich">@Marterich</a>
|
UI : <a href="https://github.com/MyDrift-user">@MyDrift-user</a>, <a href="https://github.com/Marterich">@Marterich</a>
|
||||||
Runspace : <a href="https://github.com/DeveloperDurp">@DeveloperDurp</a>, <a href="https://github.com/Marterich">@Marterich</a>
|
Runspace : <a href="https://github.com/DeveloperDurp">@DeveloperDurp</a>, <a href="https://github.com/Marterich">@Marterich</a>
|
||||||
MicroWin : <a href="https://github.com/KonTy">@KonTy</a>, <a href="https://github.com/CodingWonders">@CodingWonders</a>
|
MicroWin : <a href="https://github.com/KonTy">@KonTy</a>, <a href="https://github.com/CodingWonders">@CodingWonders</a>, <a href="https://github.com/Real-MullaC">@Real-MullaC</a>
|
||||||
GitHub : <a href="https://github.com/ChrisTitusTech/winutil">ChrisTitusTech/winutil</a>
|
GitHub : <a href="https://github.com/ChrisTitusTech/winutil">ChrisTitusTech/winutil</a>
|
||||||
Version : <a href="https://github.com/ChrisTitusTech/winutil/releases/tag/$($sync.version)">$($sync.version)</a>
|
Version : <a href="https://github.com/ChrisTitusTech/winutil/releases/tag/$($sync.version)">$($sync.version)</a>
|
||||||
"@
|
"@
|
||||||
|
@ -1459,6 +1459,37 @@
|
|||||||
Foreground="{DynamicResource LabelboxForegroundColor}"
|
Foreground="{DynamicResource LabelboxForegroundColor}"
|
||||||
/>
|
/>
|
||||||
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
||||||
|
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap"><Bold>Tweaks (leave empty for default settings)</Bold></TextBlock>
|
||||||
|
<CheckBox Name="MicroWinWPBT" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="If enabled then allows your computer vendor to execute a program each time it boots. It enables computer vendors to force install anti-theft software, software drivers, or a software program conveniently. This could also be a security risk."><AccessText TextWrapping="Wrap" Text="Disable Windows Platform Binary Table (WPBT) (ADVANCED TWEAK)" /></CheckBox>
|
||||||
|
<CheckBox Name="MicroWinUnsupported" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="If enabled then it will allow you to upgrade your PC to Windows 11 if your PC does not support Windows 11 yet. This is good for if you do not have a USB and want to upgrade to Windows 11 on unsupported hardware."><AccessText TextWrapping="Wrap" Text="Allow this PC to upgrade to Windows 11" /></CheckBox>
|
||||||
|
<CheckBox Name="MicroWinESD" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="The ESD file format compresses the installation image even further, therefore reducing ISO file sizes a little more. Select this if you have a small USB."><AccessText TextWrapping="Wrap" Text="Convert this image to ESD (This will take longer)" /></CheckBox>
|
||||||
|
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">WinUtil configuration file (JSON)</TextBlock>
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" /> <!-- Takes the remaining space -->
|
||||||
|
<ColumnDefinition Width="32" /> <!-- Fixed width for Button -->
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBox Name="MicrowinAutoConfigBox" Background="Transparent" BorderBrush="{DynamicResource MainForegroundColor}"
|
||||||
|
Text=""
|
||||||
|
Margin="2"
|
||||||
|
IsReadOnly="False"
|
||||||
|
Grid.Column="0"
|
||||||
|
ToolTip="Path of your configuration file"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="{DynamicResource LabelboxForegroundColor}">
|
||||||
|
</TextBox>
|
||||||
|
<Button Name="MicrowinAutoConfigBtn"
|
||||||
|
Width="Auto"
|
||||||
|
Height="Auto"
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="2"
|
||||||
|
Padding="1" VerticalAlignment="Center">
|
||||||
|
<Button.Content>
|
||||||
|
...
|
||||||
|
</Button.Content>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
<Rectangle Fill="{DynamicResource 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">
|
||||||
@ -1527,7 +1558,7 @@
|
|||||||
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/>
|
||||||
- Click on the "Select Windows ISO" button and wait for WinUtil to process the image <LineBreak/>
|
- Click on the "Get Windows ISO" button and wait for WinUtil to process the image <LineBreak/>
|
||||||
It will be processed and unpacked which may take some time <LineBreak/>
|
It will be processed and unpacked which may take some time <LineBreak/>
|
||||||
- Once complete, choose which Windows flavor you want to base your image on <LineBreak/>
|
- Once complete, choose which Windows flavor you want to base your image on <LineBreak/>
|
||||||
- Click the "Start Process" button <LineBreak/>
|
- Click the "Start Process" button <LineBreak/>
|
||||||
|
Reference in New Issue
Block a user