2018-06-05 06:02:51 -05:00
## Prerequisites
### Windows
2020-08-04 23:00:18 -05:00
- NodeJS version >= 12.x.y (corresponds to electron 9.x.y)
2018-06-05 06:02:51 -05:00
- Microsoft Visual Studio 2015 Community or Paid (C++ and .NET/C# development tools)
- Python >= 2.7.1
- Dot Net 3.5 SP1
- [Advanced Installer ](https://www.advancedinstaller.com/ )
#### Notes
- C++ tools are required to recompile node modules
- Dot NET/C# tools required to compile screen-snippet module
- Open 'Developer Command Prompt for VS2015'. This sets paths to visual studio build tools
- Advanced installer is required to create msi installer
### Mac
- Xcode command line tools. Or better, XCode latest version
2020-08-04 23:00:18 -05:00
- NodeJS version >= 12.x.y (corresponds to electron 9.x.y)
2018-06-05 06:02:51 -05:00
- [Sudre Packages ](http://s.sudre.free.fr/Software/Packages/about.html )
#### Notes
- Ensure you have accepted the XCode license agreement
- Sudre packages is used to create a .pkg installer file
## Run demo:
- npm install
2020-03-18 00:45:00 -05:00
- npm run demo (runs platform specific commands)
2018-06-05 06:02:51 -05:00
2020-08-04 23:00:18 -05:00
*Note*:
- Remember to set this.origin to '*' in `app-bridge.ts` when running the demo.
- Search for // DEMO-APP: and comment that line back in.
- Make sure to comment it out again before you commit.
2019-11-18 00:35:17 -06:00
2018-06-05 06:02:51 -05:00
## Build Instructions:
2020-08-04 23:00:18 -05:00
### Mac 🖥
2018-06-05 06:02:51 -05:00
- npm install
- npm run dev (to run locally)
2020-08-04 23:00:18 -05:00
- To build the macOS app:
2018-06-05 06:02:51 -05:00
* npm run unpacked-mac
* The distributable is created in the `dist/mac` directory
- to build mac package (installer):
2019-01-25 00:50:26 -06:00
* npm run packed-mac
2018-06-05 06:02:51 -05:00
* The .pkg file will be generated in the `installer/mac/build` directory
2020-08-04 23:00:18 -05:00
### Windows 💻
2018-06-05 06:02:51 -05:00
- npm install
- npm run dev (to run locally)
- To build windows unpacked exe:
* npm run unpacked-win
* The distributable is created in the `dist/win-unpacked` directory
- To build windows 32 bit unpacked exe (installer):
* npm run unpacked-win-x86
* The distributable is created in the `dist/win-ia32-unpacked` directory
- To create msi (installer):
* Run the advanced installer script located in `installer/win` directory
2020-01-29 03:13:29 -06:00
2018-06-05 06:02:51 -05:00
#### MSI command line options:
- To install for all users (admin required): msiexec.exe /i Symphony-x64.msi ALLUSERS=1
- To install per user: msiexec.exe /i Symphony-x64.msi ALLUSERS=""
- To change default pod url: msiexe.exe /i Symphony-x64.msi POD_URL=my.symphony.com
- To change auto start: msiexe.exe /i Symphony-x64.msi AUTO_LAUNCH=true (or false) - if not specified default it true.
- To change minimize on close: msiexe.exe /i Symphony-x64.msi MINIMIZE_ON_CLOSE=true (or false) - if not specified default is true.
- Any of the above options can be chained together, for example: msiexe.exe /i Symphony-x64.msi MINIMIZE_ON_CLOSE=true AUTO_START=false POD_URL=my.symphony.com
- The available values for various settings in the installer is listed below
* POD_URL (String)
* ALWAYS_ON_TOP (Boolean)
* AUTO_LAUNCH (Boolean)
* MINIMIZE_ON_CLOSE (Boolean)
* BRING_TO_FRONT (Boolean)
* MEDIA (Boolean)
* LOCATION (Boolean)
* NOTIFICATIONS (Boolean)
* MIDI_SYSEX (Boolean)
* FULL_SCREEN (Boolean)
* POINTER_LOCK (Boolean)
* OPEN_EXTERNAL (Boolean)
2020-08-04 23:00:18 -05:00
### Linux 🐳
- Download and install Docker daemon [here ](https://www.docker.com/products/docker-desktop )
- Run the below docker commands under the project directory
- To generate and tag the container
`docker build -t linux:6.0.0 --build-arg REPO=https://github.com/symphonyoss/SymphonyElectron --build-arg BRANCH=linux .`
- To make sure the image is created and tagged correctly
`docker images`
- To run the docker image and generate the linux builds 🎉
`docker run --name linux linux:6.0.0`
- To copy the builds
`docker cp linux:/SymphonyElectron/dist/symphony-6.1.0.x86_64.rpm ~/Desktop`
`docker cp linux:/SymphonyElectron/dist/symphony_6.1.0_amd64.deb ~/Desktop`
##### Other useful docker commands
- To connect to the interactive bash
`docker run -i -t linux:6.0.0 /bin/bash`
- To delete all stopper containers
`docker system prune -a`
- To delete the container/image
`docker rmi -f linux:6.0.0`
## Change POD URL
2018-06-05 06:02:51 -05:00
- To change the start url (i.e., pod url), edit config/Symphony.config and change 'url' variable. if no protocol provided, then https will be added.
- The installer will include file config/Symphony.config next to executable. Changes in this file will effect all users.
2020-03-18 00:45:00 -05:00
## Tests
- Use `npm test` to run all the tests
### Unit tests and Code Coverage
2018-06-05 06:02:51 -05:00
- [Jest framework ](http://facebook.github.io/jest/ ) is used to run tests
2020-03-18 00:45:00 -05:00
- Use `npm run test:unit` to run unit tests
2020-08-04 23:00:18 -05:00
- Code coverage reports are captured under [coverage ](../../out/coverage )
- To check the test run report, see the [out ](../../out ) directory
2018-06-05 06:02:51 -05:00
- See the [tests ](./tests ) directory to find all the unit tests
2020-03-18 00:45:00 -05:00
### Spectron Tests
- [AVA ](https://github.com/avajs/ava ) is used to run Spectron tests
- Use `npm run test:spectron` to run spectron tests
- To compile spectron tests `npm run compile:spec`
- To run specific test use example: `npm run test:spectron -- --match=spell*` runs only spellchecker related tests
- Spectron - Application logs can be found in `~/Library/Logs/Electron/`
2018-06-05 06:02:51 -05:00
## Logging
- Local logging is enabled for dev environments using the module [electron-log ](https://www.npmjs.com/package/electron-log )
2020-08-04 23:00:18 -05:00
- On macOS, the logs are stored under `~/Library/Logs/Electron/app_<timestamp>.log`
- On Windows, the logs are stored under `%USERPROFILE%\AppData\Roaming\Electron\app_<timestamp>.log`
- On Linux, the logs are stored under `~/.config/Electron/logs/app_<timestamp>.log`
2018-06-05 06:02:51 -05:00
## Misc notes
2020-08-04 23:00:18 -05:00
- If you need to run against a POD without proper cert use cmd line option: --ignore-certificate-errors
2018-06-05 06:02:51 -05:00
- To start additional instance with custom data directory (if you want seperate user) use cmd line options: --multiInstance --userDataPath=`< path to data dir > `
2018-07-19 08:15:16 -05:00
- If directory doesn't exist, it will be created