We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

mschindler
Posts: 8
Joined: Wed Sep 24, 2014 9:11 am

Host Name (Website Binding) as parameter

I'd like to define the "Host Name" (IIS -> Sites -> Bindings) as "Install Parameter". Problem here is, that "empty" parameters in Advanced Installer are not allowed. But I need to leave this field empty, if no host name is specified (see "(not specified)" in image below).
HostName.PNG
HostName.PNG (18.81 KiB) Viewed 6272 times
Is there a workaround?
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Host Name (Website Binding) as parameter

Hello,

You can define the property in the Install Parameters page, and then reset its value (use {} for a null value) in the Custom Actions page using the predefined Set installer property custom action(make sure you add the custom action as a custom action with sequence).

The custom actions properties, can be something like that:
  • Property field: MY_PROP
  • Value field: {}
Please let me know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mschindler
Posts: 8
Joined: Wed Sep 24, 2014 9:11 am

Re: Host Name (Website Binding) as parameter

It's not nice, but it works. Thanks.
mschindler
Posts: 8
Joined: Wed Sep 24, 2014 9:11 am

Re: Host Name (Website Binding) as parameter

I ran into another problem:
If I place the custom action after Wizard Dialog State "Path resolution", this works fine in GUI mode, but not in silent mode (msiexec ... /qn) from command line.
If I place the custom action later, the value from the GUI dialog or from command line parameter gets overridden.

Is there a general solution for GUI and unattended setups?
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Host Name (Website Binding) as parameter

Hello,

When you run a package in silent mode it only executes the actions found in the "Install Execution Stage" and the custom actions found in "Wizard Dialog Stage" are not executed.

However, you can go in the Custom Actions page, press the SHIFT keyboard button, drag and drop your custom actions (duplicate) in the "Install Execution Stage", click on the "Advanced execution scenarios" link and check the "Skip action in Install Execution Stage if executed in Dialogs Stage" radio button.

In this case your custom actions will be executed in the "Install Execution Stage" only if they were not executed in the "Wizard Dialogs Stage".

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mschindler
Posts: 8
Joined: Wed Sep 24, 2014 9:11 am

Re: Host Name (Website Binding) as parameter

But the second custom action overrides the value from the command line parameters.

Code: Select all

msiexec.exe /i "C:\Example.msi" SERVICEHOSTNAME="myValue" /qn
In my case, the SERVICEHOSTNAME will be "" instead of "myValue".
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Host Name (Website Binding) as parameter

Hello,

In order to overcome this, you can condition the execution of the custom action which set the property with the null value.

e.g. Add in the condition field

Code: Select all

SERVICEHOSTNAME="DefaultValue"
where DefaultValue is the property's value defined in the InstallParameters page.

This way, the custom action will only be executed when the property has the default value.

Please let me know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mschindler
Posts: 8
Joined: Wed Sep 24, 2014 9:11 am

Re: Host Name (Website Binding) as parameter

That's my current solution, but it's not really "clean".

Why doesn't Advanced Installer allow empty values for parameters? This workaround with two custom actions, a condition, ... etc. means a lot of work for the developer. And our company's software team has lots of web installers to deploy.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Host Name (Website Binding) as parameter

Hello,

Please note that is not mandatory to define the property in the Install Parameters page.
You can use a property inside the Website Binding information without defining it before using. If the property is not set when you launch your installation package, it will be resolved at a null value, and this way you don't have to use the custom action to reset its value.

If you want to set its value, then you can use the usual command line and the property will be set accordingly.

Please let me know if this is working as expected.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mschindler
Posts: 8
Joined: Wed Sep 24, 2014 9:11 am

Re: Host Name (Website Binding) as parameter

Thanks! That's a much better solution.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Host Name (Website Binding) as parameter

You're welcome,

If there is anything else I can help you with, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”