Skip to content

Commit

Permalink
Updates for windows and mac builds
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanp committed Jun 13, 2020
1 parent 53bd6af commit fa54efc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const electron = require("electron");
// Module to control application life.
const app = electron.app;
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow;
// app control, application life.BrowserWindow creates native browser window.
const { app, BrowserWindow } = require("electron");

//Store Window size and position
const windowStateKeeper = require("electron-window-state");

Expand All @@ -13,7 +12,7 @@ const settings = require("electron-settings");

// 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 mainWindow;
let mainWindow = null;

function createWindow() {
// Load the previous state with fallback to defaults
Expand All @@ -22,10 +21,7 @@ function createWindow() {
defaultHeight: 240,
});
// Create the browser window.
mainWindow = new electron.BrowserWindow({
webPreferences: {
nodeIntegration: true,
},
mainWindow = new BrowserWindow({
title: app.getName(),
alwaysOnTop: false,
//show: false,
Expand All @@ -42,7 +38,10 @@ function createWindow() {
titleBarStyle: "customButtonsOnHover",
autoHideMenuBar: true,
transparent: true,
icon: "images/icon.png",
icon: path.join(__dirname, "images/icon.png"),
webPreferences: {
nodeIntegration: true,
},
});

// Let us register listeners on the window, so we can update the state
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"start": "electron .",
"build": "node build.js",
"package-mac": "electron-packager . --overwrite --platform=darwin --arch=x64 --icon=images/icon.icns --prune=true --out=release-builds",
"package-win": "electron-packager . --overwrite --asar=true --platform=win32 --arch=ia32 --icon=images/icon_win.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"Crypto Price Widget\"",
"package-win": "electron-packager . --overwrite --platform=win32 --arch=x64 --icon=images/icon_win.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"Crypto Price Widget\"",
"package-linux": "electron-packager . --overwrite --platform=linux --arch=x64 --icon=images/icon.png --prune=true --out=release-builds"
},
"repository": "https://github.com/nathanp/crypto-price-widget",
Expand Down

0 comments on commit fa54efc

Please sign in to comment.