Merge 1ac2444518 into 233b6b0fc4
This commit is contained in:
commit
57f56a3c0b
5 changed files with 29 additions and 20 deletions
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
tiny11.log
|
||||||
|
.vs
|
||||||
|
.vscode
|
||||||
|
*.iso
|
||||||
|
|
@ -24,11 +24,10 @@ This script generates a significantly reduced Windows 11 image. However, it's no
|
||||||
Instructions:
|
Instructions:
|
||||||
|
|
||||||
1. Download Windows 11 from the Microsoft website (<https://www.microsoft.com/software-download/windows11>)
|
1. Download Windows 11 from the Microsoft website (<https://www.microsoft.com/software-download/windows11>)
|
||||||
2. Mount the downloaded ISO image using Windows Explorer.
|
2. Enter the path where the image is located
|
||||||
3. Select the drive letter where the image is mounted (only the letter, no colon (:))
|
3. Select the SKU that you want the image to be based.
|
||||||
4. Select the SKU that you want the image to be based.
|
4. Sit back and relax :)
|
||||||
5. Sit back and relax :)
|
5. When the image is completed, you will see it in the folder where the script was extracted, with the name tiny11.iso
|
||||||
6. When the image is completed, you will see it in the folder where the script was extracted, with the name tiny11.iso
|
|
||||||
|
|
||||||
What is removed:
|
What is removed:
|
||||||
|
|
||||||
|
|
|
||||||
BIN
oscdimg.exe
Normal file
BIN
oscdimg.exe
Normal file
Binary file not shown.
|
|
@ -43,17 +43,17 @@ Clear-Host
|
||||||
$mainOSDrive = $env:SystemDrive
|
$mainOSDrive = $env:SystemDrive
|
||||||
$hostArchitecture = $Env:PROCESSOR_ARCHITECTURE
|
$hostArchitecture = $Env:PROCESSOR_ARCHITECTURE
|
||||||
New-Item -ItemType Directory -Force -Path "$mainOSDrive\tiny11\sources" >null
|
New-Item -ItemType Directory -Force -Path "$mainOSDrive\tiny11\sources" >null
|
||||||
$DriveLetter = Read-Host "Please enter the drive letter for the Windows 11 image"
|
$ImagePath = Read-Host "Paste the image path (without quotes) here"
|
||||||
$DriveLetter = $DriveLetter + ":"
|
$DriveLetter = Mount-DiskImage -ImagePath "$ImagePath" | Get-Volume | Select-Object -ExpandProperty DriveLetter
|
||||||
|
|
||||||
if ((Test-Path "$DriveLetter\sources\boot.wim") -eq $false -or (Test-Path "$DriveLetter\sources\install.wim") -eq $false) {
|
if ((Test-Path "${DriveLetter}:\sources\boot.wim") -eq $false -or (Test-Path "${DriveLetter}:\sources\install.wim") -eq $false) {
|
||||||
if ((Test-Path "$DriveLetter\sources\install.esd") -eq $true) {
|
if ((Test-Path "${DriveLetter}:\sources\install.esd") -eq $true) {
|
||||||
Write-Host "Found install.esd, converting to install.wim..."
|
Write-Host "Found install.esd, converting to install.wim..."
|
||||||
& 'dism' '/English' "/Get-WimInfo" "/wimfile:$DriveLetter\sources\install.esd"
|
& 'dism' '/English' "/Get-WimInfo" "/wimfile:${DriveLetter}:\sources\install.esd"
|
||||||
$index = Read-Host "Please enter the image index"
|
$index = Read-Host "Please enter the image index"
|
||||||
Write-Host ' '
|
Write-Host ' '
|
||||||
Write-Host 'Converting install.esd to install.wim. This may take a while...'
|
Write-Host 'Converting install.esd to install.wim. This may take a while...'
|
||||||
& 'DISM' /Export-Image /SourceImageFile:"$DriveLetter\sources\install.esd" /SourceIndex:$index /DestinationImageFile:"$mainOSDrive\tiny11\sources\install.wim" /Compress:max /CheckIntegrity
|
& 'DISM' /Export-Image /SourceImageFile:"${DriveLetter}:\sources\install.esd" /SourceIndex:$index /DestinationImageFile:"$mainOSDrive\tiny11\sources\install.wim" /Compress:max /CheckIntegrity
|
||||||
} else {
|
} else {
|
||||||
Write-Host "Can't find Windows OS Installation files in the specified Drive Letter.."
|
Write-Host "Can't find Windows OS Installation files in the specified Drive Letter.."
|
||||||
Write-Host "Please enter the correct DVD Drive Letter.."
|
Write-Host "Please enter the correct DVD Drive Letter.."
|
||||||
|
|
@ -62,7 +62,7 @@ if ((Test-Path "$DriveLetter\sources\boot.wim") -eq $false -or (Test-Path "$Driv
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "Copying Windows image..."
|
Write-Host "Copying Windows image..."
|
||||||
Copy-Item -Path "$DriveLetter\*" -Destination "$mainOSDrive\tiny11" -Recurse -Force > null
|
Copy-Item -Path "${DriveLetter}:\*" -Destination "$mainOSDrive\tiny11" -Recurse -Force > null
|
||||||
Set-ItemProperty -Path "$mainOSDrive\tiny11\sources\install.esd" -Name IsReadOnly -Value $false > $null 2>&1
|
Set-ItemProperty -Path "$mainOSDrive\tiny11\sources\install.esd" -Name IsReadOnly -Value $false > $null 2>&1
|
||||||
Remove-Item "$mainOSDrive\tiny11\sources\install.esd" > $null 2>&1
|
Remove-Item "$mainOSDrive\tiny11\sources\install.esd" > $null 2>&1
|
||||||
Write-Host "Copy complete!"
|
Write-Host "Copy complete!"
|
||||||
|
|
|
||||||
|
|
@ -43,17 +43,22 @@ Write-Host "Welcome to the tiny11 image creator! Release: 05-06-24"
|
||||||
|
|
||||||
$hostArchitecture = $Env:PROCESSOR_ARCHITECTURE
|
$hostArchitecture = $Env:PROCESSOR_ARCHITECTURE
|
||||||
New-Item -ItemType Directory -Force -Path "$ScratchDisk\tiny11\sources" >null
|
New-Item -ItemType Directory -Force -Path "$ScratchDisk\tiny11\sources" >null
|
||||||
$DriveLetter = Read-Host "Please enter the drive letter for the Windows 11 image"
|
$ImagePath = Read-Host "Paste the image path (without quotes) here"
|
||||||
$DriveLetter = $DriveLetter + ":"
|
$DriveLetter = Mount-DiskImage -ImagePath "$ImagePath" | Get-Volume | Select-Object -ExpandProperty DriveLetter
|
||||||
|
|
||||||
if ((Test-Path "$DriveLetter\sources\boot.wim") -eq $false -or (Test-Path "$DriveLetter\sources\install.wim") -eq $false) {
|
if (-not $DriveLetter) {
|
||||||
if ((Test-Path "$DriveLetter\sources\install.esd") -eq $true) {
|
Write-Host "Path not specified or wrong."
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((Test-Path "${DriveLetter}:\sources\boot.wim") -eq $false -or (Test-Path "${DriveLetter}:\sources\install.wim") -eq $false) {
|
||||||
|
if ((Test-Path "${DriveLetter}:\sources\install.esd") -eq $true) {
|
||||||
Write-Host "Found install.esd, converting to install.wim..."
|
Write-Host "Found install.esd, converting to install.wim..."
|
||||||
& 'dism' '/English' "/Get-WimInfo" "/wimfile:$DriveLetter\sources\install.esd"
|
& 'dism' '/English' "/Get-WimInfo" "/wimfile:${DriveLetter}:\sources\install.esd"
|
||||||
$index = Read-Host "Please enter the image index"
|
$index = Read-Host "Please enter the image index"
|
||||||
Write-Host ' '
|
Write-Host ' '
|
||||||
Write-Host 'Converting install.esd to install.wim. This may take a while...'
|
Write-Host 'Converting install.esd to install.wim. This may take a while...'
|
||||||
& 'DISM' /Export-Image /SourceImageFile:"$DriveLetter\sources\install.esd" /SourceIndex:$index /DestinationImageFile:"$ScratchDisk\tiny11\sources\install.wim" /Compress:max /CheckIntegrity
|
& 'DISM' /Export-Image /SourceImageFile:"${DriveLetter}:\sources\install.esd" /SourceIndex:$index /DestinationImageFile:"$ScratchDisk\tiny11\sources\install.wim" /Compress:max /CheckIntegrity
|
||||||
} else {
|
} else {
|
||||||
Write-Host "Can't find Windows OS Installation files in the specified Drive Letter.."
|
Write-Host "Can't find Windows OS Installation files in the specified Drive Letter.."
|
||||||
Write-Host "Please enter the correct DVD Drive Letter.."
|
Write-Host "Please enter the correct DVD Drive Letter.."
|
||||||
|
|
@ -62,7 +67,7 @@ if ((Test-Path "$DriveLetter\sources\boot.wim") -eq $false -or (Test-Path "$Driv
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "Copying Windows image..."
|
Write-Host "Copying Windows image..."
|
||||||
Copy-Item -Path "$DriveLetter\*" -Destination "$ScratchDisk\tiny11" -Recurse -Force > null
|
Copy-Item -Path "${DriveLetter}:\*" -Destination "$ScratchDisk\tiny11" -Recurse -Force > null
|
||||||
Set-ItemProperty -Path "$ScratchDisk\tiny11\sources\install.esd" -Name IsReadOnly -Value $false > $null 2>&1
|
Set-ItemProperty -Path "$ScratchDisk\tiny11\sources\install.esd" -Name IsReadOnly -Value $false > $null 2>&1
|
||||||
Remove-Item "$ScratchDisk\tiny11\sources\install.esd" > $null 2>&1
|
Remove-Item "$ScratchDisk\tiny11\sources\install.esd" > $null 2>&1
|
||||||
Write-Host "Copy complete!"
|
Write-Host "Copy complete!"
|
||||||
|
|
@ -442,7 +447,8 @@ if ([System.IO.Directory]::Exists($ADKDepTools)) {
|
||||||
& "$OSCDIMG" '-m' '-o' '-u2' '-udfver102' "-bootdata:2#p0,e,b$ScratchDisk\tiny11\boot\etfsboot.com#pEF,e,b$ScratchDisk\tiny11\efi\microsoft\boot\efisys.bin" "$ScratchDisk\tiny11" "$PSScriptRoot\tiny11.iso"
|
& "$OSCDIMG" '-m' '-o' '-u2' '-udfver102' "-bootdata:2#p0,e,b$ScratchDisk\tiny11\boot\etfsboot.com#pEF,e,b$ScratchDisk\tiny11\efi\microsoft\boot\efisys.bin" "$ScratchDisk\tiny11" "$PSScriptRoot\tiny11.iso"
|
||||||
|
|
||||||
# Finishing up
|
# Finishing up
|
||||||
Write-Host "Creation completed! Press any key to exit the script..."
|
Write-Host "Creation completed! Unmounting image..."
|
||||||
|
Dismount-DiskImage -ImagePath "$ImagePath"
|
||||||
Read-Host "Press Enter to continue"
|
Read-Host "Press Enter to continue"
|
||||||
Write-Host "Performing Cleanup..."
|
Write-Host "Performing Cleanup..."
|
||||||
Remove-Item -Path "$ScratchDisk\tiny11" -Recurse -Force >null
|
Remove-Item -Path "$ScratchDisk\tiny11" -Recurse -Force >null
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue