feature/IO-3205-Paint-Scale-Integrations: Pre Protocol Handler Keep ALive.

This commit is contained in:
Dave Richer
2025-04-29 20:41:15 -04:00
parent 122f4194f5
commit 7933a8965c
4 changed files with 62 additions and 57 deletions

View File

@@ -7,8 +7,8 @@ const execPromise = promisify(exec);
export async function setupKeepAliveTask(): Promise<void> {
const taskName = "ImEXShopPartnerKeepAlive";
const protocolUrl = "imexmedia://keep-alive";
// Use PowerShell with -ExecutionPolicy Bypass to open the URL
const command = `powershell.exe -ExecutionPolicy Bypass -Command "Start-Process '${protocolUrl}'"`;
// Use rundll32.exe to silently open the URL as a protocol
const command = `rundll32.exe url.dll,OpenURL "${protocolUrl}"`;
// Escape quotes for schtasks /tr parameter
const escapedCommand = command.replace(/"/g, '\\"');