From a409778fa646b1ade2c104f2643ead00d7dc0cfa Mon Sep 17 00:00:00 2001 From: PaulaBras <68814660+PaulaBras@users.noreply.github.com> Date: Sun, 2 Oct 2022 21:35:42 +0200 Subject: [PATCH] kaputt --- updater/src/copy/copy.js | 9 --------- updater/src/download/downloader.js | 21 --------------------- updater/src/index.html | 20 +++++++++++--------- updater/src/index.js | 25 ++++++++++++++++++------- updater/src/preload.js | 12 +++++++++--- updater/src/renderer.js | 13 ++++++++++++- updater/src/unzip/unzip.js | 28 ---------------------------- 7 files changed, 50 insertions(+), 78 deletions(-) delete mode 100644 updater/src/copy/copy.js delete mode 100644 updater/src/download/downloader.js delete mode 100644 updater/src/unzip/unzip.js diff --git a/updater/src/copy/copy.js b/updater/src/copy/copy.js deleted file mode 100644 index b1b4d2c..0000000 --- a/updater/src/copy/copy.js +++ /dev/null @@ -1,9 +0,0 @@ -app.on('copy-me', () => { - const fs = require('fs'); - - // File destination.txt will be created or overwritten by default. - fs.copyFile('source.txt', 'destination.txt', (err) => { - if (err) throw err; - console.log('source.txt was copied to destination.txt'); - }); -}); \ No newline at end of file diff --git a/updater/src/download/downloader.js b/updater/src/download/downloader.js deleted file mode 100644 index 214246a..0000000 --- a/updater/src/download/downloader.js +++ /dev/null @@ -1,21 +0,0 @@ -const { app, BrowserWindow, ipcMain } = require("electron"); -const { download } = require("electron-dl"); -let window; -app.on("ready", () => { - window = new BrowserWindow({ - width: someWidth, - height: someHeight - }); - window.loadURL(`file://${__dirname}/index.html`); - ipcMain.on("download", (event, info) => { - download(BrowserWindow.getFocusedWindow(), info.url, info.properties) - .then(dl => window.webContents.send("download complete", dl.getSavePath())); - }); -}); - - -ipcMain.on("download", (event, info) => { - info.properties.onProgress = status => window.webContents.send("download progress", status); - download(BrowserWindow.getFocusedWindow(), info.url, info.properties) - .then(dl => window.webContents.send("download complete", dl.getSavePath())); -}); \ No newline at end of file diff --git a/updater/src/index.html b/updater/src/index.html index ab81bd2..acb18e5 100644 --- a/updater/src/index.html +++ b/updater/src/index.html @@ -3,22 +3,21 @@