I have a web setup project which by default shows the virtual directory in the textbox installer screen. I wish that the virtual directory name cannot be edited by the user
Lo-tech solution: edit the vdproj file in notepad++ to set the virtual directory and remove the Installation Address dialog from the User Interface Editor.
Org does not allow open source, or GPL open source.
Solutions: * edit the custom action (right click>view>custom action) to fix the virtual directory and path Change the customactiondata:
/targetdir="[TARGETDIR]\" /connectionstring="[CONNECTIONSTRING]" /targetvdir="[TARGETVDIR]" /targetsite="[TARGETSITE]"
To:
/targetdir="[TARGETDIR]\" /connectionstring="[CONNECTIONSTRING]" /targetvdir="FIXED_NAME" /targetsite="[TARGETSITE]"
You might just delete the Installation Address from user interface, and setup a component that passes information to the custom install
Select your setup project, View > Editors > User Interface, select the Installation Address dialogs, and delete them.
EDIT:
As Shay points out, users can override the default install location from the command line. To override this, you should set the TARGETDIR property in your InstallExecuteSequence. Unfortunately, you cannot change this sequence from Visual Studio, you have to use Orca:
In order to get the Virtual Directory using Context.Parameters
Sounds good in theory but near as I can tell, doesn't work, at least not for setting AppPool. I have a custom action to set the apppool (which by the way works fine when the installer is built with VS2005) in my vs2008 web setup project.
DirectoryEntry IISVdir = new DirectoryEntry(String.Format("IIS://{0}{1}/{2}", strServer, strRootSubPath, Vdir));
IISVdir.Properties["AppPoolId"].Value = appPool;
IISVdir.CommitChanges();
The installer runs with no dialog (removed the installation address UI node) but the AppPool set on the virtual directory ends up being DefaultAppPool.
Other custom actions in my helper class do run and work.
So there must be some other magic incantations needed.
Thanks.
For me in VS
Right click on setup project
View -> File System
Web Application Folder (in the left pane)
in the property window (to the right, bottom)
Virtual Directory (the last one)
Here you can change/set the default path on IIS i.e. target directory which can be installed.