NI Package Manager (NIPM)

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Executes Uninstall for an MSI

Solved!
Go to solution

I've created a package for an MSI installer, but I'd like to include a Custom Execute for removing the MSI. The problem is uninstalling an MSI using msiexec.exe /x requires the original MSI. The original installation places the MSI in the temp folder after which it is deleted. Is there another way to do this?

0 Kudos
Message 1 of 6
(2,953 Views)

A recent thread did mention about a MSI cache that Window's maintains. I would search to see if if your happens to get copied there so you can call it for uninstall.

__________________________________
Bill Eisenhower
Certified LabVIEW & TestStand Developer
0 Kudos
Message 2 of 6
(2,950 Views)
Solution
Accepted by topic author al_g

1) You could install the MSI to a non-temp location, maybe with your application, and call that using "msiexec /x".

2) You could uninstall the OS cached msi, or using the msi productcode. See options (4) and (5) in https://www.advancedinstaller.com/how-to-uninstall-msi-package.html.

 

Your previous post,  Custom Package with Custom Executes for installing an MSI responds with Error -125432, stated that you were installing "Microsoft SQL Local Database". If that is something that other applications could install and depend on, you might not want to forcibly uninstall it if other applications are relying on it. In that case, your package should NOT uninstall the MSI.

Scott Richardson
https://testeract.com
0 Kudos
Message 3 of 6
(2,933 Views)

I used Option 1. I created a custom directory in ProgramData and that worked. I had to run the MSI uninstall in the Custom Executes "Pre Uninstall". Otherwise the MSI is removed first.

0 Kudos
Message 4 of 6
(2,862 Views)

FWIW, a developer shared with me that the most reliable answer to creating wrappers to a third party MSI would be to use NI Package Manager's nipkg.exe CLI utility to create a "WinInst" package. For this case you can just incude the MSI and the appropriate control file to define the package, and you do not need an instructions file. This type of package handles all the rest, such as MSI error cases, tracking the ProductCode for uninstall, handling reboot, not running the MSI if a higher MSI is already on the system, etc. For more information on this you can look at Assembling a WinInst Package in the NI Package Manager help.

 

Note that NI's "package builder" applications, like NI Package Builder, LabVIEW, and TestStand Deployment Utility, do not support building WinInst packages.

 

 

Scott Richardson
https://testeract.com
Message 5 of 6
(2,843 Views)

There is a new attribute that we added support for late last year but it did not get documented. The attribute allows a package to skip uninstalling an MSI when the package is uninstalled. I hope to get this added to our help in an upcoming release.

 

"SkipUninstall" attribute for WinInst Agent <msi> Element
Attribute Name: skipUninstall
Type: Boolean
Required: No
Description
Specifies whether the MSI should not uninstall when its package is uninstalled. The attribute can be one of the following values:
  • n (default)
  • y
Consider using this attribute for a "wrapper" package that installs a third-party MSI to prevent the package from removing the MSI when the MSI can be installed separately without the package.
Examples: <msi name="temp\example.msi" skipUninstall="y"/>
Scott Richardson
https://testeract.com
0 Kudos
Message 6 of 6
(2,819 Views)