Skip to content

Commit

Permalink
(chocolateyGH-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 authored and TheBigBear committed May 14, 2016
1 parent e1f526d commit f24949b
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 f24949b

Please sign in to comment.