SyncTrayzor: Windows host for Syncthing. Installer, auto-start, built-in browser, tray icon, folder watcher, and more

Thanks!

To give credit where credit’s due, both Syncthing Tray and syncthing-gtk made native Windows clients before SyncTrayzor came along.

I toyed with the idea of making a native Window UI, and not displaying Syncthing’s web interface, but rejected it for 2 reasons:

  • It would be a lot of effort for not much gain
  • Syncthing’s UI is still evolving, and will continue to improve (there’s a new design proposal floating about on the forums). Continuously being behind, and playing catch-up, to Syncthing’s native UI just presents a worse user experience.

To be honest, I’m not a fan of ClickOnce. Using Inno Setup lets me have quite a lot of flexibility with the installer - I can insert custom screens, do custom logic, write registry keys, move things around, etc. There’s talk of rebranding SyncTrayzor - using Inno Setup lets me do this in a clean way without leaving unused guff all over the user’s filesystem. I’m also not sure how my requirements for separate 32-bit and 64-bit installers, with unmanaged components which aren’t referenced by the C# project, would work with ClickOnce.

Also, using GitHub as a distribution platform has a lot of advantages. It’s trusted by users, and they’re more likely to download something from GitHub’s releases pages than they are from a random website.

If you speak another langauge, then please help out with the translation effort! Details are in the README. If you want to take a snipe at any of the open issues please do! Start a discussion in the issue first, though, so we don’t duplicate work. Otherwise, feature requests and bug reports are always welcome.

Well absolutely. I think there’s some really strong developers here; it’s a good way to learn from others.

In terms of ClickOnce, it’s been about 4 years since I deployed it on a corporate LAN. If there’s better stuff out there, then by all means use the best. I’m not familiar with Inno , but it sounds like you are on top of all of that. So I’ve no idea what Inno Setup is but it sounds newer than ClickOnce, haha. I must be dating myself here

“So yeah I’m thinking we write a FORTRAN client next…it’s really blowing up on AIX systems these days…” :wink:

Currently I’m reverse-engineering the protocol with Wireshark. I got all the traffic decrypted thanks to some help from the main developers, and right now I’m writing a Wireshark plugin for the BEP protocol. I’d like to be able to see exactly what’s happening under the hood – perhaps there can be enhancements made… Or at the very least, for my own understanding, I’d like to contribute some additional documentation for BEP and the REST API, and open-source the Wireshark protocol decoder module. That way people can debug their own code over the network, and we can make some slick developer documentation.

