fix portable updater

This commit is contained in:
pompurin404 2024-09-26 13:21:21 +08:00
parent 582d159332
commit 0ea63a78b4
No known key found for this signature in database

View File

@ -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')) {