Is there no built-in solution for creating mutexes? - inno-setup

In Inno Setup, there is the AppMutex directive.
Using this directive, one can make Inno Setup stop / not start while this mutex exists.
I experience it sometimes that my users accidentally open my application while the setup (and update in this case) is still running.
This locks files, and Inno Setup can not replace them.
The solution in my opinion would be that Inno Setup creates a mutex and automatically closes it when it's finished.
When the user starts my app, the app would check if the mutex (which was created by Inno Setup) exists, and if it does, my app would close right away.
However, I do not find this as a built-in option in Inno Setup.
Do I have to code it manually, or am I missing something?
Thank you!

That's what SetupMutex directive does.
Or you can do it programmatically using CreateMutex function.

Related

Inno Setup: Can you add a NOT case to CloseApplicationsFilter?

I have an inno setup installer script that already handles closing one of the applications in use (that runs in the system tray) as part of ssInstall using old V5 ANSI version. With V6 version the restart manager support wants warn that it's open and will close it.
I found the CloseApplicationsFilter value that can be used in [setup] but I want the inverse case, I want to tell it which NOT to include (exclude just one .exe) otherwise handle all the other files as normal.
Is that possible?
Thanks.

Inno Setup: Shutdown service for custom page

I'm building an installer using Inno Setup where I need to convert some existing files if the application is already installed.
To do so I need to stop the applications service which works automatically for the install process. Is there a way to hook a page between the application shutdown and start routine? Or to postpone the application restart to a later time?
EDIT:
I also tried CheckForMutexes('MyAppMutex') to manually prompt the user to close the application, but the function always returns false.
EDIT2:
My current workarround uses the isProcessRunning script by jakoch to prompt the user to manually close the application. I would prefer a more automatic solution though.

Inno Setup:Automatic rollback process

As part of installation, sometimes i see few erors during a file replacement etc, so then inno setup gives a message like "abort/retry/ignore" if the user chooses abort inno setup rollbacks the installation.
So i want to know 2 things here
1)I wanted to know from my installer, whether a roll back is invoked or not? can inno setup give any acknowledgeent for automatic rollback happend or not?
2)what are the steps of rollback, what all does it do in that? a detailed explanation would be very helpful...

Inno Setup: is it a script based deployment program?

I am using Inno Setup for the first time. When I start the program I am presented with a blank script page. Is scripting the only way you can create a setup package? Is there anything else?
Yes, Inno Setup is script-based (thank God -- this really makes things a lot easier if you ask me). But there is a "wizard" that lets you create a new setup by a simple step-by-step approach in a simple GUI. Simply choose "Create a new script file using the Script Wizard" in the "Welcome" dialog box that appears when you start the Inno Setup Compiler.
If you have disabled the Welcome dialog box, use File/New instead to start the wizard.
Update
I was just informed about the new InnoIDE.
Inno Setup is script based. If you want a GUI Builder then you may check the site "Third-Party Files" on Inno Setups Homepage.
The easiest way to start is with one of the example scripts included with the install.
Just change the product name in the sample and you are set for 90% of basic installs

INNO: Disallow "Ignore" when file is in use

I am using Inno Setup for the installer for my windows application. If a user has the application when the installer is run (eg. for an update), the installer will stop when it is unable to replace a file in use, and it allows the user to select whether to Abort, Ignore, or Retry.
I would like it to only allow Abort or Retry and remove the option to Ignore. Does anyone know how this can be done?
Or if this can't be done, how can I make the installer abort if the application is running?
The easy way to detect whether the application is running requires co-operation from the application, so it's best to work this out before you ship your first version. Use Inno Setup's AppMutex setting. There is an example in the Inno Setup knowledge base for setting up a mutex visible in multiple sessions. There is more about AppMutex in Inno Setup's help file.

Resources