views:

18

answers:

2

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 want to have to hard code the path and name for the executable in the registry value.

A: 

To reference the executable, enter this string in the registry entry's value:

[TARGETDIR]YourProgram.exe

Avalanchis
+1  A: 

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

Christopher Painter