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!

mfree
Posts: 2
Joined: Wed Dec 14, 2016 5:45 am

IIS Existing Site Configuration Options

I am building a new installer that has a requirement to modify an existing site within IIS. I am able to successfully load a list of sites that exist in IIS, but I need the ability to modify certain parts of the site without impacting other settings. How would I go about changing the Physical Path for a site, without changing the site name or bindings configuration?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IIS Existing Site Configuration Options

Hello and welcome to our forums,

I'm afraid we do not have built-in IIS support to overwrite only certain settings of an existing web site. However as a workaround you can develop and use your own custom action to check if a web site exists and if so, overwrite the desired settings of the exitsing web site.

For instance, you can write a PowerShell script to check if the web site exists and run several appcmd commands to modify the existing web site settings (e.g. change physical path). Then, you can go to "Custom Actions" page and add a "Run Inline Windows PowerShell Script" custom action with sequence, scheduled as deferred after "Install Execution Stage" -> "Add Resources" action group, which will run your PowerShell script.

Also, for the web site entry you added in "IIS" page you should set the "Error Polocy -> Action if duplicate" option to "Skip item installation".

Let us know if you have any questions or doubts.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mfree
Posts: 2
Joined: Wed Dec 14, 2016 5:45 am

Re: IIS Existing Site Configuration Options

Thanks for the info, I will take a look into that a bit further. As for the IIS site that is created on installation - another question that came up was the option to not remove the site when the application is uninstalled. The reason being is any changes they make to the IIS site will be lost if they uninstall\reinstall for any reason. Is it possible to bypass the removal of the IIS site during the uninstall process or is that a limitation of the IIS portion of the Installer as well?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IIS Existing Site Configuration Options

Hello Michael,

For this you can simply edit the condition of our IIS uninstall custom action so that this action never executes. Just go to "Table Editor" page and select the "InstallExecuteSequnce" table. Here edit the "Condition" field of the "AI_IIsUninstall" action like this:

Code: Select all

1=2
In this case this condition is always FALSE and the uninstall action will never execute.

However, please keep in mind that this option is available only starting with the "Enterprise" edition of Advanced Installer.

Also, you will have to condition each file (added in "Files and Folders" page) of your web site NOT to be removed on uninstall.

If you have any questions just let us know.

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

Return to “Building Installers”