Skip to content

Commit

Permalink
fix auto start
Browse files Browse the repository at this point in the history
  • Loading branch information
pompurin404 committed Oct 21, 2024
1 parent 7df1894 commit d6ce915
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/main/sys/autoRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ const taskXml = `<?xml version="1.0" encoding="UTF-16"?>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<MultipleInstancesPolicy>Parallel</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<AllowHardTerminate>false</AllowHardTerminate>
<StartWhenAvailable>true</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>true</RunOnlyIfNetworkAvailable>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>false</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
Expand All @@ -42,11 +42,12 @@ const taskXml = `<?xml version="1.0" encoding="UTF-16"?>
</Settings>
<Actions Context="Author">
<Exec>
<Command>"${exePath()}"</Command>
<Command>"${path.join(taskDir(), `mihomo-party-run.exe`)}"</Command>
<Arguments>"${exePath()}"</Arguments>
</Exec>
</Actions>
</Task>
`
`

export async function checkAutoRun(): Promise<boolean> {
if (process.platform === 'win32') {
Expand Down
2 changes: 1 addition & 1 deletion src/main/sys/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const elevateTaskXml = `<?xml version="1.0" encoding="UTF-16"?>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
<ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
Expand Down

0 comments on commit d6ce915

Please sign in to comment.