Activeplan
Posts: 9
Joined: Mon Apr 11, 2011 3:26 pm

IIS config during upgrades

I have built an installer which includes the setting up of an IIS website + application pool.
This is working well - the website is installed correctly during install and is uninstalled correctly during uninstall.
The problem is that during upgrade installs (for new versions) any customisation of the IIS settings (application pool identity, bindings and so on) are reset to the original values I have set in my installer. I know this is because the website is uninstalled then reinstalled during the upgrade.
So I added an option that gives the user the option (or not) to install/reset IIS config. This works- IIS config is only deployed with the option set. But for upgrades, if the option is not selected I just want the existing config to be left as it is. But now during upgrades it just uninstalls it leaving nothing in IIS.
I use a property to decide if IIS should be configured and this works correctly. I know what I am missing is controlling the uninstall process - I need to prevent the removal of my website in IIS based on a property and/or whether I'm doing an upgrade or not.
I just need some pointers on the best approach to this. I've hunted round the manual & forum but have not found what I want so any tips would be very welcomed.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IIS config during upgrades

Hello,

Indeed to achieve what you need you will have to stop the web site removal during the uninstall process (as part of the upgrade installation) of the old product version. To achieve this you will have to condition the execution of our IIS uninstall custom action. The IIS uninstall action should be edited in the old product version of your setup project not to be executed during an upgrade (i.e. using the "UPGRADINGPRODUCTCODE" property).

Here are the steps to proceed with:
1. open in Advanced Installer the old product version of your setup project
2. go to "Table Editor" page, select the "InstallExecuteSequence" table and edit the "Condition" field of the "AI_IIsUninstall" action like this:

Code: Select all

(VersionNT >= 500) AND (REMOVE = "ALL") AND (NOT UPGRADINGPRODUCTCODE)
3. rebuild your project and test again the upgrade scenario

Please note that our "Table Editor" feature is available only starting with an "Enterprise" project type.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Carlostwin
Posts: 5
Joined: Tue Feb 28, 2017 3:17 pm

Re: IIS config during upgrades

This is driving me crazy. We have an installer that installs a website, creates a sql database and some files. All works fine.

We added the ability to upgrade, mostly works fine.~

Two problems on upgrade:-

- The original install folder is removed, losing it's original permissions or any changes.
- The app pool and websites are removed and re-installed (losing and changes made by the user).

I've tried setting InstallExecuteSequence > AI_IIsUninstall to:-

- (VersionNT >= 500) AND (REMOVE = "ALL") AND (NOT UPGRADINGPRODUCTCODE)
- (VersionNT >= 500) AND (REMOVE = "ALL") and (NOT UPGRADINGPRODUCTCODE) and (NOT OLDPRODUCTS)
- 1=2

Nothing I do stops the website, app pool and folder being removed.

I'm using V14.7.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IIS config during upgrades

Hello,

Please note that to stop the web site removal you should make the related change in the setup project of your old product version. If you already deployed your old setup product, then you can try to create a patch which will include the related condition change and deliver it to your target machines where the old product is installed. Then you should test the upgrade scenario.

In what regards the folder removal, to avoid this behavior during upgrade you should proceed like this:
1. open your the setup project of your current product version
2. go to "Files and Folders" page and right click on your folder; choose "Properties" context menu option
3. go to "Operations" tab and check the "Do not overwrite existing files" option and use the following condition:

Code: Select all

OLDPRODUCTS
4. rebuild the project and test the upgrade scenario

Let us know if you have any further questions or doubts.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: IIS config during upgrades

Hello,

This improvement has been added in version 16.5 of Advanced Installer, released on November 13th, 2019.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”