mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-15 19:22:31 +08:00
rm new isElevated check
This commit is contained in:
parent
1af35bff7f
commit
9483794d20
|
@ -1,3 +1,8 @@
|
|||
### New Features
|
||||
|
||||
- 支持通过代理拉取内置 SubStore 订阅(仅对通过订阅页面Sub-Store图标新导入的订阅有效)
|
||||
- 支持根据网速快慢旋转悬浮窗图标
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- 修复某些 Windows 设备反复提示管理员权限启动的问题
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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'))
|
||||
|
|
Loading…
Reference in New Issue
Block a user