Getting Install Root Path For Web Installer

In my installer I tweak the web.config file settings based on values input in one of the installer dialogs.

Right now I assume "C:/Inetpub/wwwroot/" + virtualDirectoryName + "/web.config" where virtualDirectoryName is the passed value of "TARGETVDIR" in a custom action, but I'm hoping to find a more robust methodology (that will account for virtual directories somewhere other than Inetpub/wwwroot).

I tried looking at "TARGETDIR" but it ended up being the System32 folder or something (not what I wanted). Is there a way to get at the install root?
LVL 8
boulder_bumAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

praneethaCommented:
r u talking about Request.Phyicalapplicationpath
0
laotzi2000Commented:
What language do you use in your custom action?

But whatever, I think this will work.
Search for registry key value HKLM\Software\Microsoft\Inetstp\PathWWWRoot
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
boulder_bumAuthor Commented:
praneetha,

Unfortunately I don't have access to the Request object at install-time.

laotzi2000,

C#.

I'll check your suggestion out, thank you.
0
boulder_bumAuthor Commented:
Hey laotzi,

Thanks for that, it certainly helps, but it's slightly imperfect. That key looks like the default installation directory for ALL web apps, but it won't necessarily install there under certain circumstances (if I have a virtual directory that runs on a different port and doesn't use the default install root, for example).

It seems like there HAS to be a way to get at the install root. After all, the installer itself has to know where to put the files. Has anyone else checked this out before?
0
boulder_bumAuthor Commented:
I couldn't figure anything else out, so I went with that suggestion (and prompted the user if the file wasn't found).

Thanks again, man!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.