Can I disable uninstall confirmation message? - inno-setup

Basically the title says it all, can I skip Are you sure... message box part and run uninstall right away?

That message is not shown only if you run the uninstaller in silent or very silent mode. So only if you run uninstaller with /SILENT or /VERYSILENT command line parameters. If you're going to get rid of that message, you can create shortcuts with one of the mentioned parameters and optionally modify setup's registry key (e.g. My Program_is1) where you can append the parameter to the UninstallString key value. That will uninstall the application without this prompt even from control panel's applet.

Related

How can I tell (programmatically) when an Installshield installer is running silently?

I have a history of Installscript MSI installers (that have been replaced by Basic MSI installers), and when I uninstall them I need to know if the uninstall is being run silently or not. I run some custom code that checks for the existence of .iss files (necessary for silent uninstalls) and if they're not there I pop up a message saying that the files aren't where they're expected to be. The problem is that when the program is uninstalled from the Control Panel (not silently) this code runs and displays the message. So I need a system variable that will tell me it's running in silent mode so when it's not I can suppress the message.
I can't find anything that tells me this. Does anyone know of a way I can tell programmatically?
Assuming you want to detect a silent install from within the install, the answer depends on the project type:
InstallScript projects can check whether they're running silently by comparing the MODE system variable to SILENTMODE
Basic MSIs can compare the UILevel property to 2
InstallScript MSIs can check whichever is more relevant for the context (using MsiGetProperty to retrieve UILevel, if necessary, but watch out in deferred custom actions; they'll need to pass it through CustomActionData).
For completeness, but unlikely to be relevant for your question, Suites can reference the ISSilentInstall property.

How to force using /NORESTART and other flags without using command line

Is it possible to force using some flags like /NORESTART, /NOCLOSEAPPLICATIONS or /VERYSILENT in Inno Setup without using command line?
There's no generic solution to your question that would cover all switches. Implementing a functionality of each switch needs an ad-hoc implementation (and hence requires a separate question).
Actually, you can use .inf file instead of the command-line. But I assume that this not what you ask for.
/VERYSILENT is answered here already:
Run installation using Inno Setup silently without any Next button or Install button.
I'm answering the /NORESTART switch here.
You can hide Yes/No restart radio buttons (and select the No). And update the screen text accordingly.
See Avoid restart prompt in Inno Setup.
Additional handling is needed if you have postinstall entries in the [Run] section.

Change Inno Setup messages from Pascal code

I need to change ConfirmUninstall, UninstalledMost (just in case), and UninstalledAll specifically from script to set a condition. Something like this:
if FileExists(ExpandConstant('{app}\Slash.exe')) then
SetupMessage(msgConfirmUninstall) := FmtMessage(SetupMessage(msgConfirmUninstall), ['Dagon Slasher'])
else if FileExists(ExpandConstant('{app}\Frank.exe')) then
SetupMessage(msgConfirmUninstall) := FmtMessage(SetupMessage(msgConfirmUninstall), ['Dagon Frankenstein'])
else
SetupMessage(msgConfirmUninstall) := FmtMessage(SetupMessage(msgConfirmUninstall), ['Dagon Video Tools']);
But this doesn't work. These messages are used in MsgBoxes, so I can't think of any other way. Running in silent mode is not really suitable for me, since setup will run uninstall if the programs (or one of them) has already been installed, so I don't want the user to accidentally uninstall the program by running the setup.
You cannot change these easily, see:
Replace or customize modal uninstallation windows in Inno Setup
Regarding the silent uninstall solution: I do not understand your problem with "setup will run uninstall if the programs (or one of them) has already been installed".
I assume you run the uninstaller only after the user confirms (s)he wants to install the new version, so you actually want to run the uninstaller silently, right?
And anyway, there's nothing that prevents you from running the uninstaller non-silently from your installer, even if the entry in "Add/Remove programs" refers to "silent" installation.
You can use generic messages that covers all setup types:
[Messages]
ConfirmUninstall=Are you sure you want to completely remove this game?
As your uninstall messages depend on a type of the installed application, you can modify the installer to:
Create custom "type" page (like a menu) as the very first one.
Once the user selects the "type", restart the installer with a custom switch (e.g. /APPTYPE=slasher) and exit.
Once the installer is (re-)run with the /APPTYPE, you know from the beginning, what component/type you are installing and hence you can set the AppName accordingly (using a scripted constant).
Of course, you skip the custom "type" page.
This is actually not difficult to implement. The only drawback is that the setup window is "recreated" after the user selects the "type".
I've sketched this solution already in my answer to Inno Setup Change AppName based on component(s) selected.

Silent Installer with custom selection

Currently my installer is need user to choose which type of setting they want to use when install. Lets say got setting A,B and C.
If want to make this in silent installer. Is there any method can use?
I'm using install shield.
You can set PUBLIC PROPERTIES inside the MSI file from the msiexec.exe command line like this:
msiexec /i test.msi /qn TESTPROPERTY=1
These properties are the ones you have hooked up to values input in the GUI. They are now set by the command line (or defaults are used from the Property table) and the entire GUI section of the MSI gets skipped on install.
Here is a sample showing how INSTALLDIR is hooked up to the GUI (Wise for Windows Installer shown, same concept in Installshield and other MSI tools):
To play around with complex command lines for msiexec.exe I always recommend this nifty tool from Altiris: http://www2.wise.com/filelib/WICLB.exe - broken link, resurrected from Wayback Machine, seeing as the tool was freeware I assume that is legal - (see a screenshot of it here: installation using msi.exec open help options every time). Please run the download by virustotal.com for safety.

How to skip the screen for Name/Organization in Inno Script installer

Inno Setup allows you to see a screen in which you are prompted to input your name and Organization.
How I can make my installer skip this screen?
To skip the Name and Organization input in InnoSetup script do the following:
UserInfoPage=no
Source: http://www.jrsoftware.org/ishelp/index.php?topic=setup_userinfopage
For that page to appear, your setup must have explicitly implemented the CheckSerial event function. If you remove that then the page will also disappear.

Resources