This article outlines how to install, remove and run Resilio Sync silently so that there is no (or minimal) user interaction necessary or possible during the installation process, and while invoking and running the application. It also discusses the situations where silent installation and/or running is not possible. The platforms discussed in this document include Windows, Mac and Linux.
SILENT INSTALLATION AND REMOVAL
The process of preparing and executing a silent install varies by platform. This process is the easiest on the Macintosh, a little more complicated on Linux, and a lot more challenging on Windows.
Installation Steps Common to All Platforms
On any platform, the users performing the installation process may need to modify rules for the resident firewall to permit Sync to accept incoming (and possibly create outgoing) network connections; the description of how to do this is (mostly) outside of the scope of this document.
The Sync executable file isn't an MSI (Windows Installer) file, but uses the same installation system as does uTorrent and BitTorrent clients. For an installation that is as silent as possible, run the following command from a NT command-line terminal:
User Account Control on Windows will display a confirmation dialog asking if the user will allow changes to system configuration as part of the installation process.
Handling the User Account Control Dialog
If the user accepts the changes, Sync is installed, including icons, Program Files files, startup menu items, Windows Explorer context menu items, and registry entries. However, the Sync program does not run at the end of installation; the program must be started separately after the installation process completes.
If the user chooses to reject the changes, the installation process proceeds as though the command did not request a silent install: the Windows firewall dialog is presented, and the Sync web UI appears as part of running the program. To make this process not require user interaction, it may be necessary to run the installation process from an account that already has active administrative privileges.
Configuring Windows Firewall
By default, the Windows Firewall dialog shows that Sync will be able to accept incoming connections on private networks, and will not be able to accept incoming connections on public networks. If it is necessary to make changes in Windows Firewall to allow incoming connections on public networks, modify firewall rules using calls to the netsh command-line tool using the advfirewall command.
Full Silent removal of Sync is not possible on Windows, therefore some steps will have to be performed manually:
- Run ResilioSync.exe /UNINSTALL /S /REMSETTINGS - this will delete the ResilioSync.exe file.
- Open Control Panel => Programs and features => locate Resilio Sync => click Uninstall.
- Delete the Program Files/ResilioSync directory along with the DLLs which are loaded by the File Manager to support the context menu.
- Delete Sync-related registry entries in HKEY_LOCAL_MACHINE/Software and HKEY_CURRENT_USER/Software
If you have previously presented the File Manager context menu that presents the Sync context menu item, you may need to reboot the affected computer before removing the DLLs, because the File Manager doesn't unload the DLLs as part of the uninstallation process.
An administrator can install Sync on a Macintosh using the command line by executing the following commands:
- hdiutil attach ResilioSync.dmg
- sudo cp -R “/Volumes/Resilio Sync/Resilio Sync.app” /Applications
- hdiutil detach “/Volumes/Resilio Sync/”
Perform uninstallation by deleting the application folder created in step 2 of the silent installation procedure. This may fail, with a message including "because some of its plugins [were] in use", if the shared library is loaded by the Mac file manager for Sync's context menu entry.
The Linux installation file is a gzipped tar archive containing three files:
- rslsync (executable binary)
The README file contains instructions on how to run btsync. Silent installation is easy as long as the installation process has the privileges necessary to place the files in the desired locations; this can be enabled by using sudo to run the installation process as root.
The person setting up the installation will need to:
- choose a location for the btsync executable
- choose a writable directory in the file system that will be used for storing settings files and a pid (process ID) file
- choose a read-only directory in which to place the sync.conf configuration file
- create a configuration file
- create scripts associated with automatic application control (init scripts)
In order to create the btsync.conf configuration file:
- generate a sample configuration file by running btsync --dump-sample-config
- if you will be using the developer API temporarily while configuring the installation, include it in the webui.api_key entry
- disable the use_gui setting by setting a value of false
- disable the webui.listen setting by entering an empty string or no string
- set the value of the storage_path setting with the planned location of the writable directory used to store settings files
Any automatic application control scripts must be set up to run btsync with the --config argument containing the path to the installed sync.conf file.
The installation process will need to:
- copy btsync to the desired location
- copy application control scripts to their location
- create a writable directory for settings files and a pid file
- copy configuration file to desired location
- ensure the directory containing the btsync executable binary is referenced by the PATH environment variable, if you plan to depend on PATH for that purpose
Uninstallation is relatively easy, and can be easily scripted.
- remove whatever automatic application loading was set up
- remove btsync executable
- remove the btsync.conf configuration file
- remove settings directory and contents
- revert any PATH or other environment variables that reference btsync
PREPARATION FOR SILENT RUNNING OF SYNC
In order to access the API in your Sync installation without using Sync's graphical user interface, follow the instructions in the API documentation, within a section called Setting up API Post-Installation.
SILENT RUNNING OF SYNC
Setting up the configuration file with the following settings supports silent running of Sync:
- disabling the use_gui setting
- disabling the webui.listen setting
This set up will disable the HTTP server that Sync can run, especially typical on the Linux platform. However, after disabling the HTTP server, it won't be nearly as easy to configure the Sync installation (e.g., transferring a master folder secret, adding folders). So, before setting up for silent running, it would be better to take the following steps:
- disable the GUI and enable the HTTP server in the configuration file
- start the Sync process
- use the HTTP API to configure the installation (transfer master folder secret, add folders)
- stop the Sync process
- disable the HTTP server in the configuration file
- restart the Sync process
Sync should now be running silently. If you need to update Sync's configuration later, you will need to re-enable the HTTP server prior to updating the configuration and disable the HTTP server after updating the configuration.