takluyver / pynsist

Build Windows installers for Python applications
https://pynsist.readthedocs.io/
Other
896 stars 119 forks source link

Auto-run after installation and Auto-run after Windows login #178

Open youngkiu opened 5 years ago

youngkiu commented 5 years ago

To make the following functions of NSIS available to pynsist, I added the option of run_after_install and run_on_windows_start into the [Application] Section.

https://nsis.sourceforge.io/Run_an_application_shortcut_after_an_install https://nsis.sourceforge.io/Running_a_.exe_file_on_Windows_Start

Please review the code and apply it.

takluyver commented 5 years ago

Thanks for contributing, however...

Run after install: sorry, but no. It's not essential, and it's extra complexity in the installer, which I like to avoid. I've said no to enough things that I wrote a docs page about why I say no and what you can do instead.

Run on start: this is more interesting, but I suspect there's a bit more complexity than the NSIS wiki covers. I know of at least three ways something can be launched on Windows startup: the registry keys you use here, the 'startup' folder in the start menu, and services. What are the pros and cons of each? Do you want to start when the computer boots, or when the user logs in? Does it run as the user? If Pynsist is going to offer an any kind of 'run on start' option, we have to think through these things and figure out if there's an obvious answer that will be right for most applications.

youngkiu commented 5 years ago

I understand your thoughts.

There are three ways to run on start, as you mentioned

  1. the registry keys
  2. the 'startup' folder in the start menu
  3. services

The way in which each program is considered may be different, and it seems to be confusing.

Since it is a pull request, it is possible to refer to others who need it. Thank you for your review.

youngkiu commented 3 years ago

I rebase it with the latest code at https://github.com/youngkiu/pynsist/tree/auto-run.

willbelr commented 2 years ago

I would also like an option to place a shortcut into the startup folder upon install. That would be quite handy, and easier for the user to remove if undesired.