mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
fix portable update
This commit is contained in:
parent
710780456a
commit
ee0a0b4867
@ -7,3 +7,4 @@
|
|||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
- 修复下拉菜单组件样式异常
|
- 修复下拉菜单组件样式异常
|
||||||
|
- 修复便携版更新时文件占用的问题
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import yaml from 'yaml'
|
|||||||
import { app, shell } from 'electron'
|
import { app, shell } from 'electron'
|
||||||
import { getControledMihomoConfig } from '../config'
|
import { getControledMihomoConfig } from '../config'
|
||||||
import { dataDir, exeDir, exePath, isPortable, resourcesFilesDir } from '../utils/dirs'
|
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 path from 'path'
|
||||||
import { existsSync } from 'fs'
|
import { existsSync } from 'fs'
|
||||||
import os from 'os'
|
import os from 'os'
|
||||||
@ -74,11 +74,12 @@ export async function downloadAndInstallUpdate(version: string): Promise<void> {
|
|||||||
}).unref()
|
}).unref()
|
||||||
}
|
}
|
||||||
if (file.endsWith('.7z')) {
|
if (file.endsWith('.7z')) {
|
||||||
|
await copyFile(path.join(resourcesFilesDir(), '7za.exe'), path.join(dataDir(), '7za.exe'))
|
||||||
spawn(
|
spawn(
|
||||||
'cmd',
|
'cmd',
|
||||||
[
|
[
|
||||||
'/C',
|
'/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,
|
shell: true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user