Let user cancel an installation in progress in NSIS - nsis

Using an NSIS built package, when it gets to the point of writing the files and doing the actual install procedure, the 'Cancel' button is grayed out and can't be used. How can I reactivate this button so users can cancel out of the install during this step?

There is no real support for this, search the nsis forum for workarounds/hacks. You can begin here:
http://forums.winamp.com/forumdisplay.php?forumid=65
Good luck!

Brief explanation given here.
http://nsis.sourceforge.net/InstFiles_Cancel_-_Allowing_a_user_to_cancel_installation_during_InstFiles

Related

Inno Setup Exit Setup page shows buttons in system language, not in setup language [duplicate]

I am using unicode Inno Setup (5.4.2u), and none of the Yes/No buttons in the dialog boxes are translating. Has anyone found a way around this?
Thank you
Dave
According to the docs, this is not a problem with InnoSetup but is a function of Windows itself:
http://www.jrsoftware.org/iskb.php?translatebuttons
From the page: The button captions are in the same language as Windows itself. So if the user is running an English edition of Windows, they will see English button captions.

Bring Inno Setup installer to the foreground

How to bring the installer to the foreground at every progress page? (Assuming that the person installing the program decides to do other things with the computer in the meantime).
I am using this code to install DirectX and redist:
Inno Setup - Avoid displaying filenames of sub-installers
(look only the part that includes this ProgressPage := CreateOutputProgressPage).
Do not even try this. That ruins user experience.
And Windows actually prevents you from doing that anyway.
If you need to bring user attention to your installer/application, flash its taskbar button.

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.

Choose a folder dialog for nsis

I have a problem with the skin that I am using for my nsis installer.
Is there a way to control to not apply skin to choose a folder dialog.
I am using Skincrafter plugin to apply this skin.
Generally if I load it after initializaiton, it applies to all pages/inner dialogs and child dialogs. I do not want Browse for a folder dialog to have a skin.
Can someone please provide any suggestions?
There is no way how to fix this from NSIS.
Asks the authors to add this feature for you or (if the sources are available) modify the it by yourself to fit your needs.
There are also some other skinning systems for NSIS - e.g. mine Graphical Installer (sorry for this little promo :) so you can try to use them.

Cancelling an InnoSetup installer

Situation
During the installation of our product I detect if our programs are still running (from a previous installation) by using CheckForMutexes. If our programs are still running I pop up a message box (by using MsgBox) that tells the user to close the programs. If the user clicks the ok and they haven't closed our programs, the same message box is displayed. I'd like to display a cancel button in the MsgBox that aborts the installation, which would be desired in the case the user doesn't want to close the running programs.
Question
How can I abort an InnoSetup install programmatically?
Thanks in advance
Take a look at InitializeSetup and Abort in the Inno Setup help. The Abort function will allow the setup to exit.
Call the WizardForm.Close() method.
It will prompt the user if she really wants to cancel the installation.
procedure ExitSetup;
begin
WizardForm.Close;
end;

Resources