Setup and Deployment Project - Setting the PATH Environment Variable


I am building a setup and deployment project using visual studio .NET.  
Is there a way to append a specific path to the existing Path Environment
variable using the registry editor?


Who is Participating?
hammadrazaConnect With a Mentor Commented:
You can't do it with registry editor as far as I have the knowledge however you can create a simple consol application which will first get the value of registry key

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment: Path

and then it will append your path to that value and then write the value to registry again. Compile and add the executable to your setup project and then under "Custom actions>Install" add that consol executable. Now setup will automatically run the Consol application during installation and will append the desired path to "Path" variable.
vak0413Author Commented:
I currently use an external app as you've mentioned above but really wanted to use the tool's facillity if possible.
Oh well.

Not sure about the rules of this service but I have a follow-on question - Can I cause a system re-boot at the end of the installation using a Dployment Project?
The correct answer is yes you can.  In the registry editor in the deployment project, use [TARGETDIR] in your value setting for the key to represent the application install path.  
[TARGETDIR]application.exe %1
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.

All Courses

From novice to tech pro — start learning today.