stouputils.installer.downloader module#

Downloader module for the installer subpackage.

Provides functions for downloading and installing programs from URLs. It handles platform-specific downloads, checking if programs are already installed, and setting up the downloaded programs for use.

This module works with the main installer module to provide a complete installation solution for programs that need to be downloaded from the internet.

download_executable(download_urls: dict[str, str], program_name: str, append_to_path: str = '') bool[source]#

Ask the user if they want to download the program (ex: waifu2x-ncnn-vulkan). If yes, try to download the program from the GitHub releases page.

Parameters:
  • download_urls (dict[str, str]) – The URLs to download the program from.

  • program_name (str) – The name of the program to download.

Returns:

True if the program is now ready to use, False otherwise.

Return type:

bool

check_executable(executable: str, executable_help_text: str, download_urls: dict[str, str], append_to_path: str = '') None[source]#

Check if the executable exists, optionally download it if it doesn’t.

Parameters:
  • executable (str) – The path to the executable.

  • executable_help_text (str) – The help text to check for in the executable’s output.

  • download_urls (dict[str, str]) – The URLs to download the executable from.

  • append_to_path (str) – The path to append to the executable’s path. (ex: “bin” if executables are in the bin folder)