From 0d481b31ab066f0dad201537d7cfc9bfd0942e17 Mon Sep 17 00:00:00 2001 From: Rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Thu, 16 May 2024 21:16:02 +0800 Subject: [PATCH] feat: support to choose install dir on win (#436) * feat: support to choose install dir on win * force to update the draft release --------- Co-authored-by: rick --- console/atest-desktop/api-testing.ico | Bin 0 -> 3494 bytes console/atest-desktop/forge.config.js | 28 ++++++++++++++++++++------ console/atest-desktop/main.js | 9 +++++---- 3 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 console/atest-desktop/api-testing.ico diff --git a/console/atest-desktop/api-testing.ico b/console/atest-desktop/api-testing.ico new file mode 100644 index 0000000000000000000000000000000000000000..5036269de88057b3b036a7546c20dab37f302be9 GIT binary patch literal 3494 zcmeHK?N6Ik6t91PU;UtoK~0RBxJ4wAEIP6+bBmeNIWsZYK(ma9A0&Q&gg3)Wcu9DV zCRpAnOB@0VFrXA@3#EnfCMr;%g@PT>(ifnBg%;?~=bYssybOa|O!k4(+Xmp z&bhzm=BY&TobU^HQ9`{W|9Oez1&KuRhR_0p79=!UXA$;ZJN2kNT98QajLOc=4z{%QSiW-duBO@ccM9*3M`dLthKGldk&(gk zl9CcEFE6v6N~Oa1_&7hewY4EOHWnt63G_TSH^=ej$at%Zq@k3lEuYER99CcGBT3Sys@#7>qO^&@7_I*U8mD=JsKJsKy~Wt>tmaUhzKMm zCW34z#_;fPSglq*;h(F#qbL?5Swph8M+&nF_D|bcnbo)>fAf<%s+fAJ}u7GS3~__FuX43 zkvfmtn8;7(+y)}PME{*o^hboE_tqz9Kl3J*ejj8L!dHfzhTAX#ifzZcdC1kn`@abI z?_txvcxdn676_v)_;naEe}Lsz87$Q@Xs=&HZ}>HAZ+O_$D%4m0_Dj%Q4H4>c3Hq-; z$4pf*w$|5oT|X&4Vd%fQ4wJNieG$hrpPqxcQo8GVp{)rWXWqj6gE~00YM3j2hU!8P zpO0VoZXkJ5e6lrHNTCb;2-}{&VeM#v>HsIj^WU(}lRC@H-4fOlIq@|3YttsEF9pNV zqro3>-(e`~Hgi$L67fYWTDNt`nIo&F308X=eB%9Y-`_$1H#eEX^G)|fXdXrWtxk;b z9YF8vz_+*f9U(sYw|w|Z;EnoX5Wk~-;oI!L%0f#$GvJ)sDE1=?%p zq5I-8x~_bHo|{+U8q~AijI0QnEAK<`?yKk%?tzuDKlj-mXR@`v24}AZZn8b_UFmf> v;Lvr#uIYeX;NSAdFyBj}-&Lal_O1@*roCGQ?~+U0IvJm#3W)!M{_pW0n=#MZ literal 0 HcmV?d00001 diff --git a/console/atest-desktop/forge.config.js b/console/atest-desktop/forge.config.js index 0605b7c..5d82269 100644 --- a/console/atest-desktop/forge.config.js +++ b/console/atest-desktop/forge.config.js @@ -3,34 +3,49 @@ const { FuseV1Options, FuseVersion } = require('@electron/fuses'); module.exports = { packagerConfig: { + icon: 'api-testing.ico', asar: true, }, rebuildConfig: {}, makers: [ { name: '@electron-forge/maker-squirrel', - config: {}, + config: { + icon: 'api-testing.ico' + }, }, { name: '@electron-forge/maker-deb', - config: {}, + config: { + options: { + icon: 'api-testing.ico' + } + }, }, { name: '@electron-forge/maker-rpm', - config: {}, + config: { + icon: 'api-testing.ico' + }, }, { name: '@electron-forge/maker-dmg', config: { - format: 'ULFO' + format: 'ULFO', + icon: 'api-testing.ico' } }, { name: '@electron-forge/maker-wix', config: { language: 1033, - manufacturer: 'API Testing Authors' + manufacturer: 'API Testing Authors', + icon: 'api-testing.ico' }, + ui: { + "enabled": true, + "chooseDirectory": true + } } ], plugins: [ @@ -58,7 +73,8 @@ module.exports = { owner: 'linuxsuren', name: 'api-testing' }, - prerelease: true + prerelease: true, + force: true } } ] diff --git a/console/atest-desktop/main.js b/console/atest-desktop/main.js index 00ffe54..abe8e18 100644 --- a/console/atest-desktop/main.js +++ b/console/atest-desktop/main.js @@ -9,14 +9,15 @@ const spawn = require("child_process").spawn; const createWindow = () => { // Create the browser window. const mainWindow = new BrowserWindow({ - width: 1000, + width: 1024, height: 600, webPreferences: { preload: path.join(__dirname, 'preload.js'), nodeIntegration: true, contextIsolation: false, enableRemoteModule: true - } + }, + icon: path.join(__dirname, '/api-testing.ico'), }) server.control(() => { @@ -70,13 +71,13 @@ let serverProcess; // initialization and is ready to create browser windows. // Some APIs can only be used after this event occurs. app.whenReady().then(() => { - // const homedir = require('os').homedir(); + const homedir = require('os').homedir(); serverProcess = spawn("atest", [ "server", "--http-port", server.getPort(), // TODO below setting is not working - // "--local-storage", path.join(homedir, ".atest", "data", "*.yaml") + "--local-storage", path.join(homedir, ".atest", "data", "*.yaml") ]); createWindow()