From eeb3c580e2ad763c92fbc35e4ed60e53829b9eef Mon Sep 17 00:00:00 2001 From: NTDEV <38796849+ntdevlabs@users.noreply.github.com> Date: Mon, 20 May 2024 21:02:09 +0300 Subject: [PATCH 1/2] Added oscdimg downloader --- tiny11Coremaker.ps1 | 32 +++++++++++++++++++++++++++++--- tiny11maker.ps1 | 30 ++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/tiny11Coremaker.ps1 b/tiny11Coremaker.ps1 index bb72f85..03a01d2 100644 --- a/tiny11Coremaker.ps1 +++ b/tiny11Coremaker.ps1 @@ -727,15 +727,41 @@ Write-Host "Copying unattended file for bypassing MS account on OOBE..." Copy-Item -Path "$PSScriptRoot\autounattend.xml" -Destination "$mainOSDrive\tiny11\autounattend.xml" -Force >null Write-Host "Creating ISO image..." +# Define the path to the ADK Deployment Tools folder $ADKDepTools = "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\$hostarchitecture\Oscdimg" +$localOSCDIMGPath = "$PSScriptRoot\oscdimg.exe" + +# Check if the ADK Deployment Tools folder exists if ([System.IO.Directory]::Exists($ADKDepTools)) { Write-Host "Will be using oscdimg.exe from system ADK." $OSCDIMG = "$ADKDepTools\oscdimg.exe" } else { - Write-Host "Will be using bundled oscdimg.exe." - $OSCDIMG = "$PSScriptRoot\oscdimg.exe" + Write-Host "ADK folder not found. Will be using bundled oscdimg.exe." + + # Define the URL of the file to be downloaded + $url = "https://msdl.microsoft.com/download/symbols/oscdimg.exe/3D44737265000/oscdimg.exe" + + # Download oscdimg.exe if it doesn't exist in the script's directory + if (-not (Test-Path -Path $localOSCDIMGPath)) { + Write-Host "Downloading oscdimg.exe..." + Invoke-WebRequest -Uri $url -OutFile $localOSCDIMGPath + + # Check if the download was successful + if (Test-Path $localOSCDIMGPath) { + Write-Host "oscdimg.exe downloaded successfully." + } else { + Write-Error "Failed to download oscdimg.exe." + exit 1 + } + } else { + Write-Host "oscdimg.exe already exists locally." + } + + $OSCDIMG = $localOSCDIMGPath } -& "$OSCDIMG" '-m' '-o' '-u2' '-udfver102' "-bootdata:2#p0,e,b$mainOSDrive\tiny11\boot\etfsboot.com#pEF,e,b$mainOSDrive\tiny11\efi\microsoft\boot\efisys.bin" "$mainOSDrive\tiny11" "$PSScriptRoot\tiny11.iso" + +# Execute oscdimg.exe with the specified parameters +& "$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 Write-Host "Creation completed! Press any key to exit the script..." diff --git a/tiny11maker.ps1 b/tiny11maker.ps1 index 72d33b5..9b263b4 100644 --- a/tiny11maker.ps1 +++ b/tiny11maker.ps1 @@ -409,14 +409,40 @@ Write-Host "The tiny11 image is now completed. Proceeding with the making of the Write-Host "Copying unattended file for bypassing MS account on OOBE..." Copy-Item -Path "$PSScriptRoot\autounattend.xml" -Destination "$ScratchDisk\tiny11\autounattend.xml" -Force >null Write-Host "Creating ISO image..." +# Define the path to the ADK Deployment Tools folder $ADKDepTools = "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\$hostarchitecture\Oscdimg" +$localOSCDIMGPath = "$PSScriptRoot\oscdimg.exe" + +# Check if the ADK Deployment Tools folder exists if ([System.IO.Directory]::Exists($ADKDepTools)) { Write-Host "Will be using oscdimg.exe from system ADK." $OSCDIMG = "$ADKDepTools\oscdimg.exe" } else { - Write-Host "Will be using bundled oscdimg.exe." - $OSCDIMG = "$PSScriptRoot\oscdimg.exe" + Write-Host "ADK folder not found. Will be using bundled oscdimg.exe." + + # Define the URL of the file to be downloaded + $url = "https://msdl.microsoft.com/download/symbols/oscdimg.exe/3D44737265000/oscdimg.exe" + + # Download oscdimg.exe if it doesn't exist in the script's directory + if (-not (Test-Path -Path $localOSCDIMGPath)) { + Write-Host "Downloading oscdimg.exe..." + Invoke-WebRequest -Uri $url -OutFile $localOSCDIMGPath + + # Check if the download was successful + if (Test-Path $localOSCDIMGPath) { + Write-Host "oscdimg.exe downloaded successfully." + } else { + Write-Error "Failed to download oscdimg.exe." + exit 1 + } + } else { + Write-Host "oscdimg.exe already exists locally." + } + + $OSCDIMG = $localOSCDIMGPath } + +# Execute oscdimg.exe with the specified parameters & "$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 From af2e6159d0eded36cd31bc80b3599238b1f78792 Mon Sep 17 00:00:00 2001 From: NTDEV <38796849+ntdevlabs@users.noreply.github.com> Date: Mon, 20 May 2024 21:04:18 +0300 Subject: [PATCH 2/2] Add files via upload --- tiny11Coremaker.ps1 | 7 +------ tiny11maker.ps1 | 6 ------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/tiny11Coremaker.ps1 b/tiny11Coremaker.ps1 index 03a01d2..4031647 100644 --- a/tiny11Coremaker.ps1 +++ b/tiny11Coremaker.ps1 @@ -727,26 +727,22 @@ Write-Host "Copying unattended file for bypassing MS account on OOBE..." Copy-Item -Path "$PSScriptRoot\autounattend.xml" -Destination "$mainOSDrive\tiny11\autounattend.xml" -Force >null Write-Host "Creating ISO image..." -# Define the path to the ADK Deployment Tools folder $ADKDepTools = "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\$hostarchitecture\Oscdimg" $localOSCDIMGPath = "$PSScriptRoot\oscdimg.exe" -# Check if the ADK Deployment Tools folder exists if ([System.IO.Directory]::Exists($ADKDepTools)) { Write-Host "Will be using oscdimg.exe from system ADK." $OSCDIMG = "$ADKDepTools\oscdimg.exe" } else { Write-Host "ADK folder not found. Will be using bundled oscdimg.exe." - # Define the URL of the file to be downloaded + $url = "https://msdl.microsoft.com/download/symbols/oscdimg.exe/3D44737265000/oscdimg.exe" - # Download oscdimg.exe if it doesn't exist in the script's directory if (-not (Test-Path -Path $localOSCDIMGPath)) { Write-Host "Downloading oscdimg.exe..." Invoke-WebRequest -Uri $url -OutFile $localOSCDIMGPath - # Check if the download was successful if (Test-Path $localOSCDIMGPath) { Write-Host "oscdimg.exe downloaded successfully." } else { @@ -760,7 +756,6 @@ if ([System.IO.Directory]::Exists($ADKDepTools)) { $OSCDIMG = $localOSCDIMGPath } -# Execute oscdimg.exe with the specified parameters & "$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 diff --git a/tiny11maker.ps1 b/tiny11maker.ps1 index 9b263b4..5a159a3 100644 --- a/tiny11maker.ps1 +++ b/tiny11maker.ps1 @@ -409,26 +409,21 @@ Write-Host "The tiny11 image is now completed. Proceeding with the making of the Write-Host "Copying unattended file for bypassing MS account on OOBE..." Copy-Item -Path "$PSScriptRoot\autounattend.xml" -Destination "$ScratchDisk\tiny11\autounattend.xml" -Force >null Write-Host "Creating ISO image..." -# Define the path to the ADK Deployment Tools folder $ADKDepTools = "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\$hostarchitecture\Oscdimg" $localOSCDIMGPath = "$PSScriptRoot\oscdimg.exe" -# Check if the ADK Deployment Tools folder exists if ([System.IO.Directory]::Exists($ADKDepTools)) { Write-Host "Will be using oscdimg.exe from system ADK." $OSCDIMG = "$ADKDepTools\oscdimg.exe" } else { Write-Host "ADK folder not found. Will be using bundled oscdimg.exe." - # Define the URL of the file to be downloaded $url = "https://msdl.microsoft.com/download/symbols/oscdimg.exe/3D44737265000/oscdimg.exe" - # Download oscdimg.exe if it doesn't exist in the script's directory if (-not (Test-Path -Path $localOSCDIMGPath)) { Write-Host "Downloading oscdimg.exe..." Invoke-WebRequest -Uri $url -OutFile $localOSCDIMGPath - # Check if the download was successful if (Test-Path $localOSCDIMGPath) { Write-Host "oscdimg.exe downloaded successfully." } else { @@ -442,7 +437,6 @@ if ([System.IO.Directory]::Exists($ADKDepTools)) { $OSCDIMG = $localOSCDIMGPath } -# Execute oscdimg.exe with the specified parameters & "$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