h.k.foysol
Posts: 17
Joined: Thu Oct 13, 2016 10:34 am
Contact: Skype

Deploying web app inside another virtual directory

I looked for hours in the forum to see if someone already provided a solution somewhere. Could not find any. May be I am bad at searching :(

Please have a loot at the attached sample. What I am trying to do is

1. Allow the user to select an existing website
2. Load the list of available Virtual Directory and Web App inside the website in a combobox
3. Allow the user to select a parent virtual directory from combo box
4. Allow the user to provide name for the new virtual directory

Note that parent virtual directory could be located deep in the hierarchy, like WebSite1->VD1->VD2....

Only thing I could not figure out is how to set the parent of a virtual directory. Can anyone help me please.

Much appreciated if you could modify provided file and attach again. I am using most latest version of AI.
Attachments
RND_Sample.zip
(5.37 KiB) Downloaded 273 times
Humayun Kabir Foysol
Team Lead
Enosis Solutions
http://www.enosisbd.com
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Deploying web app inside another virtual directory

Hello,

To achieve what you want you should just create in "IIS" page under your web site two virtual directories like this:
  • [SELECTED_WEB_SITE]
    -->[SELECTED_VD_PARENT]
    -->-->[VD_NAME]

However, please note that when browsing for virtual directories, in the "SELECTED_VD_PARENT" property our browse for virtual directories support will save the virtual directory name in the following format:

Code: Select all

Web Site name/Virtual Directory name
but in "IIS" page in the "Name" field of the "[SELECTED_VD_PARENT]" virtual directory item you should set only the virtual directory name, without the web site name prepanded. So, you can use a small custom action which will trim the web site name and the forward slash from the "SELECTED_VD_PARENT" property value.

Here is the content of a "Run PowerShell inline script" custom action:

Code: Select all

# SELECTED_VD_PARENT contains the website name, we have to remove it
$selectedVDir = AI_GetMsiProperty SELECTED_VD_PARENT
$index = $selectedVDir.IndexOf("/")
$VDirName = $selectedVDir.Substring($index + 1)

# update the property
AI_SetMsiProperty SELECTED_VD_PARENT $VDirName
Also, I've edited and attached your project file so it implements the above changes.

Just let us know if you have any further questions.

All the best,
Daniel
Attachments
RND.aip
(31.24 KiB) Downloaded 327 times
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”