I currently have an application out in the field that was distributed as a .msi installer (Built with Wix). I've just finished porting this application over to Electron to take advantage of all of the latest and greatest features including using Electron Builder and Auto Updates.
Any wix/msi gurus know the best way I could uninstall the old msi and run the new installer? The solutions I have found involve searching through the Windows Registry to find the msi UUID then using msiexec.
Is it possible to just create a new version of the .msi that cleans up everything?
If I understand correctly you want to migrate from MSI to NSIS format?
There is an article on this here:
https://nsis.sourceforge.io/Uninstalling_a_previous_MSI.
I would suggest, however, that you find the product code for the MSI and invoke msiexec.exe with the product code and your own uninstall string (not the one gotten from the registry as shown in the above documentation). This way you can add a few constructs to prevent spontaneous reboot and to enforce proper silent running. This approach is described below.
Uninstall MSI: You can uninstall the previous MSI version by running an uninstall command in any number of ways: Uninstalling an MSI file from the command line without using msiexec.
Find Product Code: You can find the product GUID of the MSI as follows: How can I find the product GUID of an installed MSI setup?
Command Line: Combining approach 3.5 from first link above and the product code found using the information in the second link, you can use a command line like this to invoke from your NSIS installer:
msiexec.exe /x {11111111-1111-1111-1111-11111111111X} /QN /L*V "C:\msilog.log" REBOOT=ReallySuppress
Quick Parameter Explanation:
/X = run uninstall sequence
{11111111-1111-1111-1111-11111111111X} = product guid of app to uninstall
/QN = run completely silently
/L*V "C:\msilog.log"= verbose logging at path specified
REBOOT=ReallySuppress = prevent unexpected reboot of computer
ExecWait: NSIS requires its own peculiar command format: Running MSIEXEC in a NSIS script with installer switches. Haven't tested this yet, but a suggestion:
StrCpy $R0 "{11111111-1111-1111-1111-11111111111X}"; the MSI's ProductID of my package
ExecWait '"msiexec.exe" /x $R0 /QN REBOOT=ReallySuppress'
Check here for fine-tuning the command line: https://nsis.sourceforge.io/Uninstalling_a_previous_MSI.
Links:
https://nsis.sourceforge.io/Uninstalling_a_previous_MSI
https://nsis.sourceforge.io/Auto-uninstall_old_before_installing_new
How do I require user to uninstall previous version with NSIS
https://nsis.sourceforge.io/Removing_MSI_packages_with_MSI_related_functions
Related
I am new to VSTO office addin, I have created VSTO project in VS 2019 for outlook addin.I have created installer in Visual studio 2019 using setup project for VSTO project outlook aadin.now I want to disable the GUI of MSI installation.
How to disable the complete UI of MSI installation?
There is no option to disable the whole UI in MSI by default. Instead, you may use a command line switch which allows running installers silently (without any UI interactions).
The proper way to install an MSI silently is via the msiexec.exe command line (the executable program that interprets packages and installs products):
msiexec.exe /i c:\setup.msi /QN /L*V "C:\Temp\msilog.log"
Where the parameters stand for:
/L*V "C:\Temp\msilog.log" - verbose logging
/QN - run completely silently
/i - run install sequence
You can read more about possible command line parameters on the Command-Line Options page.
I have an msi project created using installshield. This works good when installed using GUI window. But when I am going through silent installation, I am getting an error with a CustomAction that I have created, which will simply generate a log file. Since it is working correctly during GUI installation I feel pretty sure, the CustomAction is not an issue.
Command I have used for silent installation
msiexec /i "Setup.msi" /qn /l*v C:\msilog.txt
Is there something that I must do to suppress the next buttons in the GUI mode during silent installation?
I am trying to find information about running the exe installer at OpenLDAP for Windows. The forum has little info and the installation documentation only describes the UI based install.
It seems like the exe is wrapping 2 msi files: The main installation msi and the kerberos msi.
To get them I used 7zip to extract the OpenLDAPforWindows_x64.exe installer. I then copied and renamed the folloinwg following files:
OpenLDAPforWindows_x64\.rsrc\BIN\229 -> OpenLDAPforWindows_2.4.42_x64.msi
OpenLDAPforWindows_x64\.rsrc\BIN\231 -> kfw-4.0.1-amd64.msi
I can then call each of them separately from the command line.
For example to call the kerberos installer with logging (allows to get the properties that can get passed to the installer when running it silently, eg: KERBEROSDIR):
msiexec /i kfw-4.0.1-amd64.msi /log kerberos_inst.log
To call the OpenLDAP installer silently while setting a custom install directory:
msiexec /i OpenLDAPforWindows_2.4.42_x64.msi /qn /log openldapd_inst.log INSTALLLOCATION="F:\CustomOpenLdap\"
How can a silent installer be created in WiX that does not display any UI dialogs to the user and installs, upgrades and uninstalls with default settings?
Windows Installer (MSI) uses the following command line arguments to be silent:
Silent install or silent major upgrade:
msiexec.exe /i foo.msi /qn
Silent minor upgrade:
msiexec.exe /i foo.msi REINSTALL=ALL REINSTALLMODE=vomus /qn
Silent uninstall:
msiexec.exe /x foo.msi /qn
Executable path:
C:\Windows\system32\msiexec.exe
Installer .exe's created with WiX can be run from the command line without requiring user input by using one of these command line parameters:
/quiet - Displays no UI whatsoever
/passive - Displays a UI but requires no user input. Essentially just displays an install progress bar
This answer is based on WiX 3.9.
All MSI installers whether created by WiX or not can be controlled via command line arguments. So you can make an installer with UI and still install it silently, there is no need to remove the UI from the installer just suppress it on the command line. Remember, make sure you add the upgrade element in your first installer so subsequent ones will match
Just don't include any UI/UIRef elements and then no UI will be included :)
I've seen a confusing behavior regarding the MSI files generated by a VDPROJ file. If I build my MSI in Visual Studio and then right-click and pick "Install" from within Visual Studio, it will automagically uninstall any version that is already installed and then install the new MSI.
However, if take the generated MSI and run it directly it will complain if a previous version is already installed. I have to uninstall it explicitly (in Add/Remove Programs) first.
What's the deal? Is there a command-line argument that Visual Studio executes the MSI with?
Yes Visual Stuido will be passing the REINSTALLMODE and the REINSTALL properties to the windows installer when it runs your install
something like:
msiexec /i your.msi REINSTALLMODE=vomus REINSTALL=ALL
Check the MSDN documents linked above to see what these options are doing
Edit:
Now I come to think of it. Studio may also just be uninstalling your application first by using the /x command line arg
msiexec /x <package> or <product code>
Maybe someone else can confirm which is being used?