mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-15 19:22:31 +08:00
fix portable updater
This commit is contained in:
parent
582d159332
commit
0ea63a78b4
|
@ -74,14 +74,17 @@ export async function downloadAndInstallUpdate(version: string): Promise<void> {
|
|||
}).unref()
|
||||
}
|
||||
if (file.endsWith('.7z')) {
|
||||
await writeFile(
|
||||
path.join(exeDir(), 'install.ps1'),
|
||||
`& "${path.join(resourcesFilesDir(), '7za.exe')}" x -o"${exeDir()}" -y "${path.join(dataDir(), file)}"; Start-Process -FilePath "${exePath()}"`
|
||||
)
|
||||
spawn('powershell', ['-File', `"${path.join(exeDir(), 'install.ps1')}"`], {
|
||||
shell: true,
|
||||
detached: true
|
||||
}).unref()
|
||||
spawn(
|
||||
'cmd',
|
||||
[
|
||||
'/C',
|
||||
`""${path.join(resourcesFilesDir(), '7za.exe')}" x -o"${exeDir()}" -y "${path.join(dataDir(), file)}" & start "" "${exePath()}""`
|
||||
],
|
||||
{
|
||||
shell: true,
|
||||
detached: true
|
||||
}
|
||||
).unref()
|
||||
app.quit()
|
||||
}
|
||||
if (file.endsWith('.dmg')) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user