### Installer Post-Installation Run Command (Inno Setup) Source: https://github.com/edcd/edmarketconnector/blob/main/resources/EDMC_Installer_Config_template.txt Defines actions to be performed after the installation is complete. This example configures the installer to optionally launch the application immediately after setup. ```inno_setup [Run] Filename: "{app}{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent ``` -------------------------------- ### Installer Shortcut Creation (Inno Setup) Source: https://github.com/edcd/edmarketconnector/blob/main/resources/EDMC_Installer_Config_template.txt Configures the shortcuts that will be created on the user's system, including entries in the Start Menu and optionally on the Desktop. These shortcuts point to the main application executable. ```inno_setup [Icons] Name: "{autoprograms}{#MyAppLongName}"; Filename: "{app}{#MyAppExeName}"; Comment: "EDMC"; Name: "{autodesktop}{#MyAppName}"; Filename: "{app}{#MyAppExeName}"; Tasks: desktopicon; ``` -------------------------------- ### Installer Tasks Configuration (Inno Setup) Source: https://github.com/edcd/edmarketconnector/blob/main/resources/EDMC_Installer_Config_template.txt Defines optional tasks that the user can select during installation. This example includes a task for creating a desktop icon. ```inno_setup [Tasks] Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked ``` -------------------------------- ### Installer Setup Configuration (Inno Setup) Source: https://github.com/edcd/edmarketconnector/blob/main/resources/EDMC_Installer_Config_template.txt Configures the main installer settings, including application ID, versioning, publisher information, directory settings, and UI aspects like wizard style and compression. It also specifies the output filename and icon. ```inno_setup [Setup] AppId={{5E9AD4D3-0365-41D5-9586-9368745DD109} AppName={#MyAppName} AppVersion={#MyAppVersion} AppVerName={#MyAppName} {#MyAppVersion} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#SuppURL} AppUpdatesURL={#SuppURL} AppCopyright=Copyright (C) 2015-2019 Jonathan Harris, 2020-2024 EDCD AllowUNCPath=no AllowNetworkDrive=no DefaultDirName={autopf}{#MyAppName} DisableProgramGroupPage=yes DirExistsWarning=yes AllowNoIcons=yes OutputBaseFilename=EDMarketConnector_Installer_{#MyAppVersion} SetupIconFile=dist.win32\EDMarketConnector.ico Compression=lzma2/max SolidCompression=yes WizardStyle=modern InfoBeforeFile=dist.win32\Changelog.md OutputDir=. LicenseFile=LICENSE AlwaysShowDirOnReadyPage=yes UninstallDisplayIcon={app}{#MyAppExeName} MinVersion=6.2 ChangesAssociations = yes UsedUserAreasWarning = no ``` -------------------------------- ### Application Metadata Definitions (Inno Setup) Source: https://github.com/edcd/edmarketconnector/blob/main/resources/EDMC_Installer_Config_template.txt Defines core application metadata such as name, version, publisher, and URLs. These are used throughout the installer script to configure various aspects of the installation process. ```inno_setup #define MyAppName "EDMarketConnector" #define MyAppLongName "Elite Dangerous Market Connector" #define MyAppVersion "$appver" #define MyAppUpdateTime "$update_time" #define MyAppPublisher "EDCD" #define MyAppURL "https://edcd.github.io/" #define SuppURL "https://github.com/EDCD/EDMarketConnector/" #define MyAppExeName "EDMarketConnector.exe" ``` -------------------------------- ### Installer File Copy Configuration (Inno Setup) Source: https://github.com/edcd/edmarketconnector/blob/main/resources/EDMC_Installer_Config_template.txt Specifies which files and directories are included in the installation package and where they should be extracted. This includes the main executable and all other files within the dist.win32 directory. ```inno_setup [Files] Source: "dist.win32\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion Source: "dist.win32\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ``` -------------------------------- ### Installer Language Configuration (Inno Setup) Source: https://github.com/edcd/edmarketconnector/blob/main/resources/EDMC_Installer_Config_template.txt Specifies the language used for the installer messages. This example sets the language to English using the default message file provided by Inno Setup. ```inno_setup [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" ``` -------------------------------- ### Registry Configuration for URL Protocol and Updates (Inno Setup) Source: https://github.com/edcd/edmarketconnector/blob/main/resources/EDMC_Installer_Config_template.txt Manages registry entries to associate a URL protocol (edmc://) with the application and configures WinSparkle for automatic update checks. This includes creating necessary keys and setting update interval values. ```inno_setup [Registry] ; Create the main registry key under HKCR Root: HKCR; Subkey: "edmc"; Flags: uninsdeletekey ; Create a default value under the "edmc" key Root: HKCR; Subkey: "edmc"; ValueType: string; ValueName: ""; ValueData: "{#MyAppName}"; Flags: uninsdeletekey ; Create the "URL Protocol" value under the "edmc" key Root: HKCR; Subkey: "edmc"; ValueType: string; ValueName: "URL Protocol"; ValueData: ""; Flags: uninsdeletekey ; Create the "DefaultIcon" subkey under the "edmc" key Root: HKCR; Subkey: "edmc\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\EDMarketConnector.exe,0"; Flags: uninsdeletekey ; Create the "shell" subkey under the "edmc" key Root: HKCR; Subkey: "edmc\shell"; Flags: uninsdeletekey ; Create the "open" subkey under the "shell" subkey Root: HKCR; Subkey: "edmc\shell\open"; Flags: uninsdeletekey ; Create the "command" subkey under the "open" subkey Root: HKCR; Subkey: "edmc\shell\open\command"; ValueType: string; ValueName: ""; ValueData: "\"{app}\\EDMarketConnector.exe\" \"%1\""; Flags: uninsdeletekey ; Create the "ddeexec" subkey under the "open" subkey Root: HKCR; Subkey: "edmc\shell\open\ddeexec"; ValueType: string; ValueName: ""; ValueData: "Open(\"%1\")"; Flags: uninsdeletekey ; Create WinSparkle related keys for update values Root: HKCU; Subkey: "Software\EDCD\EDMarketConnector"; Flags: uninsdeletekey Root: HKCU; Subkey: "Software\EDCD\EDMarketConnector\WinSparkle"; Flags: uninsdeletekey Root: HKCU; Subkey: "Software\EDCD\EDMarketConnector\WinSparkle"; ValueType: string; ValueName: "UpdateInterval"; ValueData: "{#MyAppUpdateTime}"; Flags: createvalueifdoesntexist Root: HKCU; Subkey: "Software\EDCD\EDMarketConnector\WinSparkle"; ValueType: string; ValueName: "CheckForUpdates"; ValueData: "1"; Flags: createvalueifdoesntexist ``` -------------------------------- ### Install pyenv Installer Source: https://github.com/edcd/edmarketconnector/wiki/Running-from-source Downloads and saves the pyenv-installer script to a specified directory, preparing for pyenv installation. ```bash mkdir -p /usr/local/src cd /usr/local/src curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer -o pyenv-installer ``` -------------------------------- ### Installer Cleanup Configuration (Inno Setup) Source: https://github.com/edcd/edmarketconnector/blob/main/resources/EDMC_Installer_Config_template.txt Defines files and directories to be removed during uninstallation or cleanup processes. This section specifies that the entire application directory should be deleted. ```inno_setup [InstallDelete] Type: filesandordirs; Name: "{app}" ``` -------------------------------- ### Install Development Requirements (Bash) Source: https://github.com/edcd/edmarketconnector/blob/main/Contributing.md Installs the necessary development dependencies for the project, including linters, formatters, and testing tools. This command also ensures that the base requirements are met. It is recommended to run this after setting up the virtual environment. ```bash pip install -r requirements-dev.txt ``` -------------------------------- ### Localization Support Setup in Python Source: https://context7.com/edcd/edmarketconnector/llms.txt This Python code demonstrates how to set up localization for plugin strings using the `l10n` library. It creates a partial function for translations specific to the plugin's context and shows examples of how to use it in UI creation and preference change handlers. It depends on the `l10n` library and standard Python libraries like `functools` and `tkinter` (aliased as `tk`). ```python import l10n import functools import tkinter as tk from typing import Tuple # Assume status_label is defined elsewhere globally or passed appropriately # Set up translation function with plugin context plugin_tl = functools.partial(l10n.translations.tl, context=__file__) def plugin_app(parent: tk.Frame) -> Tuple[tk.Label, tk.Label]: """Create UI with localized strings.""" label = tk.Label(parent, text=plugin_tl("Status")) status = tk.Label(parent, text=plugin_tl("Ready")) return label, status def prefs_changed(cmdr: str, is_beta: bool) -> None: """Refresh localized strings when user changes language.""" if status_label: status_label["text"] = plugin_tl("Ready") ``` -------------------------------- ### Generate Windows MSI Installer (Python/py2exe) Source: https://github.com/edcd/edmarketconnector/blob/main/docs/Releasing.md This command is used to package the previously built Windows .exe into a Microsoft Installer (.msi) file. This is the final distribution format for Windows users. It leverages the output from the py2exe build process and requires specific Windows SDK components to be installed. ```python python setup.py bdist_msi ``` -------------------------------- ### Install Python Prerequisites (Debian) Source: https://github.com/edcd/edmarketconnector/wiki/Running-from-source Installs necessary build tools and development libraries required for compiling Python from source on Debian-based systems. ```bash apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \n libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \n libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev ``` -------------------------------- ### Manual EDMarketConnector Installation on Windows Source: https://github.com/edcd/edmarketconnector/wiki/Troubleshooting Provides steps for manually installing EDMarketConnector on Windows by downloading the MSI file from the latest release page. This method can help bypass antivirus detections that interfere with the automated update process. ```bash 1. Download the .msi file for the [latest release](https://github.com/EDCD/EDMarketConnector/releases/latest) 2. Manually run that .msi file to install. ``` -------------------------------- ### Install Module with Pip Source: https://github.com/edcd/edmarketconnector/blob/main/PLUGINS.md Installs the 'xml_dataclasses' module using pip. This is a prerequisite for using certain functionalities within the plugin. ```bash pip install xml_dataclasses ``` -------------------------------- ### Install Development Dependencies (Python) Source: https://github.com/edcd/edmarketconnector/blob/main/docs/Releasing.md Installs all necessary Python modules for development and building the application using a requirements file. Ensures all dependencies are met for the build process. ```bash python -m pip install --user -r requirements-dev.txt ``` -------------------------------- ### Install vim-plug for Vim Plugin Management Source: https://github.com/edcd/edmarketconnector/wiki/Troubleshooting This snippet demonstrates the installation of vim-plug, a plugin manager for the Vim text editor. It outlines the steps to download the plug.vim script and configure the minimum ~/.vimrc file to enable plugin management for tools like vim-markdown-toc. ```bash mkdir -p ~/.vim/autoload curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim ``` ```vim call plug#begin('~/.vim/plugged') " Create Table of Content from Markdown files Plug 'rderik/vim-markdown-toc', { 'branch': 'add-anchors-to-headings/drc2r' } " Initialize plugin system call plug#end() " Vim markdown Table of Contents let g:vmt_insert_anchors = 1 let g:vmt_auto_update_on_save = 1 ``` -------------------------------- ### Install Pre-commit Hooks (Bash) Source: https://github.com/edcd/edmarketconnector/blob/main/Contributing.md Installs the pre-commit framework and its associated hooks. These hooks run automatically before each Git commit to ensure code quality and compliance with project standards. A temporary bypass is available using '-n' with 'git commit'. ```bash pre-commit install --install-hooks ``` -------------------------------- ### Plugin Startup Function (Python) Source: https://github.com/edcd/edmarketconnector/blob/main/PLUGINS.md Defines the entry point for EDMarketConnector plugins. The `plugin_start3` function is called upon plugin load, receiving the plugin's directory path and returning a string to identify the plugin internally. Any print statements or errors will be logged. ```python def plugin_start3(plugin_dir: str) -> str: """ Load this plugin into EDMarketConnector """ print(f"I am loaded! My plugin folder is {plugin_dir}") return "Test" ``` -------------------------------- ### Replace types-pkg-resources with types-setuptools (Python) Source: https://github.com/edcd/edmarketconnector/blob/main/ChangeLog.md Replaces the `types-pkg-resources` dependency with `types-setuptools` in accordance with PyPi documentation. This update ensures compatibility and adherence to current packaging standards. ```python Replaces types-pkg-resources with types-setuptools per PyPi documentation ``` -------------------------------- ### Lint Python Code with Flake8 (Bash) Source: https://github.com/edcd/edmarketconnector/blob/main/Contributing.md Lints Python source files using flake8 with the project's specific configuration and plugins. This command should be run after installing development requirements to ensure code adheres to style guides and best practices. Replace 'your_files_here' with the actual file or directory paths. ```bash flake8 your_files_here ``` -------------------------------- ### Plugin Initialization (Python) Source: https://context7.com/edcd/edmarketconnector/llms.txt Sets up a plugin for EDMC, including logging and configuration loading. It defines functions for starting and stopping the plugin, which are called by the main application. ```python import logging from config import appname, config # Plugin setup with logger plugin_name = "MyPlugin" logger = logging.getLogger(f'{appname}.{plugin_name}') def plugin_start3(plugin_dir: str) -> str: """ Load plugin into EDMarketConnector. Args: plugin_dir: Directory where plugin is located Returns: Plugin display name """ logger.info(f"Plugin loaded from {plugin_dir}") # Load plugin settings my_setting = config.get_str("MyPlugin_Setting") if not my_setting: config.set("MyPlugin_Setting", "default_value") return "My Plugin Display Name" def plugin_stop() -> None: """ Called when EDMarketConnector is closing. Clean up threads and resources here. """ logger.info("Plugin shutting down") ``` -------------------------------- ### Install pyenv Source: https://github.com/edcd/edmarketconnector/wiki/Running-from-source Installs pyenv itself into a designated directory using the downloaded installer script. Ensures pyenv is set up for managing Python versions. ```bash mkdir -p /usr/local/src/pyenv PYENV_ROOT=/usr/local/src/pyenv ./pyenv-installer ``` -------------------------------- ### Build Script Configuration for Dynamic Imports (build.py) Source: https://github.com/edcd/edmarketconnector/blob/main/Contributing.md Provides an example of how to configure the 'packages' and 'includes' options in a Python build script (like build.py) to ensure that dynamically loaded plugin files or directories are correctly included in the distribution package, especially for tools like py2exe. ```python 'packages': [ 'sqlite3', # Included for plugins 'util', # 2022-02-01 only imported in plugins/eddn.py ], ``` -------------------------------- ### Install Pip on Debian Source: https://github.com/edcd/edmarketconnector/wiki/Running-from-source Installs the python3-pip package on Debian-based systems, which is necessary for managing Python packages. ```bash sudo apt install python3-pip ``` -------------------------------- ### Install Application Requirements with Pip Source: https://github.com/edcd/edmarketconnector/wiki/Running-from-source This command installs the necessary Python packages for EDMarketConnector from a requirements file. It's crucial for the application's functionality. Note that on Debian-based systems, 'pip3' might be required instead of 'pip'. If 'pip' is not found, a command to install it is provided. ```bash pip install -r requirements.txt ``` ```bash pip3 install -r requirements.txt ``` ```bash python -m pip --user install pip ``` -------------------------------- ### Install Tkinter on Debian Source: https://github.com/edcd/edmarketconnector/wiki/Running-from-source Installs the tkinter package for Python 3 on Debian-based systems, which is a requirement for graphical user interface elements. ```bash sudo apt install python3-tk ``` -------------------------------- ### Install Tkinter on Arch Linux Source: https://github.com/edcd/edmarketconnector/wiki/Running-from-source Installs the tkinter package on Arch Linux using pacman, ensuring GUI compatibility for Python applications. ```bash pacman -S tk ``` -------------------------------- ### Creating UI Elements with `ttkHyperlinkLabel` and `myNotebook` Source: https://github.com/edcd/edmarketconnector/blob/main/PLUGINS.md Plugins can create custom UI elements using `ttkHyperlinkLabel` for clickable links and `myNotebook` for notebook tab interfaces. These imports allow for a consistent look and feel within the EDMarketConnector application. ```python from ttkHyperlinkLabel import HyperlinkLabel import myNotebook as nb # Example of using HyperlinkLabel link = HyperlinkLabel(parent, text='Visit Example', url='http://example.com') link.pack() # Example of using myNotebook (assuming 'parent' is a valid Tkinter widget) notebook = nb.Notebook(parent) notebook.add_page("Tab 1", tk.Frame(notebook)) notebook.pack() ```