rm new isElevated check

This commit is contained in:
pompurin404 2024-10-08 20:14:57 +08:00
parent 1af35bff7f
commit 9483794d20
No known key found for this signature in database
3 changed files with 7 additions and 11 deletions

View File

@ -1,3 +1,8 @@
### New Features
- 支持通过代理拉取内置 SubStore 订阅仅对通过订阅页面Sub-Store图标新导入的订阅有效
- 支持根据网速快慢旋转悬浮窗图标
### Bug Fixes
- 修复某些 Windows 设备反复提示管理员权限启动的问题

View File

@ -11,7 +11,7 @@ import { init } from './utils/init'
import { join } from 'path'
import { initShortcut } from './resolve/shortcut'
import { execSync, spawn } from 'child_process'
import { createElevateTask, isElvated } from './sys/misc'
import { createElevateTask } from './sys/misc'
import { initProfileUpdater } from './core/profileUpdater'
import { existsSync, writeFileSync } from 'fs'
import { exePath, taskDir } from './utils/dirs'
@ -24,12 +24,7 @@ export let mainWindow: BrowserWindow | null = null
if (process.platform === 'win32' && !is.dev && !process.argv.includes('noadmin')) {
try {
isElvated()
try {
createElevateTask()
} catch {
// ignore
}
createElevateTask()
} catch (e) {
try {
if (process.argv.slice(1).length > 0) {

View File

@ -105,10 +105,6 @@ const elevateTaskXml = `<?xml version="1.0" encoding="UTF-16"?>
</Task>
`
export function isElvated(): void {
execSync('net session')
}
export function createElevateTask(): void {
const taskFilePath = path.join(taskDir(), `mihomo-party-run.xml`)
writeFileSync(taskFilePath, Buffer.from(`\ufeff${elevateTaskXml}`, 'utf-16le'))