question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NSIS start program automatically when Windows starts

See original GitHub issue

Feature Request

  • electron-builder@11.4.4:
  • win32, win64:

packge.json

{ 
  "name": "myapp",
  "productName": "My App",
  "author": "My Company",

...
    "nsis": {
      "oneClick": false,
      "allowToChangeInstallationDirectory": true,
      "menuCategory": ["Startup"],
      "runAfterFinish": false
    },

On selecting per machine install, the default path is:

C:\Program Files (x86)\Startup\myapp

Whereas I was hoping for:

C:\Program Files (x86)\My Company\myapp

And then for the installation to then place a shortcut into the startup menu. Or a way of naming the default path that is divorced from menuCategory.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
alexbraziercommented, Feb 20, 2017

@Zayelion This is how I have done it with the current version using the include file if this helps:

!ifndef BUILD_UNINSTALLER
  Function AddToStartup
    CreateShortCut "$SMSTARTUP\AppName.lnk" "$INSTDIR\AppName.exe" ""
  FunctionEnd

  ; Using the read me setting as an easy way to add an add to startup option
  !define MUI_FINISHPAGE_SHOWREADME
  !define MUI_FINISHPAGE_SHOWREADME_TEXT "Run at startup"
  !define MUI_FINISHPAGE_SHOWREADME_FUNCTION AddToStartup
!endif
!macro customUnInstall
  Delete "$SMSTARTUP\AppName.lnk"
!macroend

It uses the unused readme option - I’m not sure if this would be considered bad practice and you would rather implement it from scratch (although the MUI docs say you can use the readme for other purposes)

0reactions
Zayelioncommented, Feb 21, 2017

Thank you. Im not sure if I’ll ever get around to this as my employer has stopped asking for it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NSIS start application on Windows startup (without Startup ...
Is it possible to add the application in the install process to some registry, in order for it to start automatically on Windows...
Read more >
NSIS start program automatically when Windows starts - Redino
NSIS start program automatically when Windows starts · 1. Add program to Run or RunOnce Key · 2. Add program shortcut to Start...
Read more >
launch on start up - NSIS Forums
You mean Windows start up? Just place a shortcut to your EXE in the Startup folder in the Windows Start menu > Programs...
Read more >
Running a .exe file on Windows Start - NSIS Wiki
Running a .exe file on Windows Start !include "MUI.nsh" Name "START WINDOWS" ... "Software\Microsoft\Windows\CurrentVersion\Run" \ "Notepad" ...
Read more >
Using NSIS To Make Installable Java Applications
For those of you who don't know, the start menu / Programs is actually a folder which sits in your computer (inside C:\Windows...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found