Skip to content

Packaging and Distribution

Gabriel Delavald edited this page Aug 2, 2017 · 2 revisions

Making a release

To package your app into an installer use command:

yarn release

It will start the packaging process for operating system you are running this command on. Ready for distribution file will be outputted to dist directory.

Right now you can only create Windows installer when running Windows, the same is true for macOS. For Linux builds, you can use our Docker image with the following commands:

docker run --rm -ti -v ${PWD}:/project -v ${PWD##*/}-node-modules:/project/node_modules -v ~/.electron:/root/.electron rocketchat/electron.builder /bin/bash -l -c "yarn && yarn release -- --x64 --ia32 --p never"

All packaging actions are handled by electron-builder. It has a lot of customization options, which you can declare under "build" key in package.json file.

Default servers

The servers.json file will define what servers the client will connect to and will populate the server list in the sidebar, it contains a list of default servers which will be added the first time the user runs the app (or when all servers are removed from the list). The file syntax is as follows:

{
  "Demo Rocket Chat": "https://demo.rocket.chat",
  "Open Rocket Chat": "https://open.rocket.chat"
}

Pre-Release Configuration

You can bundle a servers.json with the install package, the file should be located in the root of the project application (same level as the package.json). If the file is found, the initial "Connect to server" screen will be skipped and it will attempt to connect to the first server in the array that has been defined and drop the user right at the login screen. Note that the servers.json will only be checked if no other servers have already be added, even if you uninstall the app without removing older preferences, it will not be triggered again.

Post-Install Configuration

If you can't (or don't want to) bundle the file inside the app, you can create a servers.json in the user preferences folder which will overwrite the packaged one. The file should be located in the %APPDATA%/Rocket.Chat+/ folder or the installation folder in case of a installation for all users (Windows only).

For Windows the full paths are:

\Users\<username>\AppData\Roaming\Rocket.Chat+\
\Program Files\Rocket.Chat+\Resources\

On MacOS the full path is:

/Users/<username>/Library/Application Support/Rocket.Chat+/
/Applications/Rocket.Chat+.app/Contents/Resources/

On Linux the full path is:

/home/<username>/.config/Rocket.Chat+/
/opt/Rocket.Chat+/resources/