Martchus / syncthingtray

Tray application and Dolphin/Plasma integration for Syncthing
https://martchus.github.io/syncthingtray/
Other
1.5k stars 42 forks source link

Enable Windows Auto-Start without User Login #224

Closed fx-k closed 6 months ago

fx-k commented 6 months ago

Thanks for the amazing work you have done with the syncthingtray project.

I would like to propose a new feature that would enable syncthingtray to automatically start on Windows systems without requiring user login to the desktop. Currently, the current version requires users to manually start syncthingtray after logging into the desktop to initiate synchronization. However, this can be inconvenient for users in server or remote desktop environments.

By implementing this new feature, syncthingtray would be able to start automatically and initiate synchronization upon Windows system startup, without the need for user login to the desktop. This would be extremely convenient and practical for users who wish to achieve unattended or remote management :-)

Martchus commented 6 months ago

If your use case is to run Syncthing on an entirely non-graphical system then I suggest you don't use Syncthing Tray and instead just use Syncthing itself and configure it as explained in its documentation: https://docs.syncthing.net/users/autostart.html#autostart-windows-service You could still run Syncthing Tray on another machine and let it connect to the Syncthing instance running on that server.

If your use case is to run Syncthing on a system where you only sometimes login to the graphical shell then you can do the same as on an entirely non-graphical system but also configure Syncthing Tray and its autostart on user login. You just would not let Syncthing Tray handle the execution of Syncthing because that's already covered by following the steps in the mentioned documentation. When following the documentation you could actually specify the path of Syncthing Tray (and not Syncthing itself and also not the path of the executable that ends with -cli.exe) and specify syncthing serve --home="..." as arguments. Then the version of Syncthing that is built into Syncthing Tray would still be used and you wouldn't need a separate executable for Syncthing itself.

Note that it makes no sense to implement an autostart of Syncthing Tray without user login because Syncthing Tray is just a GUI/tray application that doesn't make sense to run without a graphical shell. I get that Syncthing Tray also features a launcher for Syncthing itself but I think this use case is beyond the usefulness of a launcher that is embedded in a GUI application.

Also note that there's also documentation in Syncthing Tray's README explaining different ways of setting things up: https://github.com/Martchus/syncthingtray#does-this-launch-or-bundle-syncthing-itself-what-about-my-existing-syncthing-installation


Of course there's one thing that could be implemented in Syncthing Tray: The part that is handled by nssm.exe. Syncthing Tray could provide a UI in its settings/wizard that would allow configuring/controling Syncthing as a service and it could be more tailored to Syncthing than nssm.exe. This feature would actually be analog to the systemd integration that Syncthing Tray already provides for systemd-based systems. That's of course a whole different feature request - and a feature requrest a have already on my mind for a long time but never had enough motivation/incentive to work on it.

soredake commented 6 months ago

https://github.com/Bill-Stewart/SyncthingWindowsSetup

fx-k commented 6 months ago

Thanks for all good ideas! I think I will get it by nssm :-)