fredrik
fredrik

Reputation: 10281

How to make choco install application so it shows in "Programs and Features"?

I'm installing this .msi using chocolatey which will install the Microsoft Visual C++ Compiler Package for Python 2.7, as I'm updating the vcpython27 nupkg.

When I run this command manually in a CMD.exe window, the installation shows up in "Programs and Features", as expected:

msiexec /i VCForPython27.msi /qn /norestart /l*v install.log

However, when run through choco install <packagename>, nothing shows up in "Programs and Features".

When looking at the silentArgs in chocolateyinstall.ps1, the silentArgs are set to:

/qn /norestart /l*v `"$env:TEMP\chocolatey\$($packageName)\$($packageName).MsiInstall.log`"

When searching regedit for "Microsoft Visual C++ Compiler Package for Python 2.7" after a regular msiexec installation from a CMD.exe prompt, I find the following keys:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Installer\Products\8A4152964845CF540BEAEBD27F7A8519
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\UFH\SHC
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-21-650255990-4017621559-2147617900-1000\Products\8A4152964845CF540BEAEBD27F7A8519\InstallProperties
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{692514A8-5484-45FC-B0AE-BE2DF7A75891}
HKEY_USERS\S-1-5-21-650255990-4017621559-2147617900-1000\SOFTWARE\Microsoft\Installer\Products\8A4152964845CF540BEAEBD27F7A8519
HKEY_USERS\S-1-5-21-650255990-4017621559-2147617900-1000\SOFTWARE\Microsoft\Windows\CurrentVersion\UFH\SHC

If I uninstall and then install via choco instead, I only find the following keys:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\UFH\SHC
HKEY_USERS\S-1-5-21-650255990-4017621559-2147617900-1000\SOFTWARE\Microsoft\Windows\CurrentVersion\UFH\SHC

I tried appending ALLUSERS=1 to the silentArgs, but that doesn't do any difference.

This can all be tested right now, using the currently published version of vcpython27, which exhibits the same issue:

choco install vcpython27 -y

I'm on Windows 10 Pro 64-bit.

How can I choco install and make this application show under "Programs and Features"?

Upvotes: 1

Views: 1359

Answers (1)

fredrik
fredrik

Reputation: 10281

Changing the following:

Install-ChocolateyPackage $packageName $fileType $silentArgs $url -validExitCodes $validExitCodes -checksum $checksum -checksumType $checksumType

...into:

Install-ChocolateyPackage @packageArgs

...made it show up in "Programs and Features" and it can now be uninstalled from there as well as via choco uninstall vcpython27.

I believe all of this was a result of me including $fileType as an argument, while this variable had never been defined. So, you would assume the installation should fail, but it didn't. So a bug report was also filed.

Upvotes: 1

Related Questions