IOverwolfUtilityApi
Electron APIs / utility / IOverwolfUtilityApi
Defines the API for managing game launch and utility operations.
Methods
canInjectElevated()?
optional canInjectElevated(): Promise<ElevatedInjectionCapability>;
Whether an elevated (HIGH integrity) game can actually be injected under the account this app is running as.
Returns
Promise<ElevatedInjectionCapability>
An ElevatedInjectionCapability describing what's missing when elevated injection isn't currently possible.
Throws
Remarks
supported is false with reason 'account-cannot-elevate' on a
standard user account: Windows gives a uiAccess helper launched from such
an account a MEDIUM+16 integrity token, which cannot get a dll mapped
into an elevated game. The only workarounds are running the game
un-elevated, granting the account administrator rights, or installing the
elevation broker via installElevationBroker().
Example
const capability = await api.canInjectElevated();
if (!capability.supported) {
console.warn("Cannot inject elevated games:", capability.reason);
}
installElevationBroker()?
optional installElevationBroker(): Promise<void>;
Installs the elevated injection broker: a LocalSystem service that injects into elevated games for accounts that cannot reach HIGH integrity, which is the only way an app running under a standard user account can overlay an elevated game. Prompts for UAC once.
Returns
Promise<void>
Resolves when installation completes.
Throws
UtilityApiError exitCode 1223 — user cancelled the UAC prompt (ERROR_CANCELLED)
Throws
UtilityApiError any other exitCode — installation failed
Throws
UtilityApiError no exitCode — the call failed before the installer ran
Remarks
The service stays registered until uninstallElevationBroker() removes
it, so the app's uninstaller must call that.
installHighElevationHelper()?
optional installHighElevationHelper(): Promise<void>;
Install ow-electron helpers to
%CommonProgramFiles%\<app-name> with UAC elevation.
Allows injection into high elevation games.
No-ops if files are already present.
Returns
Promise<void>
Resolves when installation completes.
Throws
UtilityApiError exitCode 1223 — user cancelled the UAC prompt (ERROR_CANCELLED)
Throws
UtilityApiError any other exitCode — the installer process failed. Log err.exitCode and investigate.
Throws
UtilityApiError no exitCode — the call failed before the installer ran. Log err.message.
Remarks
The helper binaries are installed to:
%CommonProgramFiles%\<app-name>\owe-helper-ui.exe(x64)%CommonProgramFiles%\<app-name>\owe-helper-ui-x86.exe(x86)
Examples
// Check whether the helper is already installed
const installed: boolean = await api.isHighElevationHelperInstalled();
// Trigger UAC-elevated installation (shows a UAC prompt to the user)
try {
await api.installHighElevationHelper();
console.log("Helper installed successfully");
} catch (err) {
const { message, exitCode } = err as UtilityApiError;
if (exitCode === 1223) {
// User cancelled the UAC prompt — not an error, just inform the user
console.warn("User cancelled UAC prompt");
} else {
console.error("Installation failed:", message, exitCode);
}
}
async function ensureElevatedInjection(api: IOverwolfUtilityApi) {
const installed = await api.isHighElevationHelperInstalled();
if (!installed) {
await api.installHighElevationHelper(); // may throw — handle UAC cancel
}
// Injection into elevated games now happens automatically on game launch
}
isHighElevationHelperInstalled()?
optional isHighElevationHelperInstalled(): Promise<boolean>;
Returns true if ow-electron helpers is already installed in
%CommonProgramFiles%\<app-name>.
Returns
Promise<boolean>
true if the helper is installed and ready.
Throws
Remarks
This only reports whether the binaries are present. On a standard
(non-administrator) account they can be present and elevated injection
still won't work — use canInjectElevated() to decide what to tell the
user.
Example
const installed: boolean = await api.isHighElevationHelperInstalled();
if (!installed) {
// Prompt the user to run the one-time setup before injecting into elevated games
}
on("game-launched")
on(eventName: "game-launched", listener: (gameInfo: GameInfo) => void): this;
Fires when a tracked game is launched.
Parameters
| Parameter | Type | Description |
|---|---|---|
eventName | "game-launched" | The name of the event ('game-launched'). |
listener | (gameInfo: GameInfo) => void | A callback that receives the GameInfo of the launched game. |
Returns
this
The current instance for method chaining.
on("game-exit")
on(eventName: "game-exit", listener: (gameInfo: GameInfo) => void): this;
Fires when a tracked game is exited.
Parameters
| Parameter | Type | Description |
|---|---|---|
eventName | "game-exit" | The name of the event ('game-exit'). |
listener | (gameInfo: GameInfo) => void | A callback that receives the GameInfo of the exited game. |
Returns
this
The current instance for method chaining.
scan()
scan(filter?: any): Promise<InstalledGameInfo[]>;
Scans the system for installed games that match the provided filter.
If a game is installed on multiple platforms (e.g. both Steam and Epic Games),
each installation is returned as a separate InstalledGameInfo entry.
Parameters
| Parameter | Type | Description |
|---|---|---|
filter? | any | Optional. Configuration specifying which games to include in the scan. |
Returns
Promise<InstalledGameInfo[]>
A promise that resolves to an array of InstalledGameInfo objects representing the installed games.
trackGames()
trackGames(filter: GamesFilter): Promise<void>;
Register games you want to track.
Once a game that matches the filter is launched or exited, the appropriate event listeners will be triggered.
Parameters
| Parameter | Type | Description |
|---|---|---|
filter | GamesFilter | Configuration specifying which games to register and whether to include unsupported titles. |
Returns
Promise<void>
uninstallElevationBroker()?
optional uninstallElevationBroker(): Promise<void>;
Stops and removes the elevation broker service. Prompts for UAC once. Succeeds when the service is already absent.
Returns
Promise<void>
Resolves when removal completes.
Throws
UtilityApiError exitCode 1223 — user cancelled the UAC prompt (ERROR_CANCELLED)
Throws
UtilityApiError any other exitCode — removal failed
Throws
UtilityApiError no exitCode — the call failed before the uninstaller ran