Setup project registery values with app install folder in them

B

Brian Henry

I am trying to deploy my VB.NET project with a setup project, and I need to
make a reg key entry.. but it also needs to have the path to where the
program was installed in they string i placed in the key. How do I go about
insertint the installation path (folder only) to the file into the registery
on installation of the setup project?

Say my project was installe to "c:\program files\myproject"

I want to make a registry key string at ..\Software\MyProject which hast the
string

Location = "c:\program files\myproject\SomeFile.xyz"

but of course the user can change the install location, so just entering
this as a string in the installer wont work, how do i fix this and replace
the path with what they installer installed it to? thanks
 
C

Cor Ligthert

Brian,

In that great tool the development project there are a lot of nicely hidden
tools.

One of them is in the Edit In your IDE, there suddenly is a new item when
you are busy with an deployment project, that gives you the possibility to
edit Registry parts .

I hope this helps,

Cor
 
B

Brian Henry

I'm sorry I don't understand what you mean, I already have the registery
editor open in the deployment project, and already set up all the keys in it
for installation, I just can not figure out how to put a replacement code
for the path where the project was installed to in to the new string value I
created in the registery file during the install process..
 
C

Crouchie1998

I think you are talking about Application.ExecutablePath

If you are adding your assemly to Program Files then why not 'Hard Code' it?
Example:

Program Files\YourDirectory\YourExeFileHere

Crouchie1998
BA (HONS) MCP MCSE
 
B

Brian Henry

how do I know where they installed it to? the registery key is created at
*installation* not execution.. this is a background process they will never
have to touch themselves, and I need it to run on login, but the user could
of placed it in a different difrectory then I'd be assumeing in hard codeing
when they selected the install path.. which is why I am asking how to
replace it. I don't believe application.executablepath works in the setup
project in a registery entry does it?
 
C

Crouchie1998

Above the project explorer are a few icons. One of the is for the dialog
boxes displayed for the installation. Just remove the change directory
dialog & they won't be able to change the installation directory

Crouchie1998
BA (HONS) MCP MCSE
 
B

Brian Henry

humm, thats still just a crutch for me, yes it would work... would rather
know how Microsoft and others actually do what I want to do in code in their
installers...
 
T

Todd Derksen [MSFT]

Brian, to do this just use [TARGETDIR] in your registry value it will
expand at install time to the folder the app gets installed to, and still
allow the user to choos ethe installation point.

Todd Derksen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top