Skip to content

Commit

Permalink
MicroWin Finalized
Browse files Browse the repository at this point in the history
- fix typo
- changed oscdimg from using & to Start-Process
  • Loading branch information
ChrisTitusTech committed Nov 28, 2023
1 parent 7d73f49 commit ab4d132
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions functions/public/Invoke-WPFMicrowin.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function Invoke-WPFMicrowin {
}
else
{
Write-Host "Path to drivers is invaliad continuing without driver injection"
Write-Host "Path to drivers is invalid continuing without driver injection"
}
}

Expand Down Expand Up @@ -298,7 +298,8 @@ function Invoke-WPFMicrowin {
dism /unmount-image /mountdir:$scratchDir /commit

Write-Host "Creating ISO image"
& oscdimg.exe -m -o -u2 -udfver102 -bootdata:2#p0,e,b$mountDir\boot\etfsboot.com#pEF,e,b$mountDir\efi\microsoft\boot\efisys.bin $mountDir $env:temp\microwin.iso
#& oscdimg.exe -m -o -u2 -udfver102 -bootdata:2#p0,e,b$mountDir\boot\etfsboot.com#pEF,e,b$mountDir\efi\microsoft\boot\efisys.bin $mountDir $env:temp\microwin.iso
Start-Process -FilePath "oscdimg.exe" -ArgumentList "-m -o -u2 -udfver102 -bootdata:2#p0,e,b$mountDir\boot\etfsboot.com#pEF,e,b$mountDir\efi\microsoft\boot\efisys.bin $mountDir $env:temp\microwin.iso" -NoNewWindow -Wait

if ($copyToUSB)
{
Expand All @@ -316,6 +317,7 @@ function Invoke-WPFMicrowin {

# Check if the ISO was successfully created - CTT edit
if ($LASTEXITCODE -eq 0) {
Write-Host "Done. ISO image is located here: $env:temp\microwin.iso"
Write-Host "Performing Cleanup"
Remove-Item -Recurse -Force "$($scratchDir)"
Remove-Item -Recurse -Force "$($mountDir)"
Expand All @@ -327,7 +329,7 @@ function Invoke-WPFMicrowin {
$sync.MicrowinOptionsPanel.Visibility = 'Collapsed'

$sync.MicrowinFinalIsoLocation.Text = "$env:temp\microwin.iso"
Write-Host "Done. ISO image is located here: $env:temp\microwin.iso"

$sync.ProcessRunning = $false
}
}
6 changes: 4 additions & 2 deletions winutil.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2748,7 +2748,8 @@ function Invoke-WPFMicrowin {
dism /unmount-image /mountdir:$scratchDir /commit

Write-Host "Creating ISO image"
& oscdimg.exe -m -o -u2 -udfver102 -bootdata:2#p0,e,b$mountDir\boot\etfsboot.com#pEF,e,b$mountDir\efi\microsoft\boot\efisys.bin $mountDir $env:temp\microwin.iso
#& oscdimg.exe -m -o -u2 -udfver102 -bootdata:2#p0,e,b$mountDir\boot\etfsboot.com#pEF,e,b$mountDir\efi\microsoft\boot\efisys.bin $mountDir $env:temp\microwin.iso
Start-Process -FilePath "oscdimg.exe" -ArgumentList "-m -o -u2 -udfver102 -bootdata:2#p0,e,b$mountDir\boot\etfsboot.com#pEF,e,b$mountDir\efi\microsoft\boot\efisys.bin $mountDir $env:temp\microwin.iso" -NoNewWindow -Wait

if ($copyToUSB)
{
Expand All @@ -2766,6 +2767,7 @@ function Invoke-WPFMicrowin {

# Check if the ISO was successfully created - CTT edit
if ($LASTEXITCODE -eq 0) {
Write-Host "Done. ISO image is located here: $env:temp\microwin.iso"
Write-Host "Performing Cleanup"
Remove-Item -Recurse -Force "$($scratchDir)"
Remove-Item -Recurse -Force "$($mountDir)"
Expand All @@ -2777,7 +2779,7 @@ function Invoke-WPFMicrowin {
$sync.MicrowinOptionsPanel.Visibility = 'Collapsed'

$sync.MicrowinFinalIsoLocation.Text = "$env:temp\microwin.iso"
Write-Host "Done. ISO image is located here: $env:temp\microwin.iso"

$sync.ProcessRunning = $false
}
}
Expand Down

0 comments on commit ab4d132

Please sign in to comment.