Bill-Stewart / SyncthingWindowsSetup

Syncthing Windows Setup
Mozilla Public License 2.0
1.07k stars 44 forks source link

Installation successful, but Syncthing does not start after reboot #12

Closed Adito5393 closed 1 year ago

Adito5393 commented 1 year ago

The task scheduler reported that the action was successfully executed. I tried to start it via the provided shortcut Start Syncthing without any luck. Running the following command manually also did not start it: C:\Windows\System32\wscript.exe "C:\Users\USERNAME\AppData\Local\Programs\Syncthing\StartSyncthing.js"

Fix

In the end, what actually makes it start was: C:\Windows\System32\cscript.exe "C:\Users\USERNAME\AppData\Local\Programs\Syncthing\StartSyncthing.js" Any ideas why wscript didn't work for me? But cscript works fine? (I have little experience with Windows app development)

FYI, I have crowdstrike falcon installed & Windows Defender disabled. Maybe they block JS execution via wscript? Some system info:

systeminfo /fo csv | ConvertFrom-Csv | select OS*, System*, Hotfix* | Format-List

OS Name             : Microsoft Windows 10 Pro
OS Version          : 10.0.19045 N/A Build 19045
OS Manufacturer     : Microsoft Corporation
OS Configuration    : Member Workstation
OS Build Type       : Multiprocessor Free
System Boot Time    : 13/08/2023, 20:26:56
System Manufacturer : LENOVO
System Model        : 81YT
System Type         : x64-based PC
System Directory    : C:\WINDOWS\system32
System Locale       : en-us;English (United States)
Hotfix(s)           : 18 Hotfix(s) Installed.,[01]: KB5028946,[02]: KB5027122,[03]: KB5007401,[04]: KB5011048,[05]:
                      KB5011064,[06]: KB5012170,[07]: KB5015684,[08]: KB5029244,[09]: KB5014032,[10]: KB5016705,[11]:
                      KB5018506,[12]: KB5020372,[13]: KB5022924,[14]: KB5023794,[15]: KB5025315,[16]: KB5026879,[17]:
                      KB5028318,[18]: KB5028380

PS: Thanks for making this cool installer for Windows & I'm reporting this more for others to know how to fix this issue if they ever encounter it.

Bill-Stewart commented 1 year ago

It sounds like you performed a non administrative (per user) installation.

The purpose of executing the StartSyncthing.js script using wscript.exe (rather than cscript.exe) is to prevent the superfluous console window from appearing. This is by design. I just tested the per-user installation and the logon task works as expected: Syncthing starts when the user logs on, and the configuration page link works as expected.