1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-06-05 09:53:33 +03:00

#2040 Dynamically Build iss File

This commit is contained in:
David Sangrey 2023-08-01 16:30:59 -04:00
parent 89101fc73c
commit 45804dafc1
No known key found for this signature in database
GPG Key ID: 3AEADBB0186884BC
3 changed files with 20 additions and 3 deletions

1
.gitignore vendored
View File

@ -16,6 +16,7 @@ appcast_win_*.xml
appcast_mac_*.xml appcast_mac_*.xml
EDMarketConnector.VisualElementsManifest.xml EDMarketConnector.VisualElementsManifest.xml
*.zip *.zip
EDMC_Installer_Config.iss
.idea .idea
.vscode .vscode

View File

@ -1,5 +1,5 @@
#define MyAppName "EDMarketConnector" #define MyAppName "EDMarketConnector"
#define MyAppVersion "5.9.1-alpha2" #define MyAppVersion "$appver"
#define MyAppPublisher "EDCD" #define MyAppPublisher "EDCD"
#define MyAppURL "https://edcd.github.io/" #define MyAppURL "https://edcd.github.io/"
#define SuppURL "https://github.com/EDCD/EDMarketConnector/" #define SuppURL "https://github.com/EDCD/EDMarketConnector/"
@ -29,7 +29,8 @@ WizardStyle=modern
InfoBeforeFile=dist.win32\Changelog.md InfoBeforeFile=dist.win32\Changelog.md
OutputDir=. OutputDir=.
LicenseFile=LICENSE LicenseFile=LICENSE
LanguageDetectionMethod=uilanguage AlwaysShowDirOnReadyPage=yes
UninstallDisplayIcon={app}\{#MyAppExeName}
[Languages] [Languages]

View File

@ -7,7 +7,19 @@ See LICENSE file.
""" """
import os import os
import subprocess import subprocess
from string import Template
from build import build from build import build
from config import _static_appversion as appversion
def iss_build(template_path: str, output_file: str) -> None:
"""Build the .iss file needed for building the installer EXE."""
sub_vals = {"appver": appversion}
with open(template_path, encoding="UTF8") as template_file:
src = Template(template_file.read())
newfile = src.substitute(sub_vals)
with open(output_file, "w", encoding="UTF8") as new_file:
new_file.write(newfile)
def run_inno_setup_installer(iss_path: str) -> None: def run_inno_setup_installer(iss_path: str) -> None:
@ -39,6 +51,9 @@ def run_inno_setup_installer(iss_path: str) -> None:
if __name__ == "__main__": if __name__ == "__main__":
build() build()
# Replace 'your_iss_file.iss' with the path to your actual .iss file # Add the ISS Template File
iss_template_path: str = "./EDMC_Installer_Config_template.txt"
iss_file_path: str = "./EDMC_Installer_Config.iss" iss_file_path: str = "./EDMC_Installer_Config.iss"
# Build the ISS file
iss_build(iss_template_path, iss_file_path)
run_inno_setup_installer(iss_file_path) run_inno_setup_installer(iss_file_path)