stouputils.installer.windows module#
Installer module for Windows specific functions.
Provides Windows specific implementations for checking administrator privileges, determining appropriate installation paths (global/local), and modifying the user’s PATH environment variable.
- add_to_path_windows(install_path: str) bool | None [source]#
Add install_path to the User PATH environment variable on Windows.
- Parameters:
install_path (str) – The path to add to the User PATH environment variable.
- Returns:
True if the path was added to the User PATH environment variable, None otherwise.
- Return type:
bool | None
- check_admin_windows() bool [source]#
Check if the script is running with administrator privileges on Windows.
- get_install_path_windows(program_name: str, ask_global: int = 0, add_path: bool = True, append_to_path: str = '', default_global: str = 'C:\\Program Files') str [source]#
Get the installation path for the program
- Parameters:
program_name (str) – The name of the program to install.
ask_global (int) – 0 = ask for anything, 1 = install globally, 2 = install locally
add_path (bool) – Whether to add the program to the PATH environment variable. (Only if installed globally)
append_to_path (str) – String to append to the installation path when adding to PATH. (ex: “bin” if executables are in the bin folder)
default_global (str) – The default global installation path. (Default is “C:Program Files” which is the most common location for executables on Windows)
- Returns:
The installation path.
- Return type:
str