Kirill
Posts: 5
Joined: Thu May 16, 2013 8:25 am

Delete IIS entries during maintenance phase

Hello,
I have some problems with deleting IIS application pools during maintenance phase. Here is simplified configuration of my installation project:
- 2 features: Feature1 and Feature2
- For Feature1 is created Feature1Pool under Application Pools and two virtual directories
- For Feature2 is created Feature2Pool under Application Pools and one virtual directory
- These virtual directories are located under one site
- InstallExecuteSequence AI_IIsInstall is changed to: ((VersionNT >= 500) AND (NOT Installed)) OR (REMOVE<>"ALL")
Graphically it looks like this:
Application Pools
- Feature1Pool (Initial condition: ((&Feature1 = 3) AND NOT (!Feature1 = 3)), Action if duplication: Skip item installation)
- Feature2Pool (Initial condition: ((&Feature2 = 3) AND NOT (!Feature2 = 3)), Action if duplication: Skip item installation)
Sites
- MyWebSite (Initial condition: ((&Feature1 = 3) AND NOT (!Feature1 = 3)) OR ((&Feature2 = 3) AND NOT (!Feature2 = 3)), Action if duplication: Skip item installation)
- Feature1Folder1 (Initial condition: ((&Feature1 = 3) AND NOT (!Feature1 = 3)), Action if duplication: Skip item installation)
- Feature1Folder2 (Initial condition: ((&Feature1 = 3) AND NOT (!Feature1 = 3)), Action if duplication: Skip item installation)
- Feature2Folder (Initial condition: ((&Feature2 = 3) AND NOT (!Feature2 = 3)), Action if duplication: Skip item installation)

Now, after configuration have been described I describe problematic use cases:
1. Install and repair
1.1 Run installator and install 2 features
1.2 Run installator and repair
1.3 Run intallator and uninstall
Expected:
Feature1Pool is deleted, Feature2Pool is deleted, MyWebSite and all its children are deleted
Actual:
All pools exist, MyWebSite exists (children are deleted).

2. Install 1 feature and modify it
2.1 Run installator and install 1 feature (for example Feature1)
2.2 Run installator and modify something in Feature1
2.3 Run installator and uninstall
Expected:
Feature1Pool is deleted, MyWebSite and all its children are deleted
Actual:
Feature1Pool exists, MyWebSite exists (children are deleted)

3. Install 1 feature and modify different feature
3.1 Run installator and install 1 feature (Feature1)
3.2 Run installator and go to modify
3.2.1 Turn off Feature1
3.2.2 Turn on Feature2
Expected:
Feature1Pool is deleted,
Feature2Pool exists,
MyWebSite exists,
MyWebSite\Feature1Folder1 and MyWebSite\Feature1Folder2 are deleted
MyWebSite\Feature2Folder exists
Actual:
All pools and folders exist

4. Install 1 feature and modify different and uninstall
4.1 Run installator and install 1 feature (Feature1)
4.2 Run installator and go to modify
4.2.1 Turn off Feature1
4.2.2 Turn on Feature2
4.3 Run installator and uninstall
Expected:
All pools are deleted, MyWebSite and all its children are deleted
Actual:
All pools exist, MyWebSite exists (children are deleted)

For checking pool existing I use IIS manager.

It's not clear for me how can I configure my installator to achieve expected behaviors, why pools and folders are not deleted during uninstall ? Any ideas?
Thank you.
Kirill
Posts: 5
Joined: Thu May 16, 2013 8:25 am

Re: Delete IIS entries during maintenance phase

This is simple project file which illustrates described problems
Attachments
simple.aip
(24.96 KiB) Downloaded 497 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Delete IIS entries during maintenance phase

Hi and welcome to Advanced Installer forums.

Thank you for your interest in Advanced Installer.
- InstallExecuteSequence AI_IIsInstall is changed to: ((VersionNT >= 500) AND (NOT Installed)) OR (REMOVE<>"ALL")
It seems that the problem is produced by the (REMOVE<>"ALL") condition you added for the "AI_IIsInstall" action. In this case the IIS applications are installed every time the "REMOVE" property value is different than "ALL". I would suggest you to remove that part of the "AI_IIsInstall" condition and everything will work fine (just use the default condition: "(VersionNT >= 500) AND (NOT Installed)").

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Kirill
Posts: 5
Joined: Thu May 16, 2013 8:25 am

Re: Delete IIS entries during maintenance phase

Thank you very much for your responce
Eusebiu wrote: It seems that the problem is produced by the (REMOVE<>"ALL") condition you added for the "AI_IIsInstall" action. In this case the IIS applications are installed every time the "REMOVE" property value is different by "ALL". I would suggest you to remove that part of the "AI_IIsInstall" condition and everything will work fine (just use the default condition: "(VersionNT >= 500) AND (NOT Installed)").
Eusebiu
If I remove that condition, I would not be able to create IIS entries in maintenance phase. For example, this use case will not work.
- Run installator and install Feature1
- Run installator later and install Feature2
- Feature1Pool and Feature2Pool exist and virtual folders Feature1Folder1, Feature1Folder2, Feature2Folder exist under MyWebSite

If I remove added condition, I will end up with IIS infrastructure for Feature1
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Delete IIS entries during maintenance phase

Hi,

Unfortunately, we don't have support for creating IIS entries in Maintenance mode, because of some limitations.

However, we'll consider your suggestion for implementing support for this in the future, but for the moment there are not immediate plans. Thank you for your understanding.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Kirill
Posts: 5
Joined: Thu May 16, 2013 8:25 am

Re: Delete IIS entries during maintenance phase

Eusebiu wrote:Hi,

Unfortunately, we don't have support for creating IIS entries in Maintenance mode, because of some limitations.

However, we'll consider your suggestion for implementing support for this in the future, but for the moment there are not immediate plans. Thank you for your understanding.

Best regards,
Eusebiu
Thanks for responce, I found a way to handle this, I added custom action which launch batch file if user remove feature during "Modify" action. However if I uninstall application this custom action fails with error code:

Action start 17:10:04: RemoveIISServicesExternalFolder.
CustomAction RemoveIISServicesExternalFolder returned actual error code -1 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (C0:FC) [17:10:04:072]: Note: 1: 1722 2: RemoveIISServicesExternalFolder 3: C:\windows\Installer\MSI94C2.tmp 4: /RunAsAdmin "C:\Users\K5B08~1.MAR\AppData\Local\Temp\remove_entry.bat" app MyWebSite/Feature1Folder1
Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action RemoveIISServicesExternalFolder, location: C:\windows\Installer\MSI94C2.tmp, command: /RunAsAdmin "C:\Users\K5B08~1.MAR\AppData\Local\Temp\remove_entry.bat" app SPOC/Spoc.Services.External

My bat file looks like this:
pushd %windir%\system32\inetsrv
appcmd delete %1 %2
popd
exit /b 0

I return zero code from bat file in any cases, so why custom action fails? Does it check some additional information instead of return code of bat file ?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Delete IIS entries during maintenance phase

Hi,

I'm not sure why you encounter this behavior. Can you please check the "deferred" with "no impersonation" options for your custom action and see if the behavior persists? Also, you can uncheck the "Uninstall" checkbox from the "Execution Stage Condition" if your custom action doesn't need to run at uninstall time.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”