I do really enjoy creating UIs in Windows (C#) or Java (cross-platform) … It’s more art than programming (for me anyway) to get a nice user experience… That said, since all development has moved to this whole Web2.0 world, there are fewer and fewer desktop apps. The only place where apps are blowing up is in mobile. I suppose the whole REST API will come in very useful for all of this.

I do know that I have been mulling over the BEP protocol for awhile . . . Just as a thought experiment to see where this can go.

One thing I am 100% confident in (besides the ability of the developers here) … I’m very confident in the desgn and structure of the Angular REST code and the control protocol. It’s absolutely fantastic. I’ve been very surprised and impressed. It’s not easy to write good Angular.js code, but this is really state of the art.

So my overall point is this: I get the reasoning for not bothing with a native GUI. It might be fun, and I’ve been toying with the idea as well, but the usefulness is questionable… HOWEVER… since the REST API is so robust, really we can make a GUI client in just about anything pretty quickly. Any language, more or less. And I’m sure the UX/UI will continue to evolve and improve, for all the clients.

Github is great – I agree. The only problem with Github is it can be confusing for the end user who doesn’t work in the indusry. I like the idea of dumping everything on github so developers can fork and issue pull requests , etc… And then for a ‘release’ cycle… You have a rolling weekly release that’s auto-built, and then you have official ‘stable’ releases linked off the main web site. I think that’s more or less how things are set up now, so that’s cool.

No no… I don’t speak another language besides conversational Spanish. “Dame más cerveza” . I meant I’m polylingual in everything except the more modern languages like Scala and Go. Mainly Python, Java, and C/C++/C#.

When I get the opportunity, I’d love to install and check out your code in detail. From the brief look I took at it, it seems really cool. I meant more if you get bugfixes or feature requests as open Github issues, I can probably knock those out pretty quickly since I know C#, then issue a pull request back to your repo with whatever issue is open.

But anyway, great job, and kudos to everyone who’s been coding on this project , whether for Syncthing Tray, Syncthing GTK, or the reference Go implementation. Not easy work, but certainly something to be proud of.

1 Like

Not sure if this is of interest, but here is a per-file updater that phones home to see if it needs to update any files: (In one project, I use it to supplement an Inno Setup installer)

I googled “don’t use clickonce” and came up with a couple interesting hits to provide some justification for my similar lack of affection for it:

Yes, the REST API seems very clean, and I’m currently trying to go a completely different approach: Create an GUI based instance manager that just uses the REST endpoints to control / manage them. There is so much more information available through it and I like to see the status of my “mesh”. Also it should make the flows much easier, like adding a folder to multiple instances does no longer need approval on every instance if you have access through the REST-API.

Preview can be seen on https://dl.dropboxusercontent.com/u/3963769/metrothing/preview_gui.png

It’s just the first iteration of a possible GUI. REST client is working great so far, next thing up is threading and state machines to keep the polling and flow under control. Right now it is just a proof-of-concept, but I like it so far.

1 Like

Thanks for those! I was wondering how best to do auto-update, given UAC etc. I’ll have a read through those over the weekend.

Hello all ! May I jump in a discussion between devs and rise a particular issue ? (hope this is the right place).

I’ve noticed that SyncTrayzor consumes a lot of memory. The initial scan is completed and nothing else is ongoing, apart from checking repositories as per the scan interval. It’s constantly around 300-400MB.

Is it normal ? Is there a particular setting I should check ? What’s the best option to address this ?

Thanks again for such a nice piece of software :sunglasses:

PS: I’m coming from SyncthingTray…

So I guess syncthing is using the memory (rather than SyncTrayzor). I suggest you create a separate thread about this in order to stay on topic.

Just want to mark my first issue with this. It does consume quite some memory, on mine I’ve seen it as high as 203MB just for SyncTrayzor’s process.

Also, opening it from the Notification Area and to open up the GUI takes up to 15 seconds, freezing the process. The same applies when I right click the icon and select exit.

i5 CPU with 6GB RAM (it’s a laptop)

@AudriusButkevicius In my process explorer, SyncTrayzor shows 300-400MB while syncthing shows ~30MB. same 10-15seconds freeze on opening in systray, as mentioned by @Rewt0r .

How can I or can someone move this post (and the following ones) to a new topic ?

Leave it here for the minute. I’m on GMT so it’s the end of the day here, but I’ll respond properly tomorrow.

Okay, so the memory thing might be off-topic depending on who is using the memory…

From my own experience: Windows code, even managed code in C# , can have horrible memory leaks You’d be astonished. Few are aware that certain types of managed C# code can leak memory like a sieve.

I only know this because of a robotics project I wrote years ago … The control system was on Windows in C# with a GUI… After running for 30mins to 60mins , the system would crash. I finally noticed my process (all managed code) was steadily growing in footprint as you used the app.

There’s a few ways this can happen… If memory serves me… (1) The Microsoft OCR library leaked memory. (2) The worst offendor was Image or Bitmap (and their classes and superclasses), (3) A few other libraries that are standard in C#

You can easily find out by running your app and checking it periodically with a memory profiler. http://memprofiler.com/screenshots.aspx

I don’t think this would apply to Go , as I seriously doubt Go leaks memory under normal circumstances

@kreischweide

Wow your GUI looks slick … That’s Windows 8 , right? What are you developing it in?

I like your post “There is so much more information available through it and I like to see the status of my “mesh”” … I agree with this … However, I don’t know if this will have ‘mass appeal’. But it certainly appeals to me, heh.

“t should make the flows much easier, like adding a folder to multiple instances does no longer need approval on every instance if you have access through the REST-API.”

That’s actualy a clever idea. Would definitely make creating larger meshed networks easier (rather than log into each one via ssh and port forwarding for 8080).

Whoever put the Angular web services into Syncthing made a really really smart decision.

The memory usage I’d expect from SyncTrayzor is < 100MB, normally around 60 to 80 (as shown in Task Manager - i.e. numbers refer to Private Working Set). A lot of this is down to the embedded browser component.

Are you running the 32-bit or 64-bit build? Did the memory increase slowly over time, or did it jump up? Have you been closing to tray / restoring from tray a lot? When you say there’s a freeze when opening from the tray, is that an actual freeze (i.e. window is unresponsive, can’t open any menus - move the window), or just the browser bit loading?

Thanks!

Note that easy, you’ll find :wink: Quite often managed memory leaks will be due to either unsubscribed event handlers or static caches (e.g. of RuntimeMethodInfo, String) down in the CLR. The former are reasonably easy to figure out, but the latter can be a complete nightmare, since there’s no indication of what’s ultimately populating the cache.

I’m running the 64-bit build. And memory gradually increases (I’ve just closed it all, as it was around 490MB and hogging other processes). I’ll try bare Syncthing again, to keep my folders synced at least. Concerning the freeze, I thinl it’s rather the browser loading. Other open windows/processes slow down a bit but become responsive again after 10-15 seconds Thanks anyway for this nice work.

This is memory as measured in Task Manager - i.e. Private Working Set? Is it in your tray, or visible, while memory is increasing?

The memory usage should never get that high, and I’ve never seen it get anywhere near that! So something really odd is going on, and I’d like to pin down what it is.

Could you also post the contents of C:\Users\<You>\AppData\Roaming\SyncTrayzor\SyncTrayzor.log? (beware you may need to censor things like Device IDs). That might give us a clue too.

EDIT: Are you definitely running the latest version (v1.0.8)? You can see the version in Help -> About. Version 1.0.1 had quite a bad memory leak…

I’ve also checked the current version. It’s always around 100-200MB, but I see that almost always 2 chromium instances are running, even when Syncthing is not active. Not sure what the second one does. Maybe it would be possible to get a detailed process hierarchy via Process Explorer to see where the memory went?

Yeah windows 7/8, C#, VS2013 with some GUI framework, Made some more progress, here is a preview, but it’s far from ready. I’ll make a dedicated thread as soon as it is somewhat useable, if ever. This is not the right place for it.

2 Likes

This looks darn awesome.

Which memory? Private working set? Private bytes? Working set? It’s important to distinguish which number you’re reading. Here’s a screenshot of Process Explorer with more figures turned on: in order, they’re, Private Bytes, Working Set, Private Working Set (WS Private) and Shareable Working Set (WS Shareable): http://imgur.com/oASZS5M. SyncTrayzor’s private memory usage is 70MB - the rest is shared libraries, most likely .NET: this memory is shared across multiple applications. Likewise the two CefSharp processes are sharing a good portion of their memory

You should see two CefSharp processes while SyncTrayzor is displayed/minimized, and one when it’s in the tray. I used to close as much as I could when SyncTrayzor was minimized, but that lead to Syncthing UI dialogs being closed, which was annoying. There’s no way to shut down CefSharp completely unfortunately: this is documented.

Sorry for replying a bit late (things to do IRL). I was running the 1.0.7 and updated to 1.0.8 (always portable) after your post. It has been on since then and I’m around 90-95MB (as displayed in Windows Task Manager). I’ll let it run until tomorrow but I think it’s better now.

I just counted how long it took to open, double clicking from the tray took 15 seconds for the window to appear then a further 25 seconds for the Chrome part to load. Whilst waiting for the Chrome part to load clicking any menu items took about 3 seconds each to display, the window could be moved around.

Will report back with memory usage as seems better atm. BTW I use x64 portable.