Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msi packages fail install with "Could not find 'msiexec'" #723

Closed
jaredreynolds opened this issue May 5, 2016 · 8 comments
Closed

msi packages fail install with "Could not find 'msiexec'" #723

jaredreynolds opened this issue May 5, 2016 · 8 comments

Comments

@jaredreynolds
Copy link

What You Are Seeing?

When installing an msi-based package, choco fails with "ERROR: Could not find 'msiexec'".

What is Expected?

The package installs (like it used to).

How Did You Get This To Happen? (Steps to Reproduce)

choco upgrade tortoisesvn -y (probably would fail with install as well--see comments below)

Output Log

GIST LINK

Comments

Commit cfa8e2f introduced a check in Start-ChocolateyProcessAsAdmin.ps1 to make sure the executable exists. But Install-ChocolateyInstallPackage.ps1 does not pass the full path to msiexec so the Exists check fails.

I was able to get around this with a temporary change to Install-ChocolateyInstallPackage.ps1 (below). I'm not sure this is how you want to approach the fix.

    $env:ChocolateyExitCode = Start-ChocolateyProcessAsAdmin "$msiArgs" "$env:SystemRoot\system32\msiexec.exe" -validExitCodes $validExitCodes
@ferventcoder
Copy link
Member

Duplicate of #699

@ferventcoder
Copy link
Member

Not a duplicate! I will work on this now.

@ferventcoder
Copy link
Member

ferventcoder commented May 5, 2016

Adding security to this as well - fully qualifying the PATH to msiexec.

@ferventcoder
Copy link
Member

ferventcoder commented May 5, 2016

Related to needing #722

ferventcoder added a commit that referenced this issue May 6, 2016
In commit cfa8e2f, we introduced  introduced a check in
`Start-ChocolateyProcessAsAdmin`  that determines if an executable
exists. Unfortunately this function doesn't try to verify if the item
exists at a location on the PATH, thus breaking calls from
`Install-ChocolateyInstallPackage` and `Uninstall-ChocolateyPackage`
that call this function with simply 'msiexec'.

We should fully qualify msiexec as a security measure, but we should
also not fail on missing if msiexec is the executable we are trying
to run.
ferventcoder added a commit that referenced this issue May 6, 2016
* stable:
  (doc) update CHANGELOG/nuspec
  (GH-724) Set Env Vars to empty should remove vars
  (doc) Update CHANGELOG/nuspec
  (GH-588) Manage extensions installed w/old method
  (GH-723) Fully qualify MsiExec
  (maint) use systemroot over windir
  (maint) spelling
@ferventcoder
Copy link
Member

@da9l
Copy link

da9l commented May 9, 2016

@ferventcoder I get similar error code but for wusa.exe when upgrading powershell 4.0 to 5.0 on a windows 7 machine.
chocolatey upgrade powershell

Downloading PowerShell.5.0 64 bit from 'https://download.microsoft.com/download/2/C/6/2C6E1B4A-EBE5-48A6-B225-2D2058A9CEFB/Win7AndW2K8R2-KB3134760-x64.m su' Using system proxy server 'seproxy.hm.com:8080'. Progress: 100% - Saving 20.77 MB of 20.77 MB (21779572/21779572) Download of Win7AndW2K8R2-KB3134760-x64.msu (20.77 MB) completed. Installing PowerShell.5.0... ERROR: Could not find 'wusa.exe' The upgrade of powershell was NOT successful. Error while running 'C:\ProgramData\chocolatey\lib\PowerShell\tools\ChocolateyInstall.ps1'. See log for details.

Could it be related?
https://github.com/chocolatey/choco/search?utf8=%E2%9C%93&q=wusa.exe

@ferventcoder
Copy link
Member

It is related. Expect a fix soon.

@ferventcoder
Copy link
Member

I'm going to also shut off the failure on unfound files until we can implement search paths.

ferventcoder added a commit that referenced this issue May 9, 2016
When calling Start-ChocolateyProcessAsAdmin, wusa.exe should also use a
full path so that it doesn't error on Start-ChocolateyProcessAsAdmin.
ferventcoder added a commit that referenced this issue May 9, 2016
If msiexec is found, convert to full path.
ferventcoder added a commit that referenced this issue May 9, 2016
Instead of errorring when not able to find a file, choco should instead
pass a warning. Once we have search paths enabled like we do in c#, we
can revisit this.
ferventcoder added a commit that referenced this issue May 9, 2016
* stable:
  (doc) update CHANGELOG/nuspec
  (GH-728) Fix: Env var changes may require reboot
  (GH-729) Update env after setting env vars for scripts
  (GH-723) Warn when can't find file
  (GH-723) Convert msiexec to full path
  (GH-723) Ensure wusa.exe uses a full path
  (GH-727) Fix: Name is bad if response has params
TheBigBear pushed a commit to TheBigBear/choco that referenced this issue May 14, 2016
When calling Start-ChocolateyProcessAsAdmin, wusa.exe should also use a
full path so that it doesn't error on Start-ChocolateyProcessAsAdmin.
TheBigBear pushed a commit to TheBigBear/choco that referenced this issue May 14, 2016
If msiexec is found, convert to full path.
TheBigBear pushed a commit to TheBigBear/choco that referenced this issue May 14, 2016
Instead of errorring when not able to find a file, choco should instead
pass a warning. Once we have search paths enabled like we do in c#, we
can revisit this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants