fix autorun on win7

This commit is contained in:
pompurin404 2024-09-25 11:02:01 +08:00
parent 27247aec12
commit a750aedeb8
No known key found for this signature in database
2 changed files with 2 additions and 1 deletions

View File

@ -4,3 +4,4 @@
- gif图标缓存后无法播放的问题
- 修复Linux重启应用进入沙盒环境的问题
- 修复已关闭连接信息过时的问题
- 修复win7开机启动开关无法打开的问题

View File

@ -56,7 +56,7 @@ export async function checkAutoRun(): Promise<boolean> {
if (process.platform === 'win32') {
const execPromise = promisify(exec)
try {
const { stdout } = await execPromise(`schtasks /query /tn "${appName}"`)
const { stdout } = await execPromise(`chcp 437 && schtasks /query /tn "${appName}"`)
return stdout.includes(appName)
} catch (e) {
return false