Portable installation for Windows (core ST)

Only Linux user, I wandered how I could convince my friends to give a try to syncthing. Strangely, even after several months of harrasment and punctilious hard work on translation with transifex for French I didn’t get any success, although it is well known that most Win users are kind of “Install-first-think-after”… Maybe this is thanks to my warnings… or because of my complicated/crappy advices :frowning: Whatever, I don’t throw in the towel, and for the end of year gifts I will offer them a portable USB stick with ST :slight_smile: Here is the job: Stick layout: \Program\32bits \Program\64bits \Shares Files: \autorun.inf: [autorun] open=Program\syncthing.bat label=Start syncthing icon=syncthing.ico #optionnal line. Remove if you don’t want/care with stick icon

[Content] MusicFiles=false PictureFiles=false VideoFiles=false

[MesCouilles] AutoRunIsRemovedFromWindows7+=true (du cul)

\StartManu.bat: @echo OFF echo. echo ****** INFO 1 ****** echo To cancel now, hit Ctrl+C echo. echo. echo. echo. echo. echo ****** INFO 2 ****** echo Once I run, you should stop syncthing if you want to eject the USB stick: echo. echo by clicking “Action->Shutdown” in the management web page. echo. echo. echo. echo. echo. PAUSE call .\Program\syncthing.bat

/If You Redistribute.txt: IMPORTANT!!! Keep this file if you redistribute. Subfolder x:\Program\Syncthing MUST NOT EXIST. It will be created/populated on first run. It contains user’s secret key.

\Program\syncthing.bat: @echo off %~d0 IF %~d0==C: GOTO WARN IF %~d0==D: GOTO WARN cd “%~dp0” IF %ERRORLEVEL%==0 GOTO PATH_IS_OK exit :PATH_IS_OK set STNODEFAULTFOLDER=1 IF NOT %PROCESSOR_ARCHITECTURE% == x86 GOTO ST64 ELSE ( start “syncthing” /B /LOW .\32bits\syncthing.exe --no-console --home="%~dp0\Syncthing" exit ) :ST64 start “syncthing” /B /LOW .\64bits\syncthing.exe --no-console --home="%~dp0\Syncthing" exit :WARN echo. echo. echo *** This is no more INFO, this is a problem *** echo It seems you launched me from your HDD, but I am a launcher for a portable setup. echo Hit a key to kill me. Whatever, I won’t do anything else. echo Bye bye PAUSE exit

\Program\syncthing.ico: unsheathe your GIMP # optionnal

\Program\32bits\syncthing.exe: 32 bits \Program\64bits\syncthing.exe: 64 bits

SyncTrayzor has a portable installation :smiley:

If you want to go ahead and do things manually, a couple of criticisms:

  1. Just ship 32-bit: it runs fine on x64
  2. Don’t redefine APPDATA - use the -home flag to Syncthing

The 32 bit version is prone to crashing on larger setups and I’d generally avoid it unless absolutely necessary, so I disagree a little with this. To get started however, it may be easier.

And, if I understand the above correctly, definitely do not stick the secret key files in C:\Program Files or so.

Well, I checked the new APPDATA is for the currently running bash only. I wouldn’t like to break anything changing the global user variable. @calmh, on first run a folder Syncthing is created in the stick in Program folder, beside 32bits/64bits folder. I didn’t use -home because I didn’t understand how it works. Now, just trying --home it’s all fine. I added a check to exit if the batch is ran from c: or d: : I don’t know why (maybe I double-clicked a copy of the batch I had in my hard-drive and I didn’t remove in it the APPDATA redefinition, I got a system crash from my firewall driver.sys - this sometimes happens when burst prompts occur on my poorly responsive XP machine - on reboot I ended in a %users%\TEMP profile :frowning: - I got rid of this closing the session, switching to admin, have a look in HKLM\winnt…\ProfileList\ where I saw my own entry with a .bak suffix => renamed, close admin session, log in as Me OK :sunny: )