Hello Phil and welcome to Advanced Installer forums,
Thank you for your interest in Advanced Installer.
First of all I apologize for my delayed reply.
You can achieve what you want by using a similar approach like the one exposed in our
"Browse for IIS Web Sites & Virtual Directories" and
"Install IIS website specified by the user" articles. However, in order to implement the requested scenario you need to workaround a bit. For your scenario basically you need to get the physical path and web site name of the selected web site in the "IISBrowseComboBox" combo box populated by our "BrowseIIS" custom action. Then, you should store the web site name and physical path of the selected web site in your own custom
installer properties and use these properties to create
property-based folders to which will pinpoint the IIS items (web site, web app and virtual directory) added in
"IIS" page.
Here are a detailed step by step description:
1. go to "Install Parameters" page and enable the "Run as administrator" option
2. add the following properties in the "Properties" section:
MY_VIRTUALDIRECTORY, MY_VIRTUALDIRECTORY_PATH, MY_WEBAPP_NAME, MY_WEBAPP_PATH, MY_WEBSITE_NAME, MY_WEBSITE_PATH, OUTPUT_NAME, OUTPUT_PATH.
3. go to "Files and Folders" page and create three property-based folder using the
MY_VIRTUALDIRECTORY_PATH, MY_WEBAPP_PATH, MY_WEBSITE_PATH properties
4. add your web application files under
MY_WEBAPP_PATH folder
5. go to "Custom Actions" page and add three "Set installer property" predefined custom actions with sequence, scheduled after "Wizard Dialogs Stage -> Searches" actions group, like this:
- Property: MY_VIRTUALDIRECTORY_PATH
Value: [WindowsVolume]
Property: MY_WEBAPP_PATH
Value: [WindowsVolume]
Property: MY_WEBSITE_PATH
Value: [WindowsVolume]
6. go to "Dialogs" page and create a "BrowseIIS" new dialog containing a combo box control with the "IISBrowseComboBox" property associated
7. go to "IIS" page and launch the "Browse Web Sites & Virtual Directories" wizard from the IIS toolbar
8. during the wizard choose the "BrowseIIS" as display dialog, "List only Web Sites on the IIS server", "Show detailed information about each IIS entity listed, ..." and "Output mode -> physical path"
9. go to "Dialogs" page and select the "BrowseIIS" dialog
10. in the "Init Events" tab, under the existing events in the list, add the following events:
- Control Event: Set installer property value
Property: OUTPUT_PATH
Argument: [IISBrowseOutput]
Condition:
Control Event: Set installer property value
Property: IISBrowseOutputMode
Argument: 0
Condition:
Control Event: Execute custom action
Argument: BrowseIIS
Condition: 1 AND 1
Control Event: Set installer property value
Property: OUTPUT_NAME
Argument: [IISBrowseOutput]
Condition:
11. select the [Next >] button and in its "Published Events" tab, under the existing events in the list, add the following events:
- Control Event: Set installer property value
Property: MY_WEBSITE_NAME
Argument: [IISBrowseSelectedValue]
Condition:
Control Event: Set installer property value
Property: IISBrowseOutput
Argument: [OUTPUT_PATH]
Condition:
Control Event: Execute custom action
Argument: IISDecodeBrowseResult
Condition:
Control Event: Set installer property value
Property: MY_WEBSITE_PATH
Argument: [IISBrowseSelectedValue]
Condition
12. after the "BrowseIIS' dialog create a new dialog containing two edit box controls (MY_VIRTUALDIRECTORY and MY_WEBAPP_NAME) where the user can enter the virtual directory path and web application name
13. on the [Next>] button, in its "Published Events" tab add the following events:
- Control Event: Set installer property value
Property: MY_VIRTUALDIRECTORY_PATH
Argument: [MY_WEBSITE_PATH]\[MY_VIRTUALDIRECTORY]
Condition
Control Event: Set installer property value
Property: MY_WEBAPP_PATH
Argument: [MY_VIRTUALDIRECTORY_PATH]\[MY_WEBAPP_NAME]
Condition
14. go to "IIS" page and add the desired web site, web application and virtual directory by using in their "Name" and "Folder" fields the
MY_WEBSITE_NAME, MY_WEBSITE_PATH, MY_WEBAPP_NAME, MY_WEBAPP_PATH and
MY_VIRTUALDIRECTORY_PATH properties
15. build and test the installation project
Also, I've attached a sample created with AI 11.5.1 version which implements a similar scenario.
If you have any further questions just let us know.
All the best,
Daniel
FOLLOW US
Get the latest news in Application Packaging