Commit 3331e825 authored by Anusha Mamidala's avatar Anusha Mamidala
Browse files

Added desktop packaging scripts for all the platforms

parent f4b52792
......@@ -44,3 +44,6 @@ testem.log
# System Files
.DS_Store
Thumbs.db
# Packages
/packages
\ No newline at end of file
......@@ -23,13 +23,8 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"assets": ["src/favicon.ico", "src/assets", "src/electron.prod.js"],
"styles": ["src/styles.scss"],
"scripts": []
},
"configurations": {
......@@ -86,13 +81,8 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": []
}
},
......@@ -104,9 +94,7 @@
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
......
This diff is collapsed.
{
"name": "bala-swecha",
"version": "0.0.0",
"version": "1.0.0",
"description": "Balaswecha",
"main": "electron.prod.js",
"scripts": {
"ng": "ng",
"start": "ng serve",
"web": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"electron": "electron ./src/electron.dev",
"desktop": "concurrently \"ng serve\" \"npm run electron\""
"start": "concurrently \"ng serve\" \"npm run electron\"",
"package:win": "npm run build && cross-var electron-packager dist $npm_package_name-$npm_package_version --out=packages --platform=win32 --arch=all --overwrite ",
"package:linux": "npm run build && cross-var electron-packager dist $npm_package_name-$npm_package_version --out=packages --platform=linux --arch=all --overwrite ",
"package:osx": "npm run build && cross-var electron-packager dist $npm_package_name-$npm_package_version --out=packages --platform=darwin --arch=all --overwrite ",
"package:all": "npm run build && cross-var electron-packager dist $npm_package_name-$npm_package_version --out=packages --all --arch=all --overwrite "
},
"private": true,
"dependencies": {
......@@ -34,7 +40,9 @@
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"concurrently": "^6.0.0",
"cross-var": "^1.1.0",
"electron": "^12.0.1",
"electron-packager": "^15.2.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.1.0",
......
const { app, BrowserWindow } = require('electron')
const path = require('path')
const url = require('url')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let win
const createWindow = () => {
// Create the browser window.
win = new BrowserWindow({
width: 800,
height: 600,
icon: path.join(__dirname, 'favicon.ico')
})
// and load the index.html of the app.
win.loadURL(
url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true
})
)
// Emitted when the window is closed.
win.on('closed', () => {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
win = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', () => {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (win === null) {
createWindow()
}
})
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>BalaSwecha</title>
<base href="/">
<base href="./">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="./assets/css/bootstrap.min.css">
<link rel="stylesheet" href="./assets/css/magnific-popup.css">
<link rel="stylesheet" href="./assets/css/style.css">
</head>
<body>
<app-root></app-root>
<script src="./assets/js/jquery-1.12.1.min.js"></script>
......@@ -18,4 +20,5 @@
<script src="./assets/js/jquery.nice-select.min.js"></script>
<script src="./assets/js/custom.js"></script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment