Seems very promising indeed!
If there is a release available I love to try this one. (I have no complier, and currently no release available for download)
Specially the option to install it as a service and use the tray to monitor/stop/restart, and the option to provide a alternative location for the config file seems great
Sorry, I did not look into the right place for your release. There is no release made on GitHub, but found it in the sourcecode “release” folder. Will look into it this weekend
A new version of my SyncThingTray has been released on GitHub (https://github.com/bloones/SyncThingWin), this time with a proper release where I tried to indicate all the information about it.
In summary, the shutdown, restart, upgrade APIs have been implemented. The shutdown API is used when stopping the service and ctrl+c if the shutdown fails. I added some installation options and the tray now monitor also the service (Notify of start and stop). Note that the service do stop when syncthing is shutdown.
For the API to work, you NEED to generate an API key. The service and monitor will read the key directly in the configuration along side the address. As an FYI, all the API calls are made via http. The .Net library I use (from microsoft but not in the framework), does validate the SSL server certificate and fail as the certificate is self signed. Also the API seems to indicate that it should be done over http.
Also, this time an additional dll is required that just need to be copied along side the executable. If syncthing is not running, access to the menu of the system tray will be delayed, as a check is made (ping API) that syncthing is available before to display the menu to update the option available.
I thing I am done for now unless there is any bug or requests that make sense to me.
Program crashes on “Install Service”…
System.ArgumentNullException: Der Wert darf nicht NULL sein.
bei Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind)
bei SyncThingTray.frmInstall.btnInstall_Click(Object sender, EventArgs e)
bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
bei System.Windows.Forms.Button.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I just made a debug build to see where exactly it crashes, and that runs fine. No idea what happened there.
But I think if the Syncthing process exits, the service should restart it instead of just stopping silently - at least if Syncthing started successfully, i.e. the GUI was available at least once. For me the point of a service is to keep Syncthing running, whatever it takes.
Maybe make that configurable? And at least log something in case it exits?
Good point. I will add an auto restart feature in the configuration. If the service stop, it will be logged in the windows event viewer. I will also check the install process to see where an error could occur: I may need to strengthen a bit the exception handling!
I thing I found the bug you reported: If when you installed the first time, the syncthing process priority was not set, it may have caused the exception: If not provided, I now default it to Normal.
I added the auto-restart syncthing option and tested it successfully!
v1.2 has been released on github: Enjoy
One more thing: On starting Windows the Syncthing console window always pops up and has to be closed manually. That’s rather annoying because it’s exactly the same behavior as if I just put syncthing.exe in the Autostart group (only with the service it keeps running when I close the window, of course). Is there a reason for that?
There is a -no-console option on Windows which you might want to utilize. It still pops up briefly though.
Ah, so that got put in in one of the latest versions. But I still like the service variant better
I am suggesting the svc wrapper could use that for the initial launch, because as far as I understood that was the issue when the window showed up.
No: It’a a bug! I always forgot to remove this issue of hiding the console at startup. Will do.
Yeah, but he basically rolled his own console
Can you implement an option to specify which browser to opened when the Show Gui option is clicked?
I am syncing my default browser and I don’t want to view the syncthing GUI in the browser I am syncing.
This project seems to be frozen. Is anybody still maintaining syncthingtray?