VS Setup Project...

B

Blue Streak

Hi, Folks.

I am trying to add [TARGETDIR] to the Environmental Variable %PATH
% for a console application written in C#.


I know the path for Win2k/XP is stored in the System Registry
under H_KEY_LOCAL_MACHINE but all I seem to be able to do is replace
the %PATH% variable with the Registry Editor within the project. Does
anyone know how I can *append* to the path instead?


TIA...
 
G

Guest

Read in the existing key to a string. Append your new path. Then write the
new value out to the registry key.
 
B

Blue Streak

Read in the existing key to a string. Append your new path. Then write the
new value out to the registry key.

--
Andrew Fausthttp://www.andrewfaust.com



Blue Streak said:
Hi, Folks.
I am trying to add [TARGETDIR] to the Environmental Variable %PATH
% for a console application written in C#.
I know the path for Win2k/XP is stored in the System Registry
under H_KEY_LOCAL_MACHINE but all I seem to be able to do is replace
the %PATH% variable with the Registry Editor within the project. Does
anyone know how I can *append* to the path instead?
TIA...- Hide quoted text -

- Show quoted text -

Thanks, dude!

Sometimes it takes someone else to point out the obvious.
 
B

Blue Streak

Read in the existing key to a string. Append your new path. Then write the
new value out to the registry key.
Blue Streak said:
Hi, Folks.
I am trying to add [TARGETDIR] to the Environmental Variable %PATH
% for a console application written in C#.
I know the path for Win2k/XP is stored in the System Registry
under H_KEY_LOCAL_MACHINE but all I seem to be able to do is replace
the %PATH% variable with the Registry Editor within the project. Does
anyone know how I can *append* to the path instead?
TIA...- Hide quoted text -
- Show quoted text -

Thanks, dude!

Sometimes it takes someone else to point out the obvious.- Hide quoted text -

- Show quoted text -

Spoke too soon...

How do you setup a variable in a Setup Project (MSI)?
 
B

Blue Streak

On Nov 6, 11:12 am, Andrew Faust <andrew [at] andrewfaust.com> wrote:
Read in the existing key to a string. Append your new path. Then write the
new value out to the registry key.
--
Andrew Fausthttp://www.andrewfaust.com
:
Hi, Folks.
I am trying to add [TARGETDIR] to the Environmental Variable %PATH
% for a console application written in C#.
I know the path for Win2k/XP is stored in the System Registry
under H_KEY_LOCAL_MACHINE but all I seem to be able to do is replace
the %PATH% variable with the Registry Editor within the project. Does
anyone know how I can *append* to the path instead?
TIA...- Hide quoted text -
- Show quoted text -
Thanks, dude!
Sometimes it takes someone else to point out the obvious.- Hide quoted text -
- Show quoted text -

Spoke too soon...

How do you setup a variable in a Setup Project (MSI)?- Hide quoted text -

- Show quoted text -

Okay, I'm starting to look like an idiot...

But I found the answer!!!

1) In Visual Studio open the Registry Editor for the Setup Project
2) Create a path to: HKEY_LOCAL_MACHINE \ System \ CurrentControlSet \
Control \ Session Manager \ Environment
3) Create a string value called "Path" with the value of "[%Path];
[TARGETDIR]"

[%Path] contains the existing environmental variable. This action
will *append* the Target Dir to it.
 

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