Silent Installer
Table of Contents:
Silent Installer
MirrorSync now has the option for silent installation (installation without user input). This is useful for those who wish to automate the installation process.
To start, download the installation package to your desired directory, unzip it, and run installer.jar
using the Java command from the context of this working directory: MirrorSync <VERSION>/Installer data
, with your desired arguments. Arguments are how the user or script can control the values that will be input during the silent installation. For Linux installations, you should use the LinuxInstaller.sh
script with these same arguments (see this section for example usage of LinuxInstaller.sh )
The only required parameters while running a silent installation are --password <password>
, the headlessinstall
flag, and the --silent
flag itself. Any other parameters that aren't supplied will default to a standard value.
Installation Parameters
Below are the available installation parameters and their effects:
- Silent Installation Mode
- Username
- Password (Required with
--silent
Flag) - Reporting Stats
- Hosting Context Name
- Sync Data Location (Linux Only)
- Hostname (Linux Only)
Parameter Details
Silent Installation Mode
- Flag:
--silent
- Behavior:
- Enables silent installation mode, preventing user interaction during installation.
- Usage:
- This flag does not take a value; it is sufficient to include it in the command.
- Default Value:
- N/A
- Example:
sudo java -jar installer.jar install --headlessinstall --silent --password "MySecurePassword"
Username
- Flag:
--username <string>
- Behavior:
- Sets the username for the MirrorSync installation, which will be used to log into the Config Client.
- Usage:
- Provide a string value for the username.
- Default Value:
admin
- Example:
sudo java -jar installer.jar install --headlessinstall --silent --username "adminUser" --password "MySecurePassword"
Password
- Flag:
--password <string>
- Behavior:
- Sets the password for the installation, which will be used to log into the Config Client. This parameter is required when using the
--silent
flag.
- Sets the password for the installation, which will be used to log into the Config Client. This parameter is required when using the
- Usage:
- Provide a string value for the password.
- Default Value:
- N/A - must be provided.
- Example:
sudo java -jar installer.jar install --headlessinstall --silent --password "SuperSecret123"
Reporting Stats
- Flag:
--reportingStats <boolean>
- Behavior:
- Allows MirrorSync to send diagnostic data.
- Usage:
- Accepted values:
true
,yes
,1
(to enable) orfalse
,no
,0
(to disable).
- Accepted values:
- Default Value:
true
- Example:
sudo java -jar installer.jar install --headlessinstall --silent --password "MySecurePassword" --reportingStats true
Hosting Context Name
- Flag:
--hostingContextName <string>
- Behavior:
- Sets the name of the MirrorSync application. This allows multiple MirrorSync instances to be deployed on the same machine.
- Usage:
- Provide a non-whitespace string as the application name.
- Default Value:
MirrorSync
- Example:
sudo java -jar installer.jar install --headlessinstall --silent --password "MySecurePassword" --hostingContextName "CustomMirrorSync"
You may see outdated documentation specifying that you need to specify a "hostinstall" parameter while using --hostingContextName. This is no longer relevant in current versions of MirrorSync, as of 6.7001+ using the --hostingContextName flag will be enough.
Sync Data Location (Linux Only)
- Flag:
--syncDataLocation <string>
- Behavior:
- Specifies the location where sync data will be stored on Linux systems.
- Usage:
- Provide a valid absolute file path.
- Default Value:
/var/lib/360works
- Example:
sudo java -jar installer.jar install --headlessinstall --silent --password "MySecurePassword" --syncDataLocation "/opt/MirrorSync/SyncData"
Hostname (Linux Only)
- Flag:
--serverHostName <string>
- Behavior:
- Specifies the hostname used by MirrorSync on Linux systems.
- Usage:
- Provide a string representing the server’s hostname (preferably) or IP address.
- Default Value:
- The server’s external IP address.
- Example:
sudo java -jar installer.jar install --headlessinstall --silent --password "MySecurePassword" --serverHostName "https://sync.example.com"
Example Silent Installer Scripts
Here are some example scripts to help you get started with automating the installation process, organized by platform. All these scripts will install the latest version of MirrorSync. These scripts will also remove the temp files these scripts created.
Note that these examples may need tweaks to work with your specific environment, and you should test your script in a safe environment before implementing it in a production environment.
Sample Windows PowerShell Silent Installation
Here's a sample Windows PowerShell script that will silently install MirrorSync with the username "Lee" and the password "Clementine":
cd ~
# download and unzip MirrorSync
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest "https://secure.360works.com/360Store/WebObjects/360Store.woa/wa/ProductDownload/mirrorsync?v=3" -OutFile "MirrorSync.zip"
mkdir -Force "tmpMirrorSyncDir"
Expand-Archive -Path MirrorSync.zip -DestinationPath tmpMirrorSyncDir -Force
cd "~/tmpMirrorSyncDir"
cd $( Get-ChildItem | Where-Object { $_.Name -like "360Works MirrorSync*" } ).FullName
cd "Installer data"
# install MirrorSync silently with the username Lee and password Clementine
java -jar installer.jar install headlessinstall --silent --username "Lee" --password "Clementine"
# cleanup
cd ~
Remove-Item MirrorSync.zip
Remove-Item -Recurse tmpMirrorSyncDir
Sample Linux Shell Script Silent Installation
Here's a sample Linux shell script that will silently install MirrorSync with the username "Gordon" and the password "Alyx". It's recommended that you put this script into a .sh file that will be run with sudo privileges.
USERNAME="Gordon"
PASSWORD="Alyx"
DOWNLOAD_URL="https://secure.360works.com/360Store/WebObjects/360Store.woa/wa/ProductDownload/mirrorsync"
cd ~
# install openjdk and tomcat
sudo apt update
sudo apt install openjdk-17-jre-headless tomcat9 tomcat9-admin -y
# download MirrorSync and navigate to the installation package directory
wget -O MirrorSync.zip "$DOWNLOAD_URL"
unzip MirrorSync.zip -d tmpMirrorSyncDir
cd "$(find ./tmpMirrorSyncDir -maxdepth 1 -type d -name "360Works MirrorSync*" -print -quit)"
# make the installer executable
sudo chmod +x LinuxInstaller.sh
# install MirrorSync silently with the specified username and password
sudo ./LinuxInstaller.sh --silent --username "$USERNAME" --password "$PASSWORD"
# cleanup
cd ~
sudo rm MirrorSync.zip
sudo rm -r tmpMirrorSyncDir
This script leverages the LinuxInstaller.sh
script that comes with the MirrorSync installation package; LinuxInstaller.sh
preps the Linux environment for the installation process. In prior versions its behavior was static, however with the 6.7 update it now accepts all installer parameters to allow the user or script to configure the installation, or will run as normal (i.e. not silently) if no parameters are passed to it.
Sample macOS Terminal Silent Installation
Here's a sample macOS Terminal script that will silently install MirrorSync with the username "Sonic" and the password "Tails". It's recommended that you put this script into a .sh file that will be run with sudo privileges.
cd ~
# download and unzip MirrorSync
curl -L -o MirrorSync.zip "https://secure.360works.com/360Store/WebObjects/360Store.woa/wa/ProductDownload/mirrorsync"
unzip MirrorSync.zip -d -o tmpMirrorSyncDir
cd ~/tmpMirrorSyncDir/
cd "$(find . -maxdepth 1 -type d -name "360Works MirrorSync*" -print -quit)/Installer data"
sudo chmod +x installer.jar
# install MirrorSync silently with the username Sonic and password Tails
sudo java -jar installer.jar install headlessinstall --silent --username "Sonic" --password "Tails"
# cleanup
cd ~
rm MirrorSync.zip
rm -r tmpMirrorSyncDir