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: