Skip to content

Latest commit

 

History

History
113 lines (72 loc) · 5.84 KB

building.md

File metadata and controls

113 lines (72 loc) · 5.84 KB

Building Syncthing Windows Setup

Listing of Files

The following table lists all of the files associated with Syncthing Windows Setup (hereafter referred to as "Setup").

Folder or File Description
bin Folder contains 32-bit and 64-bit Syncthing binaries
asmt Folder contains 32-bit and 64-bit asmt binaries
shawl Folder contains 32-bit and 64-bit shawl binaries
ServMan Folder contains 32-bit and 64-bit ServMan binaries
stctl Folder contains 32-bit and 64-bit stctl binaries
redist Folder contains other files from the Syncthing download archive
building.md This file
LICENSE License agreement
Get-Download.ps1 Downloads latest zip files from https://syncthing.net/downloads/
Expand-Download.ps1 PowerShell script that extracts the Syncthing Windows download zip files to the correct paths for building Setup
lang-scriptname.js Setup installs one or more of these WSH scripts on the user's system
License-lang.rtf License file displayed during installation
ProcessCheck.dll 32-bit ProcessCheck DLL used by Setup
README.md Setup documentation
Syncthing.iss Inno Setup reads this file and builds Setup
Localization.ini Facilitates localization of the script files (see Localization)
Messages-en.isl Setup messages file (see Localization)

Prerequisites

Get the Files

Download the project from Github and extract it into folder of your choice (this folder will be referred to as the "build folder").

Run Get-Download.ps1 to download the latest Syncthing zip files.

Extract the Archives

From a PowerShell command line, run the Expand-Download.ps1 script in the build folder. The script uses 7-Zip to extract the Syncthing archive files into a folder structure appropriate for compiling Setup.

Compile the Setup Program

Use whatever method you prefer to compile Syncthing.iss using Inno Setup. The output filename will be syncthing-version-setup.exe (where version is the Syncthing version).

Localization

To add additional language support to Setup, do the following:

  1. Copy the Messages-en.isl file to Messages-lang.isl (where lang is the language code you want to use) and update the strings in the file.

  2. Update the strings in Messages-lang.isl for the language.

  3. Update the [Languages] section in the Syncthing.iss file.

  4. Copy each en-scriptname.js script to lang-scriptname.js (where lang is the language you want to add).

  5. Edit the messages at the top of each lang-scriptname.js script such that the messages are appropriate for the language.

    NOTE: If the messages do not display correctly when the scripts run, it may be an encoding problem. Try saving the scripts using UTF-16 LE (little endian) encoding.

  6. In the Localization.ini file, add a section for the language, and specify the source file names you want to use for the language.

  7. Increment the NumLanguages preprocessor directive in Syncthing.iss.

  8. Add a language preprocessor directive to Syncthing.iss, using the following syntax:

    #define protected Languages[index] "lang"

    (where index is the next-higher index value in the Languages preprocessor directive array)

For example, the following steps describe how to add localization for Dutch (language code nl):

  1. Copy Messages-en.isl to Messages-nl.isl.

  2. Update the strings in Messages-nl.isl to Dutch.

  3. Add Dutch to the [Languages] section in Syncthing.iss; e.g.:

    [Languages]
    Name: "en"; MessagesFile: "compiler:Default.isl,Messages-en.isl"
    Name: "nl"; MessagesFile: "compiler:Languages\Dutch.isl,Messaages-nl.isl"
    
  4. Copy the en-scriptname.js scripts to nl-scriptname.js files. PowerShell example:

     Get-ChildItem en-*.js | ForEach-Object { Copy-Item $_ ($_.Name -replace '^en-','nl-') }
    
  5. Update the messages at the top of each nl-scriptname.js script file to Dutch.

  6. Add a section in Localization.ini for the Dutch language code (nl) and add the corresponding script file names; e.g.:

     [nl]
     ScriptNameSetSyncthingConfig=nl-SetSyncthingConfig.js
     ScriptNameSyncthingFirewallRule=nl-SyncthingFirewallRule.js
     ScriptNameSyncthingLogonTask=nl-SyncthingLogonTask.js
    
  7. Increment the NumLanguages preprocessor directive in Syncthing.iss; e.g.:

     #define protected NumLanguages 2
    
  8. Also in Syncthing.iss, add Dutch to the Languages preprocessor directive array using the next higher index; e.g.:

     #define protected Languages[0] "en"
     #define protected Languages[1] "nl"