How to support silent install with UI installer - Advanced Installer Community
xjluogang
Posts: 20
Joined: Sun Apr 14, 2013 3:24 pm

How to support silent install with UI installer

Hi guys,
In my case, I have a UI based installer, which contain few dialog and can let user to choose something, input something. I need verify some input in dialog, so that I add few custom action (use VBScript) to do that.
My questions is that, how can I make this installer also support silent install? I want to build only one installer, if user double click it in windows, it will run as UI install process and show dialog to let user step by step to execute the install process. But if user execute this installer in command line (e.g. MySetup.exe /parameters...), then it will run as silent install mode, and auto verify all the parameters. If some parameter is not correct, I will put warning message in command line and stop the install process, otherwise, it will installed automatically without user interactive.
How can I do that? and is there any sample project that I can reference?


Thanks,
Robin
xjluogang
Posts: 20
Joined: Sun Apr 14, 2013 3:24 pm

Re: How to support silent install with UI installer

Can anyone give me idea? Thanks a lot!


Robin
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to support silent install with UI installer

Hello Robin,

In order to achieve this you can run your EXE installation package using the /exenoui command line switch. Also, in order to run its embedded MSI file in silent mode you can set the "MSI Command Line" field, from "Media -> Configuration" tab, using the /qn command line option.

If you want to pass some parameters trough command line to your EXE bootstrapper file, then you can use public installer properties which can be set from command line. For example, you can use a command line like this:

Code: Select all

myPackage.exe /exenoui /qn MY_PROP=value
If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
xjluogang
Posts: 20
Joined: Sun Apr 14, 2013 3:24 pm

Re: How to support silent install with UI installer

Thanks Daniel, it's works.
There cause another problem. I have few custom actions, which will doing some check based on input params. If the condition is not True, I'll warning user and not going to next screen until user correct the input parameter and passed by verify. All of those parameters has get from user input in UI dialog and set as Public Prop. Now I set them from command line for silent install, that's fine. But each custom actions is triggered by UI (E.g. init event of dialog, Published Event of the "next" button click). How can I trigger those actions during the silent install process? and how can I alert user if input parameters are not correct?


Thanks,
Robin
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to support silent install with UI installer

Hello Robin,
How can I trigger those actions during the silent install process?
Please keep in mind that during a silent installation only the "Install Execution Stage" actions are performed. So, in order to run your custom actions during a silent installation you should also add them as custom actions with sequence in "Install Execution Stage".
and how can I alert user if input parameters are not correct?
You should implement this functionality within your custom actions implementation. For example your custom action can display a message box and then return a return value different from 0.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
xjluogang
Posts: 20
Joined: Sun Apr 14, 2013 3:24 pm

Re: How to support silent install with UI installer

Hi Daniel,
Thanks for your reply. That's works.
Btw, How can I detect the install mode in my custom action of the "Install Execution Stage"? E.g. it's running on UI or silent mode. Is there any public property can be used in AI?

Thanks,
Robin
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to support silent install with UI installer

Hello Robin,

For this you can check the UILevel property value.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”