From b7406939483ffc6e4636c8146ee514265ab57e9f Mon Sep 17 00:00:00 2001 From: kian yamamoto Date: Tue, 19 Dec 2023 17:19:17 -0600 Subject: [PATCH] [Fix]: MicroWin finds but fails to use system oscdimg --- functions/public/Invoke-WPFGetIso.ps1 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/functions/public/Invoke-WPFGetIso.ps1 b/functions/public/Invoke-WPFGetIso.ps1 index b9bfd174..8c819a2e 100644 --- a/functions/public/Invoke-WPFGetIso.ps1 +++ b/functions/public/Invoke-WPFGetIso.ps1 @@ -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) {