Test 2023 12 20 (#1337)

* Update winutil.ps1

* [Fix]: MicroWin finds but fails to use system oscdimg (#1298)

* Update winutil.ps1 (#1295)

* [Fix]: MicroWin finds but fails to use system oscdimg

* Compiled change b740693

---------

Co-authored-by: Chris Titus <contact@christitus.com>

* Fix wrong hash verification for oscdimg (#1301)

* Update winutil.ps1 (#1295)

* Fixed wrong hash verification for oscdimg

---------

Co-authored-by: Chris Titus <contact@christitus.com>

* Fix Winget package for Chromium and add Ungoogled-Chromium (#1306)

* Fix Chocolatey package for Chromium, add Ungoogled-Chromium

The Chocolatey package for Chromium was previously the one for Ungoogled-Chromium instead, I fixed it and added Ungoogled-Chromium as a separate package instead.

* Add ungoogled-chromium to inputXML

* Making Install section fully data driven (#1326)

Co-authored-by: KonTy <KonTy@github.com>

* Update README for India blocking (#1336)

* Fixed a couple of MicroWin issues (#1313)

* Update winutil.ps1 (#1295)

* Update MicroWin-Helper.ps1

Fix AppX package issue

* Update winutil.ps1

Fixed AppX package removal issue

* Added error detection to AppX removal

Adds error detection to the AppX package removal function in case the process of getting applications fails

This change might fix issue #1324

* Force DISM commands to be in English

Fixes an issue where MicroWin processing would fail on hosts with languages other than English.

This is because, by default, DISM uses the system language. By passing the /English flag, we're forcing DISM to be in English

---------

Co-authored-by: Chris Titus <contact@christitus.com>

* fix app display to be alphabetical

---------

Co-authored-by: kian yamamoto <kianjyamamoto@gmail.com>
Co-authored-by: Júlio C. Oliveira <braxkan@gmail.com>
Co-authored-by: AlbydS <119180144+AlbydST@users.noreply.github.com>
Co-authored-by: KonTy <9524513+KonTy@users.noreply.github.com>
Co-authored-by: KonTy <KonTy@github.com>
Co-authored-by: Munkk <152475628+munkk01@users.noreply.github.com>
Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>
This commit is contained in:
Chris Titus
2024-01-02 15:45:06 -06:00
committed by GitHub
parent 3bb48564ef
commit 771c268130
9 changed files with 1961 additions and 1670 deletions

View File

@ -18,7 +18,7 @@ function Get-Oscdimg {
Write-Host "[INFO] oscdimg.exe SHA-256 Hash: $sha256Hash"
$expectedHash = "F62B91A06F94019A878DD9D1713FFBA2140B863C131EB78A329B4CCD6102960E" # Replace with the actual expected hash
$expectedHash = "AB9E161049D293B544961BFDF2D61244ADE79376D6423DF4F60BF9B147D3C78D" # Replace with the actual expected hash
if ($sha256Hash -eq $expectedHash) {
Write-Host "Hashes match. File is verified."
} else {

View File

@ -12,7 +12,7 @@ function Remove-Features([switch] $dumpFeatures = $false, [switch] $keepDefender
Remove-Features -keepDefender:$false
#>
$appxlist = dism /image:$scratchDir /Get-Features | Select-String -Pattern "Feature Name : " -CaseSensitive -SimpleMatch
$appxlist = dism /English /image:$scratchDir /Get-Features | Select-String -Pattern "Feature Name : " -CaseSensitive -SimpleMatch
$appxlist = $appxlist -split "Feature Name : " | Where-Object {$_}
if ($dumpFeatures)
{
@ -40,7 +40,7 @@ function Remove-Features([switch] $dumpFeatures = $false, [switch] $keepDefender
function Remove-Packages
{
$appxlist = dism /Image:$scratchDir /Get-Packages | Select-String -Pattern "Package Identity : " -CaseSensitive -SimpleMatch
$appxlist = dism /English /Image:$scratchDir /Get-Packages | Select-String -Pattern "Package Identity : " -CaseSensitive -SimpleMatch
$appxlist = $appxlist -split "Package Identity : " | Where-Object {$_}
$appxlist = $appxlist | Where-Object {
@ -85,7 +85,7 @@ function Remove-Packages
{
$status = "Removing $appx"
Write-Progress -Activity "Removing Apps" -Status $status -PercentComplete ($counter++/$appxlist.Count*100)
dism /image:$scratchDir /Remove-Package /PackageName:$appx /NoRestart
dism /English /image:$scratchDir /Remove-Package /PackageName:$appx /NoRestart
}
Write-Progress -Activity "Removing Apps" -Status "Ready" -Completed
}
@ -104,16 +104,22 @@ function Remove-ProvisionedPackages
$_.PackageName -NotLike "*Wifi*" -and
$_.PackageName -NotLike "*Foundation*"
}
$counter = 0
foreach ($appx in $appxProvisionedPackages)
{
$status = "Removing Provisioned $appx"
Write-Progress -Activity "Removing Provisioned Apps" -Status $status -PercentComplete ($counter++/$appxProvisionedPackages.Count*100)
dism /image:$scratchDir /Remove-ProvisionedAppxPackage /PackageName:$appx /NoRestart
}
Write-Progress -Activity "Removing Provisioned Apps" -Status "Ready" -Completed
if ($?)
{
$counter = 0
foreach ($appx in $appxProvisionedPackages)
{
$status = "Removing Provisioned $($appx.PackageName)"
Write-Progress -Activity "Removing Provisioned Apps" -Status $status -PercentComplete ($counter++/$appxProvisionedPackages.Count*100)
dism /English /image:$scratchDir /Remove-ProvisionedAppxPackage /PackageName:$($appx.PackageName) /NoRestart
}
Write-Progress -Activity "Removing Provisioned Apps" -Status "Ready" -Completed
}
else
{
Write-Host "Could not get Provisioned App information. Skipping process..."
}
}
function Copy-ToUSB([string] $fileToCopy)

View File

@ -18,12 +18,10 @@ function Invoke-WPFGetIso {
Write-Host "/ /\/\ \| || (__ | | | (_) | \ /\ / | || | | | "
Write-Host "\/ \/|_| \___||_| \___/ \/ \/ |_||_| |_| "
$oscdImgFound = [bool] (Get-Command -ErrorAction Ignore -Type Application oscdimg.exe)
$oscdimgPath = Join-Path $env:TEMP 'oscdimg.exe'
$oscdImgFound = [bool] (Get-Command -ErrorAction Ignore -Type Application oscdimg.exe) -or (Test-Path $oscdimgPath -PathType Leaf)
Write-Host "oscdimg.exe on system: $oscdImgFound"
$oscdimgPath = Join-Path $env:TEMP 'oscdimg.exe'
$oscdImgFound = Test-Path $oscdimgPath -PathType Leaf
if (!$oscdImgFound)
{
$downloadFromGitHub = $sync.WPFMicrowinDownloadFromGitHub.IsChecked
@ -32,7 +30,7 @@ function Invoke-WPFGetIso {
{
# only show the message to people who did check the box to download from github, if you check the box
# you consent to downloading it, no need to show extra dialogs
[System.Windows.MessageBox]::Show("oscdimge.exe is not found on the system, winutil will now attempt do download and install it using choco or github. This might take a long time.")
[System.Windows.MessageBox]::Show("oscdimge.exe is not found on the system, winutil will now attempt do download and install it using choco. This might take a long time.")
# the step below needs choco to download oscdimg
$chocoFound = [bool] (Get-Command -ErrorAction Ignore -Type Application choco)
Write-Host "choco on system: $chocoFound"
@ -47,6 +45,7 @@ function Invoke-WPFGetIso {
return
}
else {
[System.Windows.MessageBox]::Show("oscdimge.exe is not found on the system, winutil will now attempt do download and install it from github. This might take a long time.")
Get-Oscdimg -oscdimgPath $oscdimgPath
$oscdImgFound = Test-Path $oscdimgPath -PathType Leaf
if (!$oscdImgFound) {

View File

@ -44,7 +44,7 @@ function Invoke-WPFMicrowin {
if (Test-Path $driverPath)
{
Write-Host "Adding Windows Drivers image($scratchDir) drivers($driverPath) "
dism /image:$scratchDir /add-driver /driver:$driverPath /recurse | Out-Host
dism /English /image:$scratchDir /add-driver /driver:$driverPath /recurse | Out-Host
}
else
{
@ -136,7 +136,7 @@ function Invoke-WPFMicrowin {
Write-Host "Copy link to winutil.ps1 into the ISO"
$desktopDir = "$($scratchDir)\Windows\Users\Default\Desktop"
New-Item -ItemType Directory -Force -Path "$desktopDir"
dism /image:$($scratchDir) /set-profilepath:"$($scratchDir)\Windows\Users\Default"
dism /English /image:$($scratchDir) /set-profilepath:"$($scratchDir)\Windows\Users\Default"
$command = "powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'irm https://christitus.com/win | iex'"
$shortcutPath = "$desktopDir\WinUtil.lnk"
$shell = New-Object -ComObject WScript.Shell
@ -238,7 +238,7 @@ function Invoke-WPFMicrowin {
reg unload HKLM\zSYSTEM
Write-Host "Cleaning up image..."
dism /image:$scratchDir /Cleanup-Image /StartComponentCleanup /ResetBase
dism /English /image:$scratchDir /Cleanup-Image /StartComponentCleanup /ResetBase
Write-Host "Cleanup complete."
Write-Host "Unmounting image..."
@ -270,7 +270,7 @@ function Invoke-WPFMicrowin {
if (Test-Path $driverPath)
{
Write-Host "Adding Windows Drivers image($scratchDir) drivers($driverPath) "
dism /image:$scratchDir /add-driver /driver:$driverPath /recurse | Out-Host
dism /English /image:$scratchDir /add-driver /driver:$driverPath /recurse | Out-Host
}
else
{