mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-12-27 16:31:30 -06:00
Compare commits
17 Commits
69c659f4b5
...
574adc49d3
Author | SHA1 | Date | |
---|---|---|---|
|
574adc49d3 | ||
|
2ce4f54b80 | ||
|
d23e6f92fd | ||
|
2466b903f6 | ||
|
2f8eaf4f18 | ||
|
aa717838b2 | ||
|
40c7a1b8d5 | ||
|
3cfc7c92b4 | ||
|
9979a02a30 | ||
|
759d8f6878 | ||
|
2c4cf504fc | ||
|
cc7b3d7836 | ||
|
8e647e8c49 | ||
|
c5968243eb | ||
|
706f65f631 | ||
|
9dcf8dd50e | ||
|
a45402e9d8 |
@ -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.
|
||||
|
||||
<!-- sponsors --><a href="https://github.com/TriHydera"><img src="https://avatars.githubusercontent.com/u/39857764?u=5dbda638f45530582eee1703b4473f2a5e229e28&v=4" width="60px" alt="User avatar: TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https://avatars.githubusercontent.com/u/3272468?u=4391ed4655e4fd8b56e23b4169e44e2ac9b6cd97&v=4" width="60px" alt="User avatar: " /></a><a href="https://github.com/DelDongo"><img src="https://avatars.githubusercontent.com/u/127976398?v=4" width="60px" alt="User avatar: " /></a><a href="https://github.com/markamos"><img src="https://avatars.githubusercontent.com/u/9561861?u=3cca179dcff0413538591e57a3abea116d65ce56&v=4" width="60px" alt="User avatar: Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://avatars.githubusercontent.com/u/54533224?u=a49ea000a8f52adb31382ea69a1a7501b27fefdd&v=4" width="60px" alt="User avatar: " /></a><a href="https://github.com/mews-se"><img src="https://avatars.githubusercontent.com/u/58894405?v=4" width="60px" alt="User avatar: " /></a><a href="https://github.com/jdiegmueller"><img src="https://avatars.githubusercontent.com/u/18660571?u=601d0a23040a271c86b5d40339f899a6dbf27086&v=4" width="60px" alt="User avatar: Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https://avatars.githubusercontent.com/u/105566568?v=4" width="60px" alt="User avatar: " /></a><a href="https://github.com/zepled112"><img src="https://avatars.githubusercontent.com/u/65176625?v=4" width="60px" alt="User avatar: wyatt" /></a><a href="https://github.com/altugtekiner"><img src="https://avatars.githubusercontent.com/u/105917451?u=ee73ff639c7bd9feb4708ab4ba7b14eff80196f7&v=4" width="60px" alt="User avatar: " /></a><a href="https://github.com/robertsandrock"><img src="https://avatars.githubusercontent.com/u/12015331?u=76849d3cb36b420922d235299558e00a09f2f8b4&v=4" width="60px" alt="User avatar: RMS" /></a><a href="https://github.com/mmomega"><img src="https://avatars.githubusercontent.com/u/71956566?v=4" width="60px" alt="User avatar: " /></a><a href="https://github.com/KenichiQaz"><img src="https://avatars.githubusercontent.com/u/31177857?u=efdbae734a4c60a7bb95df4659d0535e60a6fd57&v=4" width="60px" alt="User avatar: Stefan" /></a><a href="https://github.com/paulsheets"><img src="https://avatars.githubusercontent.com/u/45240946?u=d4db66f8e8d7a2606fe7a5521daf48ca9f097105&v=4" width="60px" alt="User avatar: Paul" /></a><a href="https://github.com/djones369"><img src="https://avatars.githubusercontent.com/u/4107092?v=4" width="60px" alt="User avatar: Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https://avatars.githubusercontent.com/u/19240897?u=f82b4be098cac65c8421421b70ebd2d1da85c67e&v=4" width="60px" alt="User avatar: Anthony Mendez" /></a><a href="https://github.com/claudemods"><img src="https://avatars.githubusercontent.com/u/73653396?u=d64c656fb8db24ef56bb000197532df9b618d06c&v=4" width="60px" alt="User avatar: Claudemods" /></a><a href="https://github.com/FatBastard0"><img src="https://avatars.githubusercontent.com/u/173957728?v=4" width="60px" alt="User avatar: " /></a><a href="https://github.com/Ascent7910"><img src="https://avatars.githubusercontent.com/u/118260621?v=4" width="60px" alt="User avatar: Max" /></a><a href="https://github.com/DursleyGuy"><img src="https://avatars.githubusercontent.com/u/140165544?v=4" width="60px" alt="User avatar: DursleyGuy" /></a><a href="https://github.com/YamiSandman616"><img src="https://avatars.githubusercontent.com/u/183505690?u=c3bd20157058b6215e28f7568d4f8c4fbbe92838&v=4" width="60px" alt="User avatar: Sandman616" /></a><a href="https://github.com/realmuddy"><img src="https://avatars.githubusercontent.com/u/30978236?v=4" width="60px" alt="User avatar: Phillip Waters" /></a><a href="https://github.com/quaszi"><img src="https://avatars.githubusercontent.com/u/51266738?u=2e3185214607e51239c5969c866ddd5eb1bdee48&v=4" width="60px" alt="User avatar: " /></a><a href="https://github.com/Psyhackological"><img src="https://avatars.githubusercontent.com/u/47569716?u=66dc5e86731eaf8c6bc78a1bff34420ed2e5402b&v=4" width="60px" alt="User avatar: Konrad Konieczny" /></a><!-- sponsors -->
|
||||
<!-- sponsors --><a href="https://github.com/TriHydera"><img src="https://github.com/TriHydera.png" width="60px" alt="User avatar: TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https://github.com/jozozovko.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DelDongo"><img src="https://github.com/DelDongo.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/markamos"><img src="https://github.com/markamos.png" width="60px" alt="User avatar: Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://github.com/dwelfusius.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/mews-se"><img src="https://github.com/mews-se.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/jdiegmueller"><img src="https://github.com/jdiegmueller.png" width="60px" alt="User avatar: Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https://github.com/AlanTristar.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/zepled112"><img src="https://github.com/zepled112.png" width="60px" alt="User avatar: wyatt" /></a><a href="https://github.com/altugtekiner"><img src="https://github.com/altugtekiner.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/robertsandrock"><img src="https://github.com/robertsandrock.png" width="60px" alt="User avatar: RMS" /></a><a href="https://github.com/mmomega"><img src="https://github.com/mmomega.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/KenichiQaz"><img src="https://github.com/KenichiQaz.png" width="60px" alt="User avatar: Stefan" /></a><a href="https://github.com/paulsheets"><img src="https://github.com/paulsheets.png" width="60px" alt="User avatar: Paul" /></a><a href="https://github.com/djones369"><img src="https://github.com/djones369.png" width="60px" alt="User avatar: Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https://github.com/anthonymendez.png" width="60px" alt="User avatar: Anthony Mendez" /></a><a href="https://github.com/claudemods"><img src="https://github.com/claudemods.png" width="60px" alt="User avatar: Claudemods" /></a><a href="https://github.com/FatBastard0"><img src="https://github.com/FatBastard0.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/Ascent7910"><img src="https://github.com/Ascent7910.png" width="60px" alt="User avatar: Max" /></a><a href="https://github.com/DursleyGuy"><img src="https://github.com/DursleyGuy.png" width="60px" alt="User avatar: DursleyGuy" /></a><a href="https://github.com/YamiSandman616"><img src="https://github.com/YamiSandman616.png" width="60px" alt="User avatar: Sandman616" /></a><a href="https://github.com/realmuddy"><img src="https://github.com/realmuddy.png" width="60px" alt="User avatar: Phillip Waters" /></a><a href="https://github.com/quaszi"><img src="https://github.com/quaszi.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/Psyhackological"><img src="https://github.com/Psyhackological.png" width="60px" alt="User avatar: Konrad Konieczny" /></a><!-- sponsors -->
|
||||
|
||||
## 🏅 Thanks to all Contributors
|
||||
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.
|
||||
|
@ -55,6 +55,8 @@ public class PowerManagement {
|
||||
$injectDrivers = $sync.MicrowinInjectDrivers.IsChecked
|
||||
$importDrivers = $sync.MicrowinImportDrivers.IsChecked
|
||||
|
||||
$importVirtIO = $sync.MicrowinCopyVirtIO.IsChecked
|
||||
|
||||
$mountDir = $sync.MicrowinMountDir.Text
|
||||
$scratchDir = $sync.MicrowinScratchDir.Text
|
||||
|
||||
@ -155,6 +157,11 @@ public class PowerManagement {
|
||||
}
|
||||
}
|
||||
|
||||
if ($importVirtIO) {
|
||||
Write-Host "Copying VirtIO drivers..."
|
||||
Microwin-CopyVirtIO
|
||||
}
|
||||
|
||||
Write-Host "Remove Features from the image"
|
||||
Microwin-RemoveFeatures
|
||||
Write-Host "Removing features complete!"
|
||||
@ -189,8 +196,6 @@ public class PowerManagement {
|
||||
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Windows\DiagTrack" -Directory
|
||||
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Windows\InboxApps" -Directory
|
||||
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Windows\System32\LocationNotificationWindows.exe"
|
||||
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Photo Viewer" -Directory
|
||||
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Photo Viewer" -Directory
|
||||
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Media Player" -Directory
|
||||
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Program Files\Windows Media Player" -Directory
|
||||
Microwin-RemoveFileOrDirectory -pathToDelete "$($scratchDir)\Program Files (x86)\Windows Mail" -Directory
|
||||
|
@ -223,7 +223,7 @@ function Invoke-MicrowinGetIso {
|
||||
$mountDir = Join-Path $env:TEMP $randomMicrowin
|
||||
$scratchDir = Join-Path $env:TEMP $randomMicrowinScratch
|
||||
} else {
|
||||
$scratchDir = $sync.MicrowinScratchDirBox.Text+"Scrach"
|
||||
$scratchDir = $sync.MicrowinScratchDirBox.Text+"Scratch"
|
||||
$mountDir = $sync.MicrowinScratchDirBox.Text+"micro"
|
||||
}
|
||||
|
||||
@ -242,8 +242,8 @@ function Invoke-MicrowinGetIso {
|
||||
|
||||
# xcopy we can verify files and also not copy files that already exist, but hard to measure
|
||||
# xcopy.exe /E /I /H /R /Y /J $DriveLetter":" $mountDir >$null
|
||||
$totalTime = Measure-Command { Copy-Files "$($driveLetter):" $mountDir -Recurse -Force }
|
||||
Write-Host "Copy complete! Total Time: $($totalTime.Minutes)m$($totalTime.Seconds)s"
|
||||
$totalTime = Measure-Command { Copy-Files "$($driveLetter):" "$mountDir" -Recurse -Force }
|
||||
Write-Host "Copy complete! Total Time: $($totalTime.Minutes) minutes, $($totalTime.Seconds) seconds"
|
||||
|
||||
$wimFile = "$mountDir\sources\install.wim"
|
||||
Write-Host "Getting image information $wimFile"
|
||||
|
@ -16,6 +16,54 @@ function Microwin-CopyToUSB([string]$fileToCopy) {
|
||||
}
|
||||
|
||||
Write-Host "File copied to Ventoy drive $($volume.DriveLetter)"
|
||||
|
||||
# Detect if config files are present, move them if they are, and configure the Ventoy drive to not bypass the requirements
|
||||
$customVentoyConfig = @'
|
||||
{
|
||||
"control":[
|
||||
{ "VTOY_WIN11_BYPASS_CHECK": "0" },
|
||||
{ "VTOY_WIN11_BYPASS_NRO": "0" }
|
||||
],
|
||||
"control_legacy":[
|
||||
{ "VTOY_WIN11_BYPASS_CHECK": "0" },
|
||||
{ "VTOY_WIN11_BYPASS_NRO": "0" }
|
||||
],
|
||||
"control_uefi":[
|
||||
{ "VTOY_WIN11_BYPASS_CHECK": "0" },
|
||||
{ "VTOY_WIN11_BYPASS_NRO": "0" }
|
||||
],
|
||||
"control_ia32":[
|
||||
{ "VTOY_WIN11_BYPASS_CHECK": "0" },
|
||||
{ "VTOY_WIN11_BYPASS_NRO": "0" }
|
||||
],
|
||||
"control_aa64":[
|
||||
{ "VTOY_WIN11_BYPASS_CHECK": "0" },
|
||||
{ "VTOY_WIN11_BYPASS_NRO": "0" }
|
||||
],
|
||||
"control_mips":[
|
||||
{ "VTOY_WIN11_BYPASS_CHECK": "0" },
|
||||
{ "VTOY_WIN11_BYPASS_NRO": "0" }
|
||||
]
|
||||
}
|
||||
'@
|
||||
|
||||
try {
|
||||
Write-Host "Writing custom Ventoy configuration. Please wait..."
|
||||
if (Test-Path -Path "$($volume.DriveLetter):\ventoy\ventoy.json" -PathType Leaf) {
|
||||
Write-Host "A Ventoy configuration file exists. Moving it..."
|
||||
Move-Item -Path "$($volume.DriveLetter):\ventoy\ventoy.json" -Destination "$($volume.DriveLetter):\ventoy\ventoy.json.old" -Force
|
||||
Write-Host "Existing Ventoy configuration has been moved to `"ventoy.json.old`". Feel free to put your config back into the `"ventoy.json`" file."
|
||||
}
|
||||
if (-not (Test-Path -Path "$($volume.DriveLetter):\ventoy")) {
|
||||
New-Item -Path "$($volume.DriveLetter):\ventoy" -ItemType Directory -Force | Out-Null
|
||||
}
|
||||
$customVentoyConfig | Out-File -FilePath "$($volume.DriveLetter):\ventoy\ventoy.json" -Encoding utf8 -Force
|
||||
Write-Host "The Ventoy drive has been successfully configured."
|
||||
} catch {
|
||||
Write-Host "Could not configure Ventoy drive. Error: $($_.Exception.Message)`n"
|
||||
Write-Host "Be sure to add the following configuration to the Ventoy drive by either creating a `"ventoy.json`" file in the `"ventoy`" directory (create it if it doesn't exist) or by editing an existing one: `n`n$customVentoyConfig`n"
|
||||
Write-Host "Failure to do this will cause conflicts with your target ISO file."
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
40
functions/microwin/Microwin-CopyVirtIO.ps1
Normal file
40
functions/microwin/Microwin-CopyVirtIO.ps1
Normal file
@ -0,0 +1,40 @@
|
||||
function Microwin-CopyVirtIO {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Downloads and copies the VirtIO Guest Tools drivers to the target MicroWin ISO
|
||||
.NOTES
|
||||
A network connection must be available and the servers of Fedora People must be up. Automatic driver installation will not be added yet - I want this implementation to be reliable.
|
||||
#>
|
||||
|
||||
try {
|
||||
Write-Host "Checking existing files..."
|
||||
if (Test-Path -Path "$($env:TEMP)\virtio.iso" -PathType Leaf) {
|
||||
Write-Host "VirtIO ISO has been detected. Deleting..."
|
||||
Remove-Item -Path "$($env:TEMP)\virtio.iso" -Force
|
||||
}
|
||||
Write-Host "Getting latest VirtIO drivers. Please wait. This can take some time, depending on your network connection speed and the speed of the servers..."
|
||||
Start-BitsTransfer -Source "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso" -Destination "$($env:TEMP)\virtio.iso" -DisplayName "Downloading VirtIO drivers..."
|
||||
# Do everything else if the VirtIO ISO exists
|
||||
if (Test-Path -Path "$($env:TEMP)\virtio.iso" -PathType Leaf) {
|
||||
Write-Host "Mounting ISO. Please wait."
|
||||
$virtIO_ISO = Mount-DiskImage -PassThru "$($env:TEMP)\virtio.iso"
|
||||
$driveLetter = (Get-Volume -DiskImage $virtIO_ISO).DriveLetter
|
||||
# Create new directory for VirtIO on ISO
|
||||
New-Item -Path "$mountDir\VirtIO" -ItemType Directory | Out-Null
|
||||
$totalTime = Measure-Command { Copy-Files "$($driveLetter):" "$mountDir\VirtIO" -Recurse -Force }
|
||||
Write-Host "VirtIO contents have been successfully copied. Time taken: $($totalTime.Minutes) minutes, $($totalTime.Seconds) seconds`n"
|
||||
Get-Volume $driveLetter | Get-DiskImage | Dismount-DiskImage
|
||||
Remove-Item -Path "$($env:TEMP)\virtio.iso" -Force -ErrorAction SilentlyContinue
|
||||
Write-Host "To proceed with installation of the MicroWin image in QEMU/Proxmox VE:"
|
||||
Write-Host "1. Proceed with Setup until you reach the disk selection screen, in which you won't see any drives"
|
||||
Write-Host "2. Click `"Load Driver`" and click Browse"
|
||||
Write-Host "3. In the folder selection dialog, point to this path:`n`n `"D:\VirtIO\vioscsi\w11\amd64`" (replace amd64 with ARM64 if you are using Windows on ARM, and `"D:`" with the drive letter of the ISO)`n"
|
||||
Write-Host "4. Select all drivers that will appear in the list box and click OK"
|
||||
} else {
|
||||
throw "Could not download VirtIO drivers"
|
||||
}
|
||||
} catch {
|
||||
Write-Host "We could not download and/or prepare the VirtIO drivers. Error information: $_`n"
|
||||
Write-Host "You will need to download these drivers manually. Location: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso"
|
||||
}
|
||||
}
|
@ -63,6 +63,22 @@ function Microwin-NewFirstRun {
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
# Get BCD entries and set bootmgr timeout accordingly
|
||||
try
|
||||
{
|
||||
# Check if the number of occurrences of "path" is 2 - this fixes the Boot Manager screen issue (#2562)
|
||||
if ((bcdedit | Select-String "path").Count -eq 2)
|
||||
{
|
||||
# Set bootmgr timeout to 0
|
||||
bcdedit /set `{bootmgr`} timeout 0
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
'@
|
||||
$firstRun | Out-File -FilePath "$env:temp\FirstStartup.ps1" -Force
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ function Microwin-NewUnattend {
|
||||
<Group>Administrators</Group>
|
||||
<Password>
|
||||
<Value>PW-REPLACEME</Value>
|
||||
<PlainText>true</PlainText>
|
||||
<PlainText>PT-STATUS</PlainText>
|
||||
</Password>
|
||||
</LocalAccount>
|
||||
</LocalAccounts>
|
||||
@ -42,7 +42,7 @@ function Microwin-NewUnattend {
|
||||
<LogonCount>1</LogonCount>
|
||||
<Password>
|
||||
<Value>PW-REPLACEME</Value>
|
||||
<PlainText>true</PlainText>
|
||||
<PlainText>PT-STATUS</PlainText>
|
||||
</Password>
|
||||
</AutoLogon>
|
||||
<OOBE>
|
||||
@ -295,15 +295,40 @@ function Microwin-NewUnattend {
|
||||
</settings>
|
||||
'@
|
||||
if ((Microwin-TestCompatibleImage $imgVersion $([System.Version]::new(10,0,22000,1))) -eq $false) {
|
||||
# Replace the placeholder text with an empty string to make it valid for Windows 10 Setup
|
||||
$unattend = $unattend.Replace("<#REPLACEME#>", "").Trim()
|
||||
# Replace the placeholder text with an empty string to make it valid for Windows 10 Setup
|
||||
$unattend = $unattend.Replace("<#REPLACEME#>", "").Trim()
|
||||
} else {
|
||||
# Replace the placeholder text with the Specialize pass
|
||||
$unattend = $unattend.Replace("<#REPLACEME#>", $specPass).Trim()
|
||||
# Replace the placeholder text with the Specialize pass
|
||||
$unattend = $unattend.Replace("<#REPLACEME#>", $specPass).Trim()
|
||||
}
|
||||
|
||||
# User password in Base64. According to Microsoft, this is the way you can hide this sensitive information.
|
||||
# More information can be found here: https://learn.microsoft.com/en-us/windows-hardware/customize/desktop/wsim/hide-sensitive-data-in-an-answer-file
|
||||
# Yeah, I know this is not the best way to protect this kind of data, but we all know how Microsoft is - "the Apple of security" (in a sense, it takes them
|
||||
# an eternity to implement basic security features right. Just look at the NTLM and Kerberos situation!)
|
||||
|
||||
$b64pass = ""
|
||||
|
||||
# Replace default User and Password values with the provided parameters
|
||||
$unattend = $unattend.Replace("USER-REPLACEME", $userName).Trim()
|
||||
$unattend = $unattend.Replace("PW-REPLACEME", $userPassword).Trim()
|
||||
try {
|
||||
# I want to play it safe here - I don't want encoding mismatch problems like last time
|
||||
|
||||
# NOTE: "Password" needs to be appended to the password specified by the user. Otherwise, a parse error will occur when processing oobeSystem.
|
||||
# This will not be added to the actual password stored in the target system's SAM file - only the provided password
|
||||
$b64pass = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes("$($userPassword)Password"))
|
||||
} catch {
|
||||
$b64pass = ""
|
||||
}
|
||||
if ($b64pass -ne "") {
|
||||
# If we could encode the password with Base64, put it in the answer file and indicate that it's NOT in plain text
|
||||
$unattend = $unattend.Replace("PW-REPLACEME", $b64pass).Trim()
|
||||
$unattend = $unattend.Replace("PT-STATUS", "false").Trim()
|
||||
$b64pass = ""
|
||||
} else {
|
||||
$unattend = $unattend.Replace("PW-REPLACEME", $userPassword).Trim()
|
||||
$unattend = $unattend.Replace("PT-STATUS", "true").Trim()
|
||||
}
|
||||
|
||||
# Save unattended answer file with UTF-8 encoding
|
||||
$unattend | Out-File -FilePath "$env:temp\unattend.xml" -Force -Encoding utf8
|
||||
|
@ -7,45 +7,18 @@ function Microwin-RemovePackages {
|
||||
$_ -NotLike "*indows-Client-LanguagePack*" -AND
|
||||
$_ -NotLike "*LanguageFeatures-Basic*" -AND
|
||||
$_ -NotLike "*Package_for_ServicingStack*" -AND
|
||||
$_ -NotLike "*.NET*" -AND
|
||||
$_ -NotLike "*Store*" -AND
|
||||
$_ -NotLike "*VCLibs*" -AND
|
||||
$_ -NotLike "*AAD.BrokerPlugin",
|
||||
$_ -NotLike "*LockApp*" -AND
|
||||
$_ -NotLike "*DotNet*" -AND
|
||||
$_ -NotLike "*Notepad*" -AND
|
||||
$_ -NotLike "*immersivecontrolpanel*" -AND
|
||||
$_ -NotLike "*ContentDeliveryManager*" -AND
|
||||
$_ -NotLike "*PinningConfirMationDialog*" -AND
|
||||
$_ -NotLike "*SecHealthUI*" -AND
|
||||
$_ -NotLike "*SecureAssessmentBrowser*" -AND
|
||||
$_ -NotLike "*PrintDialog*" -AND
|
||||
$_ -NotLike "*AssignedAccessLockApp*" -AND
|
||||
$_ -NotLike "*OOBENetworkConnectionFlow*" -AND
|
||||
$_ -NotLike "*Apprep.ChxApp*" -AND
|
||||
$_ -NotLike "*CBS*" -AND
|
||||
$_ -NotLike "*OOBENetworkCaptivePortal*" -AND
|
||||
$_ -NotLike "*PeopleExperienceHost*" -AND
|
||||
$_ -NotLike "*ParentalControls*" -AND
|
||||
$_ -NotLike "*Win32WebViewHost*" -AND
|
||||
$_ -NotLike "*InputApp*" -AND
|
||||
$_ -NotLike "*DirectPlay*" -AND
|
||||
$_ -NotLike "*AccountsControl*" -AND
|
||||
$_ -NotLike "*AsyncTextService*" -AND
|
||||
$_ -NotLike "*CapturePicker*" -AND
|
||||
$_ -NotLike "*CredDialogHost*" -AND
|
||||
$_ -NotLike "*BioEnrollMent*" -AND
|
||||
$_ -NotLike "*ShellExperienceHost*" -AND
|
||||
$_ -NotLike "*DesktopAppInstaller*" -AND
|
||||
$_ -NotLike "*WebMediaExtensions*" -AND
|
||||
$_ -NotLike "*WMIC*" -AND
|
||||
$_ -NotLike "*UI.XaML*" -AND
|
||||
$_ -NotLike "*Ethernet*" -AND
|
||||
$_ -NotLike "*Wifi*" -AND
|
||||
$_ -NotLike "*FodMetadata*" -AND
|
||||
$_ -NotLike "*Foundation*" -AND
|
||||
$_ -NotLike "*LanguageFeatures*" -AND
|
||||
$_ -NotLike "*VBSCRIPT*" -AND
|
||||
$_ -NotLike "*License*"
|
||||
$_ -NotLike "*License*" -AND
|
||||
$_ -NotLike "*Hello-Face*" -AND
|
||||
$_ -NotLike "*ISE*"
|
||||
}
|
||||
|
||||
$failedCount = 0
|
||||
|
@ -2,11 +2,17 @@ function Copy-Files {
|
||||
<#
|
||||
|
||||
.DESCRIPTION
|
||||
This function will make all modifications to the registry
|
||||
|
||||
Copies the contents of a given ISO file to a given destination
|
||||
.PARAMETER Path
|
||||
The source of the files to copy
|
||||
.PARAMETER Destination
|
||||
The destination to copy the files to
|
||||
.PARAMETER Recurse
|
||||
Determines whether or not to copy all files of the ISO file, including those in subdirectories
|
||||
.PARAMETER Force
|
||||
Determines whether or not to overwrite existing files
|
||||
.EXAMPLE
|
||||
|
||||
Set-WinUtilRegistry -Name "PublishUserActivities" -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Type "DWord" -Value "0"
|
||||
Copy-Files "D:" "C:\ISOFile" -Recurse -Force
|
||||
|
||||
#>
|
||||
param (
|
||||
@ -23,7 +29,7 @@ function Copy-Files {
|
||||
|
||||
foreach ($file in $files) {
|
||||
$status = "Copying file {0} of {1}: {2}" -f $counter, $files.Count, $file.Name
|
||||
Write-Progress -Activity "Copy Windows files" -Status $status -PercentComplete ($counter++/$files.count*100)
|
||||
Write-Progress -Activity "Copy disc image files" -Status $status -PercentComplete ($counter++/$files.count*100)
|
||||
$restpath = $file.FullName -Replace $path, ''
|
||||
|
||||
if ($file.PSIsContainer -eq $true) {
|
||||
@ -35,7 +41,7 @@ function Copy-Files {
|
||||
Set-ItemProperty -Path ($destination+$restpath) -Name IsReadOnly -Value $false
|
||||
}
|
||||
}
|
||||
Write-Progress -Activity "Copy Windows files" -Status "Ready" -Completed
|
||||
Write-Progress -Activity "Copy disc image files" -Status "Ready" -Completed
|
||||
} catch {
|
||||
Write-Host "Unable to Copy all the files due to an unhandled exception" -ForegroundColor Yellow
|
||||
Write-Host "Error information: $($_.Exception.Message)`n" -ForegroundColor Yellow
|
||||
|
@ -1111,8 +1111,10 @@
|
||||
Choose a Windows ISO file that you've downloaded <LineBreak/>
|
||||
Check the status in the console
|
||||
</TextBlock>
|
||||
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
||||
<TextBlock Margin="5" Padding="1" TextWrapping="Wrap" Foreground="{DynamicResource ComboBoxForegroundColor}" ToolTip="Scratch directories act as a custom destination for image files"><Bold>Scratch directory settings (optional)</Bold></TextBlock>
|
||||
<CheckBox x:Name="WPFMicrowinISOScratchDir" Content="Use ISO directory for ScratchDir " IsChecked="False" Margin="{DynamicResource MicrowinCheckBoxMargin}"
|
||||
ToolTip="Use ISO directory for ScratchDir " />
|
||||
ToolTip="Check this to use the path of the ISO file you specify as a scratch directory" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" /> <!-- Takes the remaining space -->
|
||||
@ -1122,7 +1124,7 @@
|
||||
Text="Scratch"
|
||||
Margin="2"
|
||||
IsReadOnly="False"
|
||||
ToolTip="Alt Path For Scratch Directory"
|
||||
ToolTip="Specify an alternate path for the scratch directory"
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource LabelboxForegroundColor}">
|
||||
@ -1138,6 +1140,7 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
</Grid>
|
||||
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
||||
<TextBox Name="MicrowinFinalIsoLocation" Background="Transparent" BorderBrush="{DynamicResource MainForegroundColor}"
|
||||
Text="ISO location will be printed here"
|
||||
Margin="2"
|
||||
@ -1172,6 +1175,7 @@
|
||||
ToolTip="Path to unpacked drivers all sys and inf files for devices that need drivers"
|
||||
/>
|
||||
<CheckBox Name="MicrowinImportDrivers" Content="Import drivers from current system" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="Export all third-party drivers from your system and inject them to the MicroWin image"/>
|
||||
<CheckBox Name="MicrowinCopyVirtIO" Content="Include VirtIO drivers" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="Copy VirtIO Guest Tools drivers to your ISO file. Check this only if you want to use it on QEMU/Proxmox VE"/>
|
||||
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
||||
<CheckBox Name="WPFMicrowinCopyToUsb" Content="Copy to Ventoy" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="Copy to USB disk with a label Ventoy"/>
|
||||
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
||||
|
Loading…
Reference in New Issue
Block a user