davidhomer
Posts: 38
Joined: Fri Oct 23, 2009 2:39 pm

Upgrading IIS Application Pool Issue

Hello,

You recently helped me with an issue with the upgrading of installers with Windows Services in an Upgrade First then uninstall scenario
The solution is to

1. Prompt the user for the service account DomainName, UserName and Password in a Dialog
2. Install the Service using the DomainName, Username and Password
3. Persist the DomainName and Username in the registry (not the password).
4. On upgrading pre-populate the DomainName and Username properties from the registry
5. Hide the credentials Dialog from the user
6. The Service is stopped, as the Username and Domain are the same the service remains as is
**THE BLANK PASSWORD IS NOT SET OVER THE TOP OF THE EXISTING PASSWORD**
7. The new Service .exe file is copied in and the Service is started again as the new version

Perfect, however the same is not true in an IIS Application Pool

Again this is an Upgrade First then uninstall scenario

1. Prompt the user for the Application pool DomainName, UserName and Password in a Dialog
2. Install the Application Pool using the DomainName, Username and Password
3. Persist the DomainName and Username in the registry (not the password).
4. On upgrading pre-populate the DomainName and Username properties from the registry (not the password)
5. Hide the credentials Dialog from the user
6. The Application pool credentials are re-set
**THE BLANK PASSWORD IS SET OVER THE TOP OF THE EXISTING PASSWORD**
7. The application pool fails to start because of the blank password

I also tried to set the Install condition to "NOT UPGRADEPRODUCTS" however all that happens is that the installer runs through, decides to not reinstall the IIS (great) however then just uninstalls Application pool as part of the "Uninstall after" installation.

What I would like to know is - is there a way to fix this?

I would just like for a blank password in the IIS Application Pool section to mean "do not change password" rather than "set to a blank password".
Perhaps there is a way that I could set the property [APPPOOLPASSWORD] = "DONOTCHANGE" to prevent a change?

I don't want to persist the password (encrypted or otherwise)


Thanks,


Dave
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Upgrading IIS Application Pool Issue

Hi Dave,

We are not officially supporting this behavior yet. The only proper way to achieve this is using a first install then uninstall behavior.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
davidhomer
Posts: 38
Joined: Fri Oct 23, 2009 2:39 pm

Re: Upgrading IIS Application Pool Issue

Hello,

This is a first install then uninstall.

I think the only way to have IIS application pools with custom credentials with Advanced Installer is

1. Write a custom action to actually create and uninstall the application pool or

2. Write a custom action to get the current application pool password and set it to a PROPERTY (means not using a .NET custom action as it can't set Windows Installer properties) or

3. Prompt the user for the password on every upgrade or

4. Store the password in the registry in encypted format (not ideal).

Do you think there will be a better way to handle this in the future? like I said setting the password to "[DONOTCHANAGE]" or something like this?

Thanks,


Dave
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Upgrading IIS Application Pool Issue

Hello,

We may come up with a better way to handle this. Thank you for your suggestion. We will take your suggestions into consideration when improving support for this feature.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
davidhomer
Posts: 38
Joined: Fri Oct 23, 2009 2:39 pm

Re: Upgrading IIS Application Pool Issue

Hi Gabriel,

I just came up with a workaround I thought I'd share...
You have a custom VBScript Action with 2 functions - one for IIS6 and one for IIS 7+ this runs on the first form init...

if OLDPRODUCTS <> "" AND (VersionNT < 600) it rus GetPasswordADSI and
if OLDPRODUCTS <> "" AND (VersionNT >= 600) it rus GetPasswordWMI

The password is obtained from IIS (which nicely provides it in plain text if you are an administrator) and sticks it into the password windows installer property (which I called VIRDIR_PASSWORD) -
when the user clicks next the password field is already populated on the next form.


-------------------------- IISPassword.vbs --------------------------

Public Function GetPasswordADSI

msgbox "Start..."

Set objAppPools = GetObject("IIS://localhost/W3SVC/AppPools")
for each objAppPool in objAppPools
If objAppPool.Name=Session.Property("VDIRNAME") Then
Session.Property("VIRDIR_PASSWORD")=objAppPool.WAMUserPass
End if
next

End Function


Public Function GetPasswordWMI

msgbox "Start..."

Set oIIS = GetObject("winmgmts:root\WebAdministration")
Set oAppDefn = oIIS.Get("ApplicationPool.Name='" + Session.Property("VDIRNAME") + "'")
Session.Property("VIRDIR_PASSWORD")=oAppDefn.ProcessModel.Password

End Function



Thanks,


Dave

Return to “Common Problems”