views:

156

answers:

3

I have an installer class which I use to do some processing on the application after it is initially installed.

In the installer I have a custom dialog which requests a username and password. This is accessed in my installer class with

Me.Context.Parameters("username")

After setting it as CustomActionData /username="[TXTUSERNAME]"

This is all fine. The first dialog of a Web Setup Project gets the user to select an IIS website from a dropdownlist and set a VirtualDirectory if required. I need to get the seleted Hostname but so far I have failed to find a reference to it in any documentation.

I have tried things like:

Me.Context.Parameters("targetURL")
Me.Context.Parameters("TARGETSITE")

but none of them output anything..

Any ideas?

A: 

try

Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_HOST"]

or

Response.Write(Request.Url.Host.ToString()

I don't know if this you are looking for..

Woworks
Nope this is for the installer of my web application using a web setup project. The application hasn't even be installed into the IIS website at this point..
Markive
A: 

I created a sample Web Setup project and opened the MSI in ORCA editor.

May be "TARGETVDIR" could be of any use

ajay_whiz
+1  A: 

So is it some proessing after installation or not? You said that it was in your the question (first line) so we assume that there is something runnable on disk :-)

For example, if you are deriving from System.Configuration.Install.Installer you can invoke it post install via installutil and pass any kind of args you want - meaning you are free from MSI at that point.

Also check out this http://www.codeproject.com/KB/install/command_lines_setups.aspx There's source code etc. showing how to pass completely arbitrary command line args to MSI. It also lists tons of properties that are available - got to like at least one of them :-)

ZXX
Thanks for everyone's help this is the closest to the answer. That link looks really interesting.. My custom installer class is run at the commit stage, so before the MSI has totally finished but most of the install routine like copying files has been completed. I think this is just the normal time to invoke an installer class. At this stage I haven't been able to get the Hostname value from the IIS website "TARGETURL" etc.. this has given me a good link to go on.. Unfortunately I've been moved on to something else for the time being.. Again thanks!
Markive