Force file to autostart with Windows in VS's MSI setup

不羁岁月 提交于 2020-01-16 04:19:32

问题


How do I make my executable file start with Windows in Visual Studio's Windows Installation project (MSI setup creator)?

Tried to add registry keys, look into 'Assembly' properties. I have the MSI project compile and it installs fine to the folder but I need it to run

a) After installation is complete b) Every time Windows starts.

Thank you


回答1:


On Scheduled Tasks versus Windows Services. See this previous answer for longer descriptions of the below summary items. I don't use this installer tools, so detailed steps I can't do right now.

Startup Folder: You can use the Windows startup folder as suggested here - allusers:

  • C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
  • C:\Users\<user-name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Quick access: Windows logo key + R => shell:startup.

Windows Service: Windows services can be set to run on boot / system startup.

Scheduled Task: It is possible to launch tasks on every boot using the task scheduler.

AutoRun Registry: You can register something to run on launch in the registry:

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

Drivers: I suppose one can mention drivers as well. They load on startup.


When should I use a scheduled task instead of a Windows Service?


Autoruns.exe: Sysinternals has the tool autoruns.exe which will show you just how many ways there are to start something on system startup:


Links:

  • https://www.advancedinstaller.com/user-guide/qa-launch-app-logon.html
  • How to Run Programs Automatically When a User Logs On (Winkey + R => gpedit.msc)


来源:https://stackoverflow.com/questions/56640799/force-file-to-autostart-with-windows-in-vss-msi-setup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!