lothan
Level 2

Install IIS Web Site and Application in alternate path

I am currently attempting to install a web application into a user-specified web site and am having difficulty trying to figure out how to make it work correctly. I initially took the easy path by creating a new Web Site with the following properties:

Name: {ID_STRING7} MyName
IP Address: *
TCP Port Number: 8000
Site Number: 0
Component: WebsiteComponent
Content Source Path: {IISROOTFOLDER} [IISROOTFOLDER]

I also added a Web Application as a child of the above Web Site with these properties:

Name: {ID_STRING8} MyName
Component: WebsiteComponent
ContentSourcePath: {PATHKEY} [IISROOTFOLDER]MyFolder
Application Pool: {ID_STRING6} MyPool

I tested this installation package to confirm that it installs the web application to the default web site in the C:\inetpub\wwwroot folder. However, our clients want to be able to specify which web site (and ultimately which folder) we install into. To achieve this goal I initially created a new dialog containing a combo box with the Property set to MY_SITE_NUMBER.

I also created a Custom Action with property name set to MY_SITE_NUMBER to enumerate the web sites and to populate the combo box. Finally, I web into the Web Site properties (the first one above) and changed the Site Number property from 0 to MY_SITE_NUMBER. I then tested the installation package on a server that has two web sites (default in C:\inetpub\wwwroot and Test in D:\wwwsites). When I select Test in the combo box, InstallShield installs a folder under the Test website as expected, but the Web Application is still being installed under the default web site with the files in C:\inetpub\wwwwroot\MyFolder.

What I can't figure out is how to get InstallShield 2012 Spring - Professional Edition to install the Web Application to the same path.

One of the things I tried was to create a new property (under Additional Tools, DirectEditor, Directory) named MYWEBFOLDER with Directory_Parent set to TARGETDIR and DefaultDir set to . (period). In the Web Site I changed Component Source Path to [MYWEBFOLDER] and in the Web Application I changed Component Source Path to [MYWEBFOLDER]MyFolder. When I install this package, it looks as if the Web Application is being created under the Test web site correctly but the files are installed in C:\WebFolder instead of D:\wwwsites\WebFolder.

I assume I am doing something wrong, but I haven't been able to find the magic incantation to make this work correctly.
Labels (1)
0 Kudos
1 Reply
EvanBarr
Level 3

Selecting the parent web site and selecting the physical path are actually two different things since IIS has no restriction here. You need to update the value of MYWEBFOLDER either based on the site selection (using a Custom Action) or let the user set it separately using a "Destination Folder" page.
0 Kudos