This repository has been archived by the owner on Jul 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from LINCnil/develop
Develop
- Loading branch information
Showing
28 changed files
with
2,109 additions
and
16 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
node_modules | ||
release-builds | ||
dist | ||
node_modules/ | ||
dist/ | ||
releases/ | ||
private/ | ||
*.log |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,19 +1,50 @@ | ||
{ | ||
"name": "PIA", | ||
"version": "0.0.5", | ||
"version": "1.5.0", | ||
"description": "Version Portable Outil PIA", | ||
"main": "main.js", | ||
"scripts": { | ||
"start": "./node_modules/.bin/electron .", | ||
"package-mac": "electron-packager . --electron-version=1.7.9 --overwrite --prune=true --asar=true --platform=darwin --arch=x64 --icon=icons/mac/icon.icns --out=release-builds", | ||
"package-win32": "electron-packager . --electron-version=1.7.9 --overwrite --prune=true --asar=true --platform=win32 --arch=ia32 --icon=icons/win/icon.ico --out=release-builds", | ||
"package-win": "electron-packager . --electron-version=1.7.9 --overwrite --prune=true --asar=true --platform=win32 --arch=x64 --icon=icons/win/icon.ico --out=release-builds", | ||
"package-linux": "electron-packager . --electron-version=1.7.9 --overwrite --prune=true --asar=true --platform=linux --arch=x64 --out=release-builds" | ||
"start": "electron .", | ||
"mac": "electron-builder -m", | ||
"win": "electron-builder -w --x64 --ia32", | ||
"linux": "electron-builder -l", | ||
"win-cert": "electron-builder create-self-signed-cert -p atnos", | ||
"publish-to-github": "electron-builder build -mwl --x64 --ia32 -p onTagOrDraft" | ||
}, | ||
"author": "ATNOS", | ||
"repository": "https://github.com/LINCnil/pia-app", | ||
"keywords": [ | ||
"Electron", | ||
"PIA" | ||
], | ||
"author": "ATNOS" | ||
"build": { | ||
"appId": "com.atnos.pia", | ||
"directories": { | ||
"buildResources": ".", | ||
"output": "releases" | ||
}, | ||
"mac": { | ||
"publish": ["github"], | ||
"category": "public.app.category.productivity" | ||
}, | ||
"win": { | ||
"publish": ["github"], | ||
"certificateFile": "private/atnos.pfx", | ||
"verifyUpdateCodeSignature": false, | ||
"publisherName": "ATNOS" | ||
}, | ||
"linux": { | ||
"publish": ["github"], | ||
"category": "Network" | ||
} | ||
}, | ||
"devDependencies": { | ||
"electron": "~1.7.10", | ||
"electron-builder": "^19.54.0" | ||
}, | ||
"dependencies": { | ||
"electron-window-state": "^4.1.1", | ||
"electron-log": "^2.2.14", | ||
"electron-updater": "^2.19.1" | ||
} | ||
} |
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,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Downloading PIA Update</title> | ||
</head> | ||
<body> | ||
<progress style="width:100%;" value="0" max="100"></progress> | ||
<script> | ||
const {ipcRenderer} = require('electron') | ||
setInterval(() => { | ||
let progress = ipcRenderer.sendSync('download-progress-request') | ||
document.querySelector('progress').value = progress | ||
}, 1000) | ||
</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,72 @@ | ||
const {dialog, BrowserWindow, ipcMain} = require('electron') | ||
const {autoUpdater} = require('electron-updater') | ||
|
||
const path = require('path') | ||
const url = require('url') | ||
|
||
autoUpdater.logger = require('electron-log') | ||
autoUpdater.logger.transports.file.level = 'info' | ||
|
||
autoUpdater.autoDownload = false | ||
|
||
exports.check = () => { | ||
autoUpdater.checkForUpdates() | ||
|
||
autoUpdater.on('update-available', () => { | ||
|
||
let downloadProgress = 0 | ||
|
||
dialog.showMessageBox({ | ||
type: 'info', | ||
title: 'Update Available', | ||
message: 'A new version of PIA is available. Do you want to update now?', | ||
buttons: ['Update', 'No'] | ||
}, (buttonIndex) => { | ||
if(buttonIndex !== 0) return | ||
|
||
autoUpdater.downloadUpdate() | ||
|
||
let progressWin = new BrowserWindow({ | ||
width: 350, | ||
height: 35, | ||
useContentSize: true, | ||
autoHideMenuBar: true, | ||
maximizable: false, | ||
fullscreen: false, | ||
fullscreenable: false, | ||
resizable: false | ||
}) | ||
|
||
progressWin.loadURL(url.format({ | ||
pathname: path.join(__dirname, 'renderer', 'progress.html'), | ||
protocol: 'file:', | ||
slashes: true | ||
})) | ||
|
||
progressWin.on('closed', () => { | ||
progressWin = null | ||
}) | ||
|
||
ipcMain.on('download-progress-request', (e) => { | ||
e.returnValue = downloadProgress | ||
}) | ||
|
||
autoUpdater.on('download-progress', (d) => { | ||
console.log(d.percent); | ||
downloadProgress = d.percent | ||
}) | ||
|
||
autoUpdater.on('update-downloaded', () => { | ||
if (progressWin) progressWin.close() | ||
dialog.showMessageBox({ | ||
type: 'info', | ||
title: 'Update ready', | ||
message: 'A new version of PIA is ready. Quit and install now?', | ||
buttons: ['Yes', 'Later'] | ||
}, (buttonIndex) => { | ||
if (buttonIndex === 0) autoUpdater.quitAndInstall() | ||
}) | ||
}) | ||
}) | ||
}) | ||
} |
Oops, something went wrong.