2

I'm using InstallForge to create an installer. I'm hoping to create an installer that will autostart on start up for the installed program. I'm thinking the installer can create a shortcut in the Start-Up folder and the program should load on start up.

I've Googled and found a solution but doesn't work when I try it. The solution provided was to use the following values for a created registry entry.

Root Key: HKEY_CURRENT_USER

Sub key: SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Value Name: (whatever name you want the key to be) My Program Name

Value Data: C:\Program Files (x86)\My_Company\My_Software\My_Software.exe

2 Answers2

0

Quoted Paths: Did you include quotes around your path in the registry value? "C:\Program Files (x86)\My_Company\My_Software\My_Software.exe". I would remove the spaces in the registry value name as well: My_Program_Name. You can also register the application to run for all users by adding to HKLM (HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run) instead of HKCU.

There appears to be different keys for x86 and x64 binaries - at least for per-machine components:

  • HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run
  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Services & Scheduled Tasks: In my opinion it is generally better to run as a Windows service if you need to run all the time, or to use scheduled tasks for things that need to run "every now and then". I prefer those options over the run feature. It all depends what your application is doing. Both scheduled tasks and services can run impersonated - with different user credentials than the currently logged on user (and hence elevated if need be).


AutoRuns: For the record, there is a myriad of ways to run once or launch something on startup as you can study by using the tool AutoRuns to list all the entries on the system that are registered.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • I'm trying the following with quotations for the registry value but it still doesn't work "\\\Program Name.exe" – Jimmy Wayne Aug 10 '18 at 04:34
  • Maybe copy the path from the registry with the quotes and all. ***Windows Key*** + Tap ***R***, now paste the path and press ***Enter***. What happens? Any obvious errors? What about logging from the application? Anything in the system event log? Does the application need admin rights to run? – Stein Åsmul Aug 10 '18 at 12:53
  • That works! Thanks! Do you know how to automatically run the program after it is installed? – Jimmy Wayne Aug 10 '18 at 14:57
  • So it works when you run the path from the registry? Or does it work when you start Windows after a fix to the path? And starting a program directly after installation (from the setup) is generally a feature in many deployment tools, I can't speak for InstallForge, though, since I have never used it. – Stein Åsmul Aug 10 '18 at 20:19
  • It works when I start Windows after a fix to the path. – Jimmy Wayne Aug 11 '18 at 17:06
0

Assuming that the Run key item is correct in the registry:

  1. The program will not start when the system starts. It will be started when a user logs on. If you want it to start when the system starts, then a service is the usual way to do this.

  2. On UAC systems the program won't just start if it requires elevation. If this is the issue, then your question is the same as Program needing elevation in Startup registry key (windows 7)

PhilDW
  • 20,260
  • 1
  • 18
  • 28