mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-28 05:30:29 +08:00
rm new isElevated check
This commit is contained in:
parent
1af35bff7f
commit
9483794d20
@ -1,3 +1,8 @@
|
|||||||
### New Features
|
### New Features
|
||||||
|
|
||||||
- 支持通过代理拉取内置 SubStore 订阅(仅对通过订阅页面Sub-Store图标新导入的订阅有效)
|
- 支持通过代理拉取内置 SubStore 订阅(仅对通过订阅页面Sub-Store图标新导入的订阅有效)
|
||||||
|
- 支持根据网速快慢旋转悬浮窗图标
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- 修复某些 Windows 设备反复提示管理员权限启动的问题
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { init } from './utils/init'
|
|||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { initShortcut } from './resolve/shortcut'
|
import { initShortcut } from './resolve/shortcut'
|
||||||
import { execSync, spawn } from 'child_process'
|
import { execSync, spawn } from 'child_process'
|
||||||
import { createElevateTask, isElvated } from './sys/misc'
|
import { createElevateTask } from './sys/misc'
|
||||||
import { initProfileUpdater } from './core/profileUpdater'
|
import { initProfileUpdater } from './core/profileUpdater'
|
||||||
import { existsSync, writeFileSync } from 'fs'
|
import { existsSync, writeFileSync } from 'fs'
|
||||||
import { exePath, taskDir } from './utils/dirs'
|
import { exePath, taskDir } from './utils/dirs'
|
||||||
@ -23,13 +23,8 @@ let quitTimeout: NodeJS.Timeout | null = null
|
|||||||
export let mainWindow: BrowserWindow | null = null
|
export let mainWindow: BrowserWindow | null = null
|
||||||
|
|
||||||
if (process.platform === 'win32' && !is.dev && !process.argv.includes('noadmin')) {
|
if (process.platform === 'win32' && !is.dev && !process.argv.includes('noadmin')) {
|
||||||
try {
|
|
||||||
isElvated()
|
|
||||||
try {
|
try {
|
||||||
createElevateTask()
|
createElevateTask()
|
||||||
} catch {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
try {
|
try {
|
||||||
if (process.argv.slice(1).length > 0) {
|
if (process.argv.slice(1).length > 0) {
|
||||||
|
|||||||
@ -105,10 +105,6 @@ const elevateTaskXml = `<?xml version="1.0" encoding="UTF-16"?>
|
|||||||
</Task>
|
</Task>
|
||||||
`
|
`
|
||||||
|
|
||||||
export function isElvated(): void {
|
|
||||||
execSync('net session')
|
|
||||||
}
|
|
||||||
|
|
||||||
export function createElevateTask(): void {
|
export function createElevateTask(): void {
|
||||||
const taskFilePath = path.join(taskDir(), `mihomo-party-run.xml`)
|
const taskFilePath = path.join(taskDir(), `mihomo-party-run.xml`)
|
||||||
writeFileSync(taskFilePath, Buffer.from(`\ufeff${elevateTaskXml}`, 'utf-16le'))
|
writeFileSync(taskFilePath, Buffer.from(`\ufeff${elevateTaskXml}`, 'utf-16le'))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user