IOverwolfUtilityApi
Electron APIs / utility / IOverwolfUtilityApi
Defines the API for managing game launch and utility operations.
Methods
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
HelperInstallError — exitCode 1223 — user cancelled the UAC prompt (ERROR_CANCELLED)
HelperInstallError — err.exitCode !== 1223 — the installer process failed. Log err.exitCode and investigate.
HelperInstallError — any other non-zero exitCode — installation failed.
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: any) {
if (err.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, exitCode:", err.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.
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>