Skip to content

Commit 77c74f5

Browse files
authored
Merge pull request #140 from bwRavencl/english-dism
Fixes #136 - add `/English` to `dism` invocations
2 parents b277eb1 + 98014c0 commit 77c74f5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

tiny11maker.ps1

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ Write-Host "Copy complete!"
4545
Start-Sleep -Seconds 2
4646
Clear-Host
4747
Write-Host "Getting image information:"
48-
& 'dism' "/Get-WimInfo" "/wimfile:$mainOSDrive\tiny11\sources\install.wim"
48+
& 'dism' '/English' "/Get-WimInfo" "/wimfile:$mainOSDrive\tiny11\sources\install.wim"
4949
$index = Read-Host "Please enter the image index"
5050
Write-Host "Mounting Windows image. This may take a while."
5151
$wimFilePath = "$($env:SystemDrive)\tiny11\sources\install.wim"
5252
& takeown "/F" $wimFilePath
5353
& icacls $wimFilePath "/grant" "Administrators:(F)"
5454
Set-ItemProperty -Path $wimFilePath -Name IsReadOnly -Value $false
5555
New-Item -ItemType Directory -Force -Path "$mainOSDrive\scratchdir"
56-
& dism "/mount-image" "/imagefile:$($env:SystemDrive)\tiny11\sources\install.wim" "/index:$index" "/mountdir:$($env:SystemDrive)\scratchdir"
56+
& dism /English "/mount-image" "/imagefile:$($env:SystemDrive)\tiny11\sources\install.wim" "/index:$index" "/mountdir:$($env:SystemDrive)\scratchdir"
5757

58-
$imageIntl = & dism /Get-Intl "/Image:$($env:SystemDrive)\scratchdir"
58+
$imageIntl = & dism /English /Get-Intl "/Image:$($env:SystemDrive)\scratchdir"
5959
$languageLine = $imageIntl -split '\n' | Where-Object { $_ -match 'Default system UI language : ([a-zA-Z]{2}-[a-zA-Z]{2})' }
6060

6161
if ($languageLine) {
@@ -65,7 +65,7 @@ if ($languageLine) {
6565
Write-Host "Default system UI language code not found."
6666
}
6767

68-
$imageInfo = & 'dism' '/Get-WimInfo' "/wimFile:$($env:SystemDrive)\tiny11\sources\install.wim" "/index:$index"
68+
$imageInfo = & 'dism' '/English' '/Get-WimInfo' "/wimFile:$($env:SystemDrive)\tiny11\sources\install.wim" "/index:$index"
6969
$lines = $imageInfo -split '\r?\n'
7070

7171
foreach ($line in $lines) {
@@ -87,7 +87,7 @@ if (-not $architecture) {
8787

8888
Write-Host "Mounting complete! Performing removal of applications..."
8989

90-
$packages = & 'dism' "/image:$($env:SystemDrive)\scratchdir" '/Get-ProvisionedAppxPackages' |
90+
$packages = & 'dism' '/English' "/image:$($env:SystemDrive)\scratchdir" '/Get-ProvisionedAppxPackages' |
9191
ForEach-Object {
9292
if ($_ -match 'PackageName : (.*)') {
9393
$matches[1]
@@ -100,7 +100,7 @@ $packagesToRemove = $packages | Where-Object {
100100
$packagePrefixes -contains ($packagePrefixes | Where-Object { $packageName -like "$_*" })
101101
}
102102
foreach ($package in $packagesToRemove) {
103-
& 'dism' "/image:$($env:SystemDrive)\scratchdir" '/Remove-ProvisionedAppxPackage' "/PackageName:$package"
103+
& 'dism' '/English' "/image:$($env:SystemDrive)\scratchdir" '/Remove-ProvisionedAppxPackage' "/PackageName:$package"
104104
}
105105

106106

@@ -208,12 +208,12 @@ reg unload HKLM\zSCHEMA
208208
reg unload HKLM\zSOFTWARE
209209
reg unload HKLM\zSYSTEM
210210
Write-Host "Cleaning up image..."
211-
& 'dism' "/image:$mainOSDrive\scratchdir" '/Cleanup-Image' '/StartComponentCleanup' '/ResetBase'
211+
& 'dism' '/English' "/image:$mainOSDrive\scratchdir" '/Cleanup-Image' '/StartComponentCleanup' '/ResetBase'
212212
Write-Host "Cleanup complete."
213213
Write-Host "Unmounting image..."
214-
& 'dism' '/unmount-image' "/mountdir:$mainOSDrive\scratchdir" '/commit'
214+
& 'dism' '/English' '/unmount-image' "/mountdir:$mainOSDrive\scratchdir" '/commit'
215215
Write-Host "Exporting image..."
216-
& 'Dism' '/Export-Image' "/SourceImageFile:$mainOSDrive\tiny11\sources\install.wim" "/SourceIndex:$index" "/DestinationImageFile:$mainOSDrive\tiny11\sources\install2.wim" '/compress:max'
216+
& 'dism' '/English' '/Export-Image' "/SourceImageFile:$mainOSDrive\tiny11\sources\install.wim" "/SourceIndex:$index" "/DestinationImageFile:$mainOSDrive\tiny11\sources\install2.wim" '/compress:max'
217217
Remove-Item -Path "$mainOSDrive\tiny11\sources\install.wim" -Force
218218
Rename-Item -Path "$mainOSDrive\tiny11\sources\install2.wim" -NewName "install.wim"
219219
Write-Host "Windows image completed. Continuing with boot.wim."
@@ -224,7 +224,7 @@ $wimFilePath = "$($env:SystemDrive)\tiny11\sources\boot.wim"
224224
& takeown "/F" $wimFilePath
225225
& icacls $wimFilePath "/grant" "Administrators:(F)"
226226
Set-ItemProperty -Path $wimFilePath -Name IsReadOnly -Value $false
227-
& 'dism' '/mount-image' "/imagefile:$mainOSDrive\tiny11\sources\boot.wim" '/index:2' "/mountdir:$mainOSDrive\scratchdir"
227+
& 'dism' '/English' '/mount-image' "/imagefile:$mainOSDrive\tiny11\sources\boot.wim" '/index:2' "/mountdir:$mainOSDrive\scratchdir"
228228
Write-Host "Loading registry..."
229229
reg load HKLM\zCOMPONENTS $mainOSDrive\scratchdir\Windows\System32\config\COMPONENTS
230230
reg load HKLM\zDEFAULT $mainOSDrive\scratchdir\Windows\System32\config\default
@@ -252,7 +252,7 @@ reg unload HKLM\zSCHEMA
252252
reg unload HKLM\zSOFTWARE
253253
reg unload HKLM\zSYSTEM
254254
Write-Host "Unmounting image..."
255-
& 'dism' '/unmount-image' "/mountdir:$mainOSDrive\scratchdir" '/commit'
255+
& 'dism' '/English' '/unmount-image' "/mountdir:$mainOSDrive\scratchdir" '/commit'
256256
Clear-Host
257257
Write-Host "The tiny11 image is now completed. Proceeding with the making of the ISO..."
258258
Write-Host "Copying unattended file for bypassing MS account on OOBE..."

0 commit comments

Comments
 (0)