forked from megahertz/electron-simple-updater
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Draft version, initialize an example
- Loading branch information
Showing
10 changed files
with
222 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Simple Updater Example | ||
|
||
This example uses | ||
[electron-builder](https://github.com/electron-userland/electron-builder) | ||
for building installer and update package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Example of using electron-simple-updater</title> | ||
<link | ||
rel="stylesheet" | ||
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | ||
</head> | ||
<body> | ||
|
||
<table class="table table-hover"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Value</th> | ||
</tr> | ||
</thead> | ||
<tbody id="rows"></tbody> | ||
</table> | ||
|
||
<script> | ||
const { remote } = require('electron'); | ||
const { app } = remote; | ||
|
||
renderData([ | ||
['Command line', JSON.stringify(remote.process.argv, null, ' ')], | ||
['Executable', app.getPath('exe')], | ||
['App Path', app.getAppPath()], | ||
['App data path', app.getPath('appData')], | ||
['User data path', app.getPath('userData')], | ||
['Resource path', remote.process.resourcesPath], | ||
['App version', app.getVersion()], | ||
]); | ||
|
||
|
||
function renderData(data) { | ||
const tableBody = document.getElementById('rows'); | ||
data | ||
.map(([name, value]) => { | ||
const tr = document.createElement('tr'); | ||
|
||
const td1 = document.createElement('td'); | ||
td1.appendChild(document.createTextNode(name)); | ||
|
||
const td2 = document.createElement('td'); | ||
td2.appendChild(document.createTextNode(value)); | ||
|
||
tr.appendChild(td1); | ||
tr.appendChild(td2); | ||
|
||
return tr; | ||
}) | ||
.forEach((node) => { | ||
tableBody.appendChild(node); | ||
}); | ||
} | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
|
||
const {app, BrowserWindow} = require('electron'); | ||
|
||
let mainWindow; | ||
|
||
app.on('ready', () => { | ||
mainWindow = new BrowserWindow({ | ||
height: 600, | ||
width: 800 | ||
}); | ||
|
||
mainWindow.loadURL('file://' + __dirname + '/index.html'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "simple-updater-example", | ||
"productName": "Simple Updater Example", | ||
"version": "0.0.1", | ||
"description": "Example of using electron-simple-updater", | ||
"main": "main.js", | ||
"author": "Alexey Prokhorov", | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=6.0" | ||
}, | ||
"dependencies": { | ||
"electron-simple-updater": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "electron-simple-updater-example", | ||
"description": "Example of using electron-simple-updater", | ||
"main": "app/main.js", | ||
"scripts": { | ||
"postinstall": "install-app-deps", | ||
"start": "node_modules/.bin/electron ./app", | ||
"dist": "build" | ||
}, | ||
"author": "Alexey Prokhorov", | ||
"license": "MIT", | ||
"private": true, | ||
"build": { | ||
"appId": "megahertz.electron-simple-updater-example", | ||
"mac": { | ||
"category": "public.app-category.developer-tools" | ||
} | ||
}, | ||
"engines": { | ||
"node": ">=6.0" | ||
}, | ||
"devDependencies": { | ||
"electron": "*", | ||
"electron-builder": "7.8.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
module.exports.install = install; | ||
|
||
function install(meta) { | ||
console.log('Try installing under linux'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters