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!

rn-pro
Posts: 48
Joined: Thu Jun 16, 2011 10:27 am

IIS settings at install time.

Hello,

As our ASP.net application needs to be installed on several different IIS-Servers, we’re looking right now for the Installer application which offers us the best IIS assistance.
Your product seems to offer a lot however I still have some questions regarding the possibilities the user has at install time to customize these settings.

1) IIS Bindings: Is it possible to define a dynamic number of bindings? Some of our customers will need only one binding (localhost:8080) but some others will also need INTERNET_HOST:INTERNET_PORT or/and INTRANET_HOST:INTRANET_POST. I saw how could be configured one binding using [USER_DEFINED_PROPERTIES] and a custom dialog to get the INTERNET_HOST and INTERNET_PORT from the user at install time. But how can I delete/inactivate such a binding in the case one of my users doesn’t need it?
2) Is it possible to set the ApplicationPool Identity at install time based on user input?
3) Is it possible to configure IIS-Log files settings for a new created Website? (I would like to store them in a special folder for example.)
4) Is it possible at install time to let the user provide his/her SSL-Certificate?
5) Does it exists a CustomAction which would help us to set any IIS-Settings which are not yet supported by the User-Interface? (Something like the SET IIS PROPERTY “PROP_NAME” FOR SITE “MY_WEBSITE” from “InstallAware” for example? – btw I like more your product!)
6) If the answer of most of my questions is “... own custom actions ...” could you provide us with some functions/tips/best-practices for the communication with IIS?

Thank you very much.

With best regards,
rn-pro
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: IIS settings at install time.

Hi,

Thank you for your interest in Advanced Installer.
1)....But how can I delete/inactivate such a binding in the case one of my users doesn’t need it?
I'm afraid there is no possibility to set a condition on the bindings. However, a solution would be to create identical websites, but with different bindings settings, and set conditions on the websites
so only one of them can be installed. You would use different public properties for their names, but in the end all the properties would resolve to the same value, so you obtain the
desired name for the website.
2) Is it possible to set the ApplicationPool Identity at install time based on user input?
You can only set this if you capture the username and password using public properties. You can choose in "Identity" tab the corespondent setting
and select the properties.
3) Is it possible to configure IIS-Log files settings for a new created Website? (I would like to store them in a special folder for example.)
I'm afraid this is not possible. You can try using a custom action to accomplish this. The custom action should be scheduled after "InstallIIS" standard action,
so its executed after the website and/or application pool are installed.
4) Is it possible at install time to let the user provide his/her SSL-Certificate?
You can do this by selecting "Install PFX certifcate chosen at run time" from "HTTPS/SSL" tab. For more details press F1 while you are in that tab.
5) Does it exists a CustomAction which would help us to set any IIS-Settings which are not yet supported by the User-Interface? (Something like the SET IIS PROPERTY “PROP_NAME” FOR SITE “MY_WEBSITE” from “InstallAware” for example? – btw I like more your product!)
I'm afraid not. The only custom support we offer is represented by the wizards available in the toolbar, that allow you to include in your setup package the option
to browse for IIS websites, virtual directories and application pools.

Any other custom behavior needs to be implemented by you. You can use Win32 DLLs, VBScript, JavaScript or EXE files as custom actions. Unfortunately we don't have any internal samples to provide, except of course the ones shared by other users on the forums, after which you can look.

If you have any questions please let us know.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rn-pro
Posts: 48
Joined: Thu Jun 16, 2011 10:27 am

Re: IIS settings at install time.

Hi Bogdan,

Regarding your answer to my 2nd question:
You can only set this if you capture the username and password using public properties. You can choose in "Identity" tab the corespondent setting
and select the properties.
Actually I'd only need to let the user choose one of the 4 predefined Identities (LocalSystem, LocalService, NetworkService or ApplicationPoolIdentity).
Do you see any possibility to achieve this?

Thanks,
Razvan
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: IIS settings at install time.

Hi Razvan,

You can try this approach:
- create a custom dialog with a radio button group
- set the group property to IIS_APPPOOL_IDENTITY
- add 4 radio buttons in the group, one for each account
- set each radio button value to the account name (for example "LocalSystem")
- use the IIS_APPPOOL_IDENTITY property for your application pool ("Property based user" option)

