Skip to content

Commit

Permalink
(GH-723) Convert msiexec to full path
Browse files Browse the repository at this point in the history
If msiexec is found, convert to full path.
  • Loading branch information
ferventcoder committed May 9, 2016
1 parent 90522c8 commit 274ac96
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ Elevating Permissions and running [`"$exeToRun`" $wrappedStatements]. This may t
Set-PowerShellExitCode 4
throw "The file was a text file but is attempting to be run as an executable - '$exeToRun'"
}

if ($exeToRun -eq 'msiexec' -or $exeToRun -eq 'msiexec.exe') {
$exeToRun = "$($env:SystemRoot)\System32\msiexec.exe"
}

if (!([System.IO.File]::Exists($exeToRun)) -and $exeToRun -notmatch 'msiexec') {
Set-PowerShellExitCode 2
Expand Down

0 comments on commit 274ac96

Please sign in to comment.