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 <LinuxSuRen@users.noreply.github.com>
This commit is contained in:
Rick 2024-05-16 21:16:02 +08:00 committed by GitHub
parent a503d757a6
commit 0d481b31ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 27 additions and 10 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -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
}
}
]

View File

@ -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()