I am creating a Visual Studio 2008 Setup Wizard for my program
http://support.microsoft.com/kb/307353
I see that it is possible to add registry entries, etc..
Is there a possibility to register windows environment variable without writing a custom action?
And if I must write a custom action, what is the least painful way to do so?
相关问题
- How to know full paths to DLL's from .csproj f
- Importing NuGet references through a local project
- Visual Studio 2019 - error MSB8020: The build tool
- 'System.Threading.ThreadAbortException' in
- VS2017 RC - The following error occurred when tryi
相关文章
- How to show location of errors, references to memb
- How to track MongoDB requests from a console appli
- Visual Studio Hangs on Loading UI Library
- How to use Mercurial from Visual Studio 2010?
- Copy different file to output directory for releas
- Edit & Continue doesn't work
- “Csc.exe” exited with code -1073741819
- Visual Studio: Is there an incremental search for
Using Visual Studio 2008, you can easily do it by setting the appropriate variable in the Windows registry:
If you want the Value to reference the installation directory, you can do it like this using property variables: [TARGETDIR]SomeFile.ext (see http://msdn.microsoft.com/en-us/library/aa370905%28v=vs.85%29.aspx for more property variables)
Windows Installer does support environment variables through Environment table, but Visual Studio setup projects do not allow you to use it.
A solution is to use a different setup authoring tool which supports environment variables: http://en.wikipedia.org/wiki/List_of_installation_software
Another solution is to manually add it in Environment table by editing the MSI with Orca.
There's also the custom action approach you mentioned.
Ickydime (see answers above) custom action sample shows how to add an environment variable by expanding the PATH env variable. I'm sharing below how to create a new environment variable using
Environment.SetEnvironmentVariable
The top answer explains how to do it without a custom action but those looking for a custom action can use the following code as a template:
This walk-through shows you how to create and apply the custom action: https://msdn.microsoft.com/en-us/library/d9k65z2d(v=vs.100).aspx