getAppExeDir
Category: Directory Operations
Namespace: web.directory.getAppExeDir
Description
Retrieves the directory path where the application executable (.exe) is located.
Syntax
const appDir = await web.directory.getAppExeDir();
Parameters
None
Returns
Promise<string> - Returns a promise that resolves with the full path to the application's executable directory
Examples
Simple example
const appDir = await web.directory.getAppExeDir();
console.log('Application directory:', appDir);
// Output: C:\MyApp
Load config file from app directory
const appDir = await web.directory.getAppExeDir();
const configPath = appDir + '\\config.json';
const configContent = await web.files.readTextFile({
filePath: configPath
});
const config = JSON.parse(configContent);
Use Cases
- Access files bundled with your application
- Load configuration files from the app directory
- Reference assets or resources relative to the executable
Notes
- Returns the directory containing the .exe file, not the .exe path itself
- Useful for accessing files packaged with your application
- Path format is Windows-style with backslashes