I'm creating a VS2008 installer script for my project.
I want to add a value to HKCU\Software\Microsoft\Windows\CurrentVersion\Run to run my EXE at start up.
Is there a way I can specify a reference to my executable ("Primary output from Project"), so that the installer script inserts the correct value into the registry when it runs?
I don't wa开发者_开发问答nt to have to hard code the path and name for the executable in the registry value.
To reference the executable, enter this string in the registry entry's value:
[TARGETDIR]YourProgram.exe
Windows Installer is a declarative programming language, not an imperative scripting language. [#FileKey] will also do the trick. I suggest reading the following two MSDN topics.
Registry Table
http://msdn.microsoft.com/en-us/library/aa371168(VS.85).aspx
The registry table joins registry resources to their components.
Formatted
http://msdn.microsoft.com/en-us/library/aa368609(v=VS.85).aspx
精彩评论