Automatic Upgrade Problem

I want to turn off automatic upgrades, but the build option -no-upgrade doesn’t seem to be working. Here’s what I have done:

  • I have downloaded the latest source today from GitHub/syncthing.
  • I modified the GUI index.html and overrides.css to remove a couple of menu items.
  • I ran: go run build.go -no-upgrade.
  • The executable, syncthing.exe was created.
  • I successfully run syncthing.exe and it launches the browser, correctly showing the GUI changes I made.
  • Then, a message pops up saying that an automatic upgrade was made and to restart.
  • The browser restarts, showing the original GUI without my changes.
  • My syncthing.exe is changed to syncthing.exe.old.

I don’t want the automatic upgrades to occur if they replace the GUI changes. What else can I do since the -no-upgrade option is not working?

You can override the GUI assets by setting the env var STGUIASSETS.

https://docs.syncthing.net/dev/debugging.html?highlight=stguiassets#stguiassets

A *.bat file to start syncthing in that way could look like this:

set STGUIASSETS=C:\mystgui\
c:\syncthing.exe

Since I don’t want to use a BAT file, how can I implement the solution in my build.go file so that automatic upgrades won’t happen?

Use -no-upgrade, it works. But do it from a clean tree, otherwise things that were built without -no-upgrade may still be used. Clean using build.go clean if you like.

Thank you Jakob. I’m not sure on the build.go clean… Do I run that as part of the same command string when I build with -no-upgrade? Or is that a separate step?

To be more specific, when I run go run build.go -no-upgrade, do I add “clean” in that string somewhere?

No, you clean first, then you build as you were doing. Try it, experiment a bit.

Great. Thank you for the tips… I haven’t used clean before. I’ll try it.

Thanks again. That works great for my Windows build.

I tried to build a Linux Binary, but it failed using that method. I get this error several times as it attempts to build: crosscall_amd64: adddynlib: unsupported binary format

And then at the end, it shows: exit status 2 exit status 1

Any ideas? This is using my custom build.go that uses the -H=windowsgui flag… But I thought from reading other posts that I could keep that flag across platforms.

No idea, sorry.

After further testing, I took out the -H=windowsgui flag for my LINUX build, and the build runs fine. I’ll note that in the other discussion.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.