Replace or customize modal uninstallation windows in Inno Setup - installation

Is it possible to replace next uninstalling modal windows with custom modal windows or pages in Inno Setup:

Both messages are shown always, except for silent (or very silent) uninstallations.
What you can do:
Change message texts:
[Messages]
ConfirmUninstall=Are you sure you want to completely remove %1 and all of its components?
UninstalledAll=%1 was successfully removed from your computer.
UninstalledMost=%1 uninstall complete.%n%nSome elements could not be removed. These can be removed manually.
UninstalledAndNeedsRestart=To complete the uninstallation of %1, your computer must be restarted.%n%nWould you like to restart now?
Get rid of the messages by making the uninstaller run silently always by adding the /SILENT command-line switch to the UninstallString registry key. See also Can I disable uninstall confirmation message?
Though this is bit of a hack, and you better do it only, if you have a good reason.
And optionally implementing your custom messages/dialogs by implementing InitializeUninstall and CurUninstallStepChanged(usDone), like:
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
DoneForm: TSetupForm;
begin
if CurUninstallStep = usDone then
begin
DoneForm := CreateCustomForm;
{ populate the form here... }
DoneForm.ShowModal;
end;
end;
Another way to get rid of the message, when the uninstallation completes, is to handle usPostUninstall event and display your custom dialog box there. And forcefully abort the installer afterwards. But then the automatic restart of Windows, in case it's needed to complete the uninstallation, won't work.
You can also implement some DLL that watches for new message boxes and updates/submits them as they appear.

If you want to create custom pages in Uninstaller then No.
Uninstaller does NOT support creating custom pages.

Related

Wix : Disable control in built-in dialog

I am using WiX and want to know if we can disable a control in a built-in dialog. My requirement is to disable the "Browse" button in the "CustomizeDlg".
This became too long for a comment. I might "evolve" it as an answer if we get more information about your scenario. Just a couple of heads-ups for you.
If you are trying to prevent the setup from being installed to a non-standard path, then you should account for the fact that the installation directory can be set at the msiexec.exe command line when the setup is installed in silent mode. Sample (untested by me - first thing I found :-) ).
I suppose a custom action could be used to abort the setup if it is installed in silent mode to a non-standard path? An immediate mode custom action before InstallInitialize somewhere I guess, but after costing actions (CostInitialize, CostFinalize, FileCost, InstallValidate, etc...) - but frankly, why do this? Perhaps you could illuminate your use-case?
Oh, and please don't leave the standard action RemoveExistingProducts to run before your custom action (in the InstallExecuteSequence). This would remove the existing, related installation on the box (if any) and then abort the major upgrade operation leaving no install left on the box.
And don't add your custom action to the user interface sequence - there is no need. This sequence is entirely skipped in silent installation mode, and if there is no way to set a custom path in the GUI, it can't be changed there anyway (and the InstallExecuteSequence's custom action would catch any changes should they be set anyway - it will do).
Per this thread which discusses how to enable the button, what you need to do is the reverse: ensure your Feature elements do not specify a ConfigurableDirectory, or that it is not public by using some lowercase letters in the identifier.

Check if application is not running

I am developing a WiX installer (I am very new to this) and want to implement a method (like launch condition) which check if a particular application is running or not. If it's running then a warning message will popup displaying close the application message. I want this check before the welcome screen.
How can I implement this? Some working example will really help me a lot.
Windows Installer already has a FilesInUse and RMFilesInUse (Restart Manager) support. Does this not meet your needs? With these patterns you'll get a dialog telling the user that they need to exit a program or risk needing a reboot.
This can be done only through a custom action. Here is a tutorial for a C++ DLL native custom action: http://www.codeproject.com/Articles/1747/MSI-Custom-Action-DLL
Your custom action can perform the check and then show a message to the user if necessary. It
can return 0 to continue the installation or 1602 to stop.
To show the message before Welcome dialog, you can try scheduling your custom action right after CostFinalize action in InstallUISequence.

How to close running instance of application on repair in installshield in Basic MSI Project?

I want to close running instance of my application on repair option of my setup....
This can be done through a custom action. There is no predefined support for it, so you will need to write your own custom code. A good approach is sending WM_CLOSE to the main application window and let it close itself.
To run this custom action only during repair, you can try conditioning it with REINSTALL property.
If you want to avoid the Files In Use dialog, you will need to run this custom action before InstallValidate action. In this case you cannot use REINSTALL property, but you can use this condition:
Installed
It evaluates to true when your package is running in maintenance mode (modify, repair or remove).

How to update the InnoSetup Wizard GUI status text from PascalScript code

I execute a lot of custom actions in my InnoSetup script in the CurStepChanged(ssPostInstall) PascalScripting event handler. As these actions take some time to finish, I'd like to update the InnoSetup Wizard GUI status text and tell the user what is going on behind the scenes. Something similar that is possible in the [Run] section using the "StatusMsg" parameter. I know that I could use the TOutputProgressWizardPage/CreateOutputProgressPage(), and I did in a previous project, but it's a bit too much overkill to my liking...
Is there a simpler possibility to update the InnoSetup Wizard GUI status text from PascalScripting code with the same effect as the StatusMsg parameter?
Use this from your CurStepChanged handler:
WizardForm.StatusLabel.Caption := 'status update';

Install Shield 2009 Premier, Uninstall doesn't close the process/gui

My application (developed using C#.net) is open now i uninstall, InstallShield gives message stating the application is already open and whether really want to close the application. Selection 'Ignore' continues uninstall. Some files and the exe of the application are not closed. How to close them by installshield on uninstall. Or there are some properties I have to set. I know adding a custom action at uninstall i can kill the process, but shouldn't installshield do it?
If your goal is to restart the open applications and not honor the "Ignore" selection, you might consider setting the "REBOOT" property to "Force". That will ask that user to restart the system, thus achieving your desired result.
If your project type is InstallScript MSI or it supports Installscript, i prefer to write code for this for example:
export prototype _Server_UnInstalling();
function _Server_UnInstalling()
STRING Application, ServiceName;
begin
//application name
Application = "Demo";
MessageBox("In _Server_UnInstalling",INFORMATION);
//Check whether application is running or not.
if ProcessRunning( Application ) then
MessageBox("Demo is running",INFORMATION);
//Close server Application
ProcessEnd(Application);
endif;
//if application is having service at the background then
ServiceName = "Demo Server";
//Uninstall the server windows services on uninstallation.
ServiceRemoveDuringUninstallation(ServiceName);
end;
The above example give the skeleton, you need to implement the logic for ProcessRunning, ProcessEnd and ServiceRemoveDuringUninstallation methods, you can refer Installshield help doc they have given documentation with along with source code
hope this helps...

Resources