garyj
Posts: 2
Joined: Tue Apr 21, 2009 8:05 pm

How to "launch program" after passive install

I have created a setup.exe with Advanced Installer which, at the beginning of the installation process asks the user to accept a License Agreement and, at the end of the installation process, asks the user if they want to launch the main program after the setup is complete. This all works great when the installer runs in interactive mode.

In some circumstances I would like the installation to run in one of the non-interactive modes, such as passive, etc. After installation I would like to have the main program launch.

What do I have to do to my setup project to have the main program launch automatically after installation is complete when the installer is run in a non-interactive (passive, etc) mode?

Please note I am already able to do this in 'normal' installer mode, I am asking about while in 'passive' (or some other non-interactive) mode. I also already know how to run the installer in passive mode; my question is about how to auto-launch the program after passive mode.

I don't even mind if the user is prompted to launch at the end of the install, as long as the launch can happen somehow.
cyb
Posts: 43
Joined: Wed Apr 15, 2009 1:06 pm

Re: How to "launch program" after passive install

Hi Gary,

You can use a custom action under the InstallFinalize standard action. This way, your application will be launched when the installation completes even in passive mode. Note that you will have to set a condition for the custom action to run only if the installation is passive:

Code: Select all

UILevel <> "5"
You can find more help in this Custom actions article.

Best regards,
cyb
Cosmin Budrica
Advanced Installer Team
http://www.advancedinstaller.com/
garyj
Posts: 2
Joined: Tue Apr 21, 2009 8:05 pm

Re: How to "launch program" after passive install

thank you for the reply. I have added the custom action and it works only in passive mode with the condition you provided.

I am curious about this reference I found in the online documentation:
If the installation will run on Windows Vista the custom action should be moved under
"InstallExecuteSequence" -> "PublishProduct". Also, it should be set as "Deferred with no
impersonation".
The custom action I added to InstallFinalize seems to work fine under Vista. To test, I moved the custom action to PublishProduct and it seems to work under XP but I do not want to break anything. Should I use PublishProduct for both XP and Vista or can I just use InstallFinalize for both or do I have to create more complicated logic to determine OS version ?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: How to "launch program" after passive install

Hi,

Please note that this refers to custom actions which need Administrator privileges. If your custom action doesn't need these privileges, it doesn't have to run as "Deferred with no impersonation".

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”