mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-15 19:22:31 +08:00
fix portable update
This commit is contained in:
parent
710780456a
commit
ee0a0b4867
|
@ -7,3 +7,4 @@
|
|||
### Bug Fixes
|
||||
|
||||
- 修复下拉菜单组件样式异常
|
||||
- 修复便携版更新时文件占用的问题
|
||||
|
|
|
@ -3,7 +3,7 @@ import yaml from 'yaml'
|
|||
import { app, shell } from 'electron'
|
||||
import { getControledMihomoConfig } from '../config'
|
||||
import { dataDir, exeDir, exePath, isPortable, resourcesFilesDir } from '../utils/dirs'
|
||||
import { rm, writeFile } from 'fs/promises'
|
||||
import { copyFile, rm, writeFile } from 'fs/promises'
|
||||
import path from 'path'
|
||||
import { existsSync } from 'fs'
|
||||
import os from 'os'
|
||||
|
@ -74,11 +74,12 @@ export async function downloadAndInstallUpdate(version: string): Promise<void> {
|
|||
}).unref()
|
||||
}
|
||||
if (file.endsWith('.7z')) {
|
||||
await copyFile(path.join(resourcesFilesDir(), '7za.exe'), path.join(dataDir(), '7za.exe'))
|
||||
spawn(
|
||||
'cmd',
|
||||
[
|
||||
'/C',
|
||||
`""${path.join(resourcesFilesDir(), '7za.exe')}" x -o"${exeDir()}" -y "${path.join(dataDir(), file)}" & start "" "${exePath()}""`
|
||||
`"timeout /t 2 /nobreak >nul && "${path.join(dataDir(), '7za.exe')}" x -o"${exeDir()}" -y "${path.join(dataDir(), file)}" & start "" "${exePath()}""`
|
||||
],
|
||||
{
|
||||
shell: true,
|
||||
|
|
Loading…
Reference in New Issue
Block a user