This document explains the step by step process to create the exe file for offline desktop app for windows operating system
Pre-requisites
- Minimum windows version - Windows 7
- Minimum RAM required - 2GB(Should show warning if the RAM size is less than 2GB)
- Minimum disk space required for installation 400MB
- Minimum disk space required for running the app 10GB
Registry Variables
- ${APP_NAME}_APP_WORKING_DIR - which is used to add the installation location. Example: SUNBIRD_APP_WORKING_DIR="c:\\sunbird"
- ${APP_NAME}_DB_PORT - which is used to install couchdb default to 5984 if that port is not available then whatever is auto-selected port which is available used for couchdb installation. Example: SUNBIRD_DB_PORT=5984
- ${APP_NAME}_APP_PORT - default to 9000 if it is occupied whatever available. Example: SUNBIRD_APP_PORT=9000
Installation Flow
- Installation
- If the windows is pirated version show the warning message
- Request for the application directory to install. This should be defaulted to "C://Diksha/”? Add this path to the windows registry in the variable “DIKSHA_APP_WORKING_DIR"
- Couch DB installation
- Check if couch db is already installed.
- If “yes” - check the version. If version matches the installer version check if the service is running and start the service. If installed version doesn’t match the version to be installed, uninstall the older version
- if “no” then proceed with the installation
- Before installation check if port 5984 is under use. If under use switch to another port
- Update the port in to the windows registry in the variable “DIKSHA_DB_PORT"
- Silent install couch DB on the given port.
- The couch db configuration should be updated to use the <application-dir>/data as the db path
- Restart service
- Electron app installation
- Uninstall app if the older version exists
- check port 9000 is available if not available get the available port for app
- Update the port in to the windows registry in the variable “DIKSHA_APP_PORT"
- Install the latest app
- Add the app to all windows shortcuts
- Launch the app
Note: Any errors during installation should written to a log file that can be transferred to the server
- Uninstall
- Uninstall link to the desktop app should be available under the installed programs context menu
- Uninstall should uninstall both couch db and electron app
- Data directory to be cleaned up.
- Windows registry variables should be removed
References:
- http://couchdb.apache.org/ - for couchdb installation
- https://www.npmjs.com/package/node-machine-id - to get the device id
Minimum windows version - Windows 7