Inno setup to sequentially execute other uninstallers (3rd party apps) - inno-setup

I have search for almost 2 days including going through regular documentation for inno setup. But I have not found a way for Inno setup to sequentially execute other uninstallers (3rd party apps), as items in the [UninstallRun] section. Since the other uninstallers are "cloned" the "waituntilterminated" flag doesn't work on those uninstallers. Has anyone come up with a way to accomplish this?
Thanks,
David

If the other uninstallers are Inno Setup-made, then I do not think you need to do anything special.
Inno Setup-made uninstaller really clones itself and run its clone internally. But it waits for the clone to actually complete the uninstallation before it closes itself. The only thing, that the clone does after the main uninstaller processes closes, is that it deletes the uninstaller executable (and its data files). I do not think you really need to wait for this to done. But if you do, just wait for the uninstaller files to be gone, before you proceed with the other uninstaller.

Related

How to display release notes before installation in Inno Setup?

I want to be able to display the release notes to the end user before the installation has started (e.g. if there are any code changes they should be aware of before upgrading to a newer version).
I've read the documentation regarding the Pascal code BeforeInstall and AfterInstall Parameters, but my problem is how can I make a reference to my release notes file as it is packed inside the setup executable? I realise the simplest answer would be to simply package the installer with a copy of the text file sitting alongside it so it could reference it in this way, but then if the user only copies the executable for example, this would presumably cause a reference error.
What is the best way to go about implementing this?
You are looking for the InfoBeforeFile directive:
[Setup]
InfoBeforeFile=infobefore.txt

How to execute program before the uninstallation starts?

Can InnoSetup execute a program before the uninstallation starts? My program creates some registry values. I have an executable that can remove those registry values and my question is, can InnoSetup run that executable before the uninstallation starts?
See the documentation on Setup Script Sections, particularly the UninstallRun one at the bottom of the tree:
[UninstallRun]
Filename: "{app}\INIT.EXE"; Parameters: "/x"
If you need to do something more complex, you can also do it in code using the Pascal scripting functionality in InnoSetup. See UninstallCodeExample1.iss' in theInnoSetup 5\Examples` folder.

How\where to use SaveStringToFile() in my inno setup file

I'm not that familiar with inno (or pascal scripting), but I am assuming what I want to do is pretty simple.
I want to edit a particular text file at the very beginning of the install. Is there a place in the [Code] section were I could just plug this in so that it does this first and then just continues as usual? I'm not really asking for a code example because I think I could figure that out, but I just wanted to know where to put the code.
The install is done between the CurStepChanged(ssInstall) and CurStepChanged(ssPostInstall) event function calls. ssInstall is the correct point to run code for the beginning of the install.

how to display please wait dialog during EXEC() function

how to display please wait dialog while EXEC() runs another application silently.
You can use a ProgressOutputWizardPage, which works just fine for me, which isn't exactly complicated. You can refer to the CodeDlg.iss example.
Do you really need it to be a message box? As you might know, you can run an external *.exe during setup, and have a custom status message shown meanwhile. (The status message will be on the usual progress label during installation.)
I have a setup.exe that installs product A. This setup.exe contains a setup2.exe file, used to setup product B. setup.exe copies setup2.exe to the Program Files folder during the installation of product A. When all files have been copied, setup.exe then starts setup2.exe in the background. To accomplish this, i have done
[Run]
Filename: "{app}\setup2.exe"; StatusMSG: "Installing Product 2..."; Parameters: "/VERYSILENT /SUPPRESSMSGBOXES"
in setup.iss (that compiles to setup.exe). setup2.exe is also an Inno Setup installer, so the parameters "/VERYSILENT /SUPPRESSMSGBOXES" will make the installation of product 2 silent. During this setup, setup.exe will show the message "Installing Product 2...".
If you really need a message box to popup with the status message, you'll have to resort to Pascal scripting.

NSIS: How to check whether *.dll from my installation is in $SYSDIR?

I wanted to write an NSIS script, let's call it for now setup.nsi, and check
if several required dll files already exists in $SYSDIR
Let me emphasize on the word "several"
What I understand from nsis IfFileExists documentation is that if I type in:
IfFileExists $SYSDIR\blabla.dll +2 +1
then it checks if blabla.dll is in $SYSDIR .. but what if I want to know if *.dll from where setup.nsi copies the file (i.e. the *.dll's that I am interested in installing in.. and they are a lot of them.. so I can't just go around checking for all the names) exists in $SYSDIR
During uninstallation I want to then be able to delete them from $SYSDIR (using some uninstall.log to see if I really copied them in $SYSDIR.. and again the wildcard question).
Please be patient with me as I am really new to NSIS scripts.
Is it REALLY necessary to write and delete in $SYSDIR ? Unless yours is a system file, there's no reason for it to be in $__SYS__DIR. If you need to use a specific version of a library, consider DLL redirection (put your DLL in your app dir and use the .local feature) - see the MSDN article on DLL redirection and Side-by-side assemblies.
Plus, you are one typo away from wrecking the user's computer ("Deleted: C:\Windows\System32\user32.dll").
As Piskvor mentions, I don't think you should be worrying about deleting system DLLs in the uninstaller. In case you want to overwrite system DLLs with an updated version, you may want to look at the SetOverwrite command. It lets you overwrite files if what you've got is newer.
Windows XP (SP2?) and up has file protection for system32, so you can't overwrite system critical files in there.
Do try to stay away from that.
Also, to check for your file specifically, see if there's a plugin for NSIS that can calculate checksums and compare that on uninstall. That's probably the safest, IF you really need to do it.
I'd suggest install files somewhere else and add that to PATH.

Resources