We use the web setup project to deploy our web applications. To automate additional installation tasks like setting the .NET version and encrypting the web.config files we use a custom installer along with the web setup project (see relevant code below). However we recently ran into a problem when deploying an application on a server where there are several web sites. The site we wanted to install on was not the default site. Therefore our code to set the .NET version and assign the newly created application pool did not work since "W3SVC/1/ROOT/" was not the correct path to the website. Is there a property similar to [TARGETDIR] which we can pass to our custom installer to account for this. We know hard-coding "W3SVC/1/ROOT/" was not the best option but we also knew it would be correct 90% of the time. Thanks as always for your time.
Best Regards,
Stephen
info = New ProcessStartInfo()
info.FileName = "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe"
info.Arguments = String.Format("-s W3SVC/1/ROOT/" & strVDir)
info.CreateNoWindow = True
info.UseShellExecute = False
Process.Start(info)
info = Nothing
Dim myApp As New DirectoryEntry("IIS://localhost/W3SVC/1/ROOT/" & strVDir)
myApp.Properties("AppPoolId").Item(0) = strMyAppPoolName
myApp.CommitChanges()
myApp = Nothing
Hi Stephen,
You can pass in the targetsite and targetvdir path as context parameters to your custom action by passing this:
/targetdir="[TARGETDIR]\" /targetvdir="[TARGETVDIR]" /targetsite="[TARGETSITE]"
Powered by: newtelligence dasBlog 2.1.8102.813
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2012, Shawn Neal
E-mail