During install the property value will set your application pool user account.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dejx
Posts: 10
Joined: Sun Jul 26, 2015 12:51 pm
Contact: Website Skype Twitter

Re: IIS settings at install time.

This approach does not work

It created a broken application pool, the result is app pool with the Identity set as custom account and user NetworkService, which is wrong, it needs to be a Built-in account

here is a screenshot http://i.imgur.com/T3cnc65.png

Can you please propose another approach for handling this, i really don't want a five application pools and five applications for handling this with conditions, this would mean also copying same values into 5 properties (for SiteName, IISAppName, IISPoolName) resulting into managing 15 properties - this would be a maintenance hell :(


this is the result in the applicationHost.config file

Code: Select all

    <add name="Workflow.WebClient Application Pool" autoStart="false" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" startMode="OnDemand">
                <processModel identityType="SpecificUser" userName="ApplicationPoolIdentity" />
                <cpu action="NoAction" />
            </add>
Attachments
pooldemo.aip
Sample
(18.02 KiB) Downloaded 376 times
Last edited by dejx on Thu Aug 27, 2015 8:11 pm, edited 1 time in total.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IIS settings at install time.

Hello,

Indeed, unfortunately this is an Advanced Installer limitation. We have added such an improvement on our TODO list, but since our development team has a lot of work to do on their roadmap, implementing it has a low priority for the moment. Thank you for your understanding.

As a workaround you can try to develop your own custom action which will set the app pool identity settings.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dejx
Posts: 10
Joined: Sun Jul 26, 2015 12:51 pm
Contact: Website Skype Twitter

Re: IIS settings at install time.

Then i have just one question, how come that the forum moderator (Cosmin) gave such misleading answer?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IIS settings at install time.

Unfortunately, there was a miscommunication in our part. We truly apologize for the inconvenience.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dejx
Posts: 10
Joined: Sun Jul 26, 2015 12:51 pm
Contact: Website Skype Twitter

Re: IIS settings at install time.

Hello,

I've considered my options and i have decided to create a CA in which i would fix the IdentityType. I run this CA after all IIS modifications are being installed natively by AdvancedInstaller. I will create and publish nuget package so this CA will be available to everyone.
You can use this by using the "Call Function From Attached Native DLL" and using the Action data e.g.

Code: Select all

IIS_FIXUP_APPPOOL_NAME=[IIS_APPPOOL_NAME];IIS_FIXUP_APPPOOL_ACCOUNT=[IIS_APPPOOL_IDENTITY]

Code: Select all

		
		[CustomAction]
		public static ActionResult CorrectApplicationPoolIdentityCreatedByAdvancedInstaller(Session session)
		{
			const string applicationPoolName = "IIS_FIXUP_APPPOOL_NAME";
			const string applicationPoolAccount = "IIS_FIXUP_APPPOOL_ACCOUNT";

			var appName = session.CustomActionData[applicationPoolName];
			var accountName = session.CustomActionData[applicationPoolAccount];

			session.Log("Attempting to fix Identity for application pool name \"{0}\" to \"{1}\"", appName, accountName);

			ProcessModelIdentityType identityType;
			try
			{
				identityType = (ProcessModelIdentityType)Enum.Parse(typeof(ProcessModelIdentityType), accountName, true);
				if (identityType == ProcessModelIdentityType.SpecificUser)
				{
					return ActionResult.Success;
				}
			}
			catch (ArgumentException)
			{
				session.Log("Parsing ProcessModelIdentityType failed, this means we have selected a SpecificUser " +
				            "which is handled fine by AdvancedInstaller itself.");
				return ActionResult.Success;
			}
			
			var serverManager = new ServerManager();
			var applicationPool = serverManager.ApplicationPools.SingleOrDefault(n => n.Name == appName);

			if (applicationPool == null)
			{
				session.Log("No application pool {0} found", appName);
				return ActionResult.Failure;
			}
			applicationPool.ProcessModel.IdentityType = identityType;
			serverManager.CommitChanges();
			session.Log("Identity set to {0} on application pool {1}", identityType.ToString(), appName);
			return ActionResult.Success;
		}
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IIS settings at install time.

Hello,

Thank you for sharing this on our forums. Certainly it will be very useful for future users facing with the same scenario.

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

Return to “Common Problems”