choosing an IIS website - Advanced Installer Community

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!

timc
Posts: 20
Joined: Wed Apr 30, 2008 12:43 am

choosing an IIS website

Hi,

Our installer needs to allow a user to select which IIS website to create the virtual directories in. I've set up the browse IIS dialog as shown in the documentation, and have [IISBrowseOutput] set as the property name to use to create the website, but there's a problem. If the user selects Default Web Site, instead of adding the virtual directories there, it creates a new website called [Site #2], including the brackets. (As an aside, I tried using [IISBrowseListBox] as the vdir name, and that created a website called "<none>" ... also not terribly helpful. :))

I'm open to suggestions if there's another way to do this. The virtual directories will go in the default web site about 95% of the time, but on occasion we need the option of installing them elsewhere.

Thanks,
Tim
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: choosing an IIS website

Hi,
I've set up the browse IIS dialog as shown in the documentation, and have [IISBrowseOutput] set as the property name to use to create the website
This is correct, only one thing to add. The virtual directory and the site should use the following condition:

Code: Select all

IISBrowseOutput <> "Default Web Site"
For the case when the user selects the default web site you can try the following solution:
-- in the IIS page from Advanced Installer create a clone of the virtual directory you wish to install under the "Default Web Site"
-- set its condition to:

Code: Select all

IISBrowseOutput = "Default Web Site"
This should make your installer behave this way:
-- if the user selects the "Default Web Site" then the virtual directory under it should be added and the other
web site and virtual directory from the IIS page should not be created(condition is false)
-- if the user chooses another web site it should create the virtual directory under the desired site, not under the "Default Web Site"

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
timc
Posts: 20
Joined: Wed Apr 30, 2008 12:43 am

Re: choosing an IIS website

Hi Bogdan,

There doesn't seem to be any change. I've included a stripped-down version of the project file. Would you take a look?

Thanks,
Tim
Attachments
Centricity-SAMPLE.zip
(6.71 KiB) Downloaded 392 times
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: choosing an IIS website

Hi Tim,

After some more testing and investigating the verbose logs of the installation I've found the problems and also the solution.
Please follow the next steps to modify your package:
-- first of all the property "IISBrowseOutput" contains the entire list of web sites found on the machine
-- the property "IISBrowseListBox" is the one containing the name of the web site selected
-- since this is a private property you cannot use it either as the name for the second site from the IIS page or for the condition
-- what you have to do is to place its value into a public property, this can be done very easily like this:
----- create a new property called IIS_SELECTED in Install Parameters page
----- go to custom actions page and add an UI Custom Action "Property Set with Formatted"
----- set its "Property Name" field to :

Code: Select all

IIS_SELECTED
----- set the "Formatted Text" field to :

Code: Select all

[IISBrowseListBox]
----- now go to Dialogs page, and select the [Next] button from the dialog "ChooseWebsite"
----- add the custom actionas a published event on this button
----- this will make the public property "IIS_SELECTED" to contain the name of the select web site from the list
-- now go to IIS page and replace in all conditions the property "IISBrowseOutput" with the property "IIS_SELECTED"
-- also the name of the second site should be set to :

Code: Select all

[IIS_SELECTED]
This should make the installer do just the desired action, I've tested it on my machine.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
timc
Posts: 20
Joined: Wed Apr 30, 2008 12:43 am

Re: choosing an IIS website

Thank you Bogdan! This put me on the right track.

Return to “Common Problems”