Fulgan
Posts: 101
Joined: Mon Feb 27, 2012 10:42 am

IIS WWW Root not deploying to the right place

Hello,

I'm trying to deploy an application that includes a couple of web components. Unfortunatley, the latest version of AI doesn't properly deploy the files when the default web site has been relocated to a directory other than the default.

For instance, if I change the location of the default web size to e:\inetpub\wwwroot and deploy a web application called "myWeb" under this site, AI will actually deploy to c:\inetpub\wwwooot\myWeb". After this, pretty much nothing works because permissions are all wrong, registered paths are all wrong (for ISAPI/CGI)
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IIS WWW Root not deploying to the right place

Hello,

This may happen if you have added your web application files under the "IIS WWW Root" folder from "Files and Folders" page. This folder location (associated with the "IIsWWWRootFolder" property) is always resolved at install time to the default physical path of the "Default Web Site". This is our current implementation. I've added an improvement on our TODO list so we can automatically detect if the default physical path of the "Default Web Site" has been changed and update the "IIsWWWRootFolder" property accordingly. Thank you for bringing this to our attention. We'll update this thread when the improvement will be out.

Until then, in order to avoid this limitation you should create your own custom action which will get the physical path of the "Default Web Site" and set it in the "IIsWWWRootFolder" property. The custom action should be scheduled after "Searches" actions group.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Fulgan
Posts: 101
Joined: Mon Feb 27, 2012 10:42 am

Re: IIS WWW Root not deploying to the right place

Thanks a lot. That matches what I'm experiencing. I'll look into the fix you suggest. Thanks
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IIS WWW Root not deploying to the right place

You're welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
abarry
Posts: 4
Joined: Thu Dec 15, 2016 3:48 pm

Re: IIS WWW Root not deploying to the right place

Hi everyone,

With help from the Advanced Installer team, I now have a solution which I'm hereby sharing:

1) Under "custom behavior > custom actions" I added the following "Run PowerShell inline script" (which I named "IISRootFolder"):

Script parameters:

Code: Select all

-WinVolume "[WindowsVolume]\"

Code: Select all

param ($WinVolume)

# Determine if IIS is installed
$IsIISEnabled = get-wmiobject -query "select * from Win32_Service where name='W3svc'"

if ($IsIISEnabled)
{
	# Retrieve default path from registry
	$wwwRootReg = Get-ItemProperty HKLM:\Software\Microsoft\INetStp -Name "PathWWWRoot"
	AI_SetMsiProperty IIsWWWRootFolder $wwwRootReg.PathWWWRoot
}
else # IIS is not installed
{         
	# Set default to inetpub\wwwroot    
	AI_SetMsiProperty IIsWWWRootFolder ($WinVolume + '\inetpub\wwwroot')
}
2) I placed the "IISRootFolder" custom action in the "Install Execution Stage" between "Searches" and "Paths Resolution", i.e.: Searches, IISRootFolder, Paths Resolutions ...

That's it!

The issues in our case was that if the IIS was not installed on the host machine during the time of installation, the website files would be incorrectly placed in the C:\Program Files (x86)\Manufacturer\Product\IIsWWWRootFolder. Then when applying the first software update, the IIS would then be present, thus causing the files to be placed in C:\inetpub\wwwroot - and in turn require reconfiguration of the IIS to point to the new folders in order for the solution's websites to work again (along with re-modification of a web.config file, but that's probably specific to our solution). Now the websites are installed in the correct location during installation, and peace has been restored.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: IIS WWW Root not deploying to the right place

Hello,

Thank you for sharing the solution on the forums.

Hopefully this will help other users facing similar scenarios.

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

Return to “Common Problems”