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() }).unref()
} }
if (file.endsWith('.7z')) { if (file.endsWith('.7z')) {
await writeFile( spawn(
path.join(exeDir(), 'install.ps1'), 'cmd',
`& "${path.join(resourcesFilesDir(), '7za.exe')}" x -o"${exeDir()}" -y "${path.join(dataDir(), file)}"; Start-Process -FilePath "${exePath()}"` [
) '/C',
spawn('powershell', ['-File', `"${path.join(exeDir(), 'install.ps1')}"`], { `""${path.join(resourcesFilesDir(), '7za.exe')}" x -o"${exeDir()}" -y "${path.join(dataDir(), file)}" & start "" "${exePath()}""`
],
{
shell: true, shell: true,
detached: true detached: true
}).unref() }
).unref()
app.quit() app.quit()
} }
if (file.endsWith('.dmg')) { if (file.endsWith('.dmg')) {