Skip to content

Commit

Permalink
exe generator
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-sapletta-com committed Feb 7, 2020
1 parent 817cdae commit 22014fd
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 20 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ https://github.com/electron/simple-samples/blob/master/prices/package.json

npm i -g electron-builder

remove files

rm dist

generate

npm run dist


Expand Down
Binary file removed bin/app
Binary file not shown.
Empty file removed bin/app.exe
Empty file.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,14 @@
"asar": true,
"extends": null,
"files": [
"users.js",
"config.js",
"promagen.js",
"routes/**/*",
"views/**/*",
"build/**/*",
"node_modules/**/*",
"public/**/*",
"view/**/*",
"src/**/*",
"public/images/promagen32.png"
],
Expand Down
23 changes: 8 additions & 15 deletions promagen.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ function startExpress() {
}

function createWindow() {
var icon_file = path.join(__dirname, "/public/images/promagen32.png");
console.log('icon_file:', icon_file);
// Create the browser window.
const mainWindow = new BrowserWindow({
autoHideMenuBar: true,
Expand All @@ -36,28 +38,19 @@ function createWindow() {
// nodeIntegration: true
// preload: path.join(__dirname, 'public/electron/preload.js')
// }
icon: path.join(__dirname, "./public/images/promagen32.png")
icon: icon_file
});

// log.info(mainWindow);

var localurl = 'http://localhost:' + localConfig.port + '/';
// var localurl = 'http://localhost:' + localConfig.port + '/electron/index.html';
// var localurl = url.format({
// // pathname: 'localhost:' + localConfig.port + '/electron/index.html',
// pathname: 'localhost:' + localConfig.port + '',
// protocol: 'http:',
// slashes: true
// });
console.log(localurl);
// var localurl = 'http://localhost:' + localConfig.port + '/';
// console.log(localurl);
// mainWindow.loadURL(localurl);

var localfile = './public/electron/index.html';
// localfile = path.join(__dirname, localfile);
console.log(localfile);

// mainWindow.loadURL(localurl);
mainWindow.loadFile(localfile);

mainWindow.webContents.openDevTools();

}


Expand Down
3 changes: 2 additions & 1 deletion src/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ module.exports = function () {

// render the error page
res.status(err.status || 500);
res.render('error');
var title = err.status;
res.render('error', {title: title});
});

web.listen(localConfig.port);
Expand Down
6 changes: 3 additions & 3 deletions views/error.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extends layout

block content
h1= message
h2= error.status
pre #{error.stack}
h1= title
//h2= error.status
//pre #{error.stack}

0 comments on commit 22014fd

Please sign in to comment.