From f384a702b87eae20f3618a57a26b3633629f6863 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Wed, 2 Aug 2023 15:29:12 -0400 Subject: [PATCH 01/11] Update Changelog and Version String --- ChangeLog.md | 15 +++++++++++++++ config/__init__.py | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 08f089547..8ab54b4a9 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -33,6 +33,21 @@ produce the Windows executables and installer. currently used version in a given branch. --- +Release 5.9.1 +=== +This release updates the build system in use for EDMC to a more feature-rich installer, as well +as updating the commodity information to be up-to-date for Update 16. + +NOTE: This version hands over the installer to an EXE file for Windows instead of an MSI. +This does not change any functionality or plugin capability of EDMC. You **_may_** need to +manually close EDMC during the update process if updating from version 5.9.0 or earlier. + +* Removed the old WiX Build System +* Handed over the Build system to Inno Setup +* Broke apart the Build and Installer scripts for ease of development +* Updated FDevIDs to latest version +* Updated coriolis-data to latest version +* Updated some internal documentation. Release 5.9.0 === diff --git a/config/__init__.py b/config/__init__.py index e43920673..2db356d2e 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.9.1-alpha0' +_static_appversion = '5.9.1' _cached_version: Optional[semantic_version.Version] = None copyright = '© 2015-2019 Jonathan Harris, 2020-2023 EDCD' From e7876a0e0b13e709bfde6ae9d2d4d55b9a7d1ba4 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Thu, 3 Aug 2023 16:29:07 -0400 Subject: [PATCH 02/11] #2046 Add Missing Registry Logic --- config/__init__.py | 2 +- resources/EDMC_Installer_Config_template.txt | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/config/__init__.py b/config/__init__.py index 2db356d2e..e9079c283 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.9.1' +_static_appversion = '5.9.2' _cached_version: Optional[semantic_version.Version] = None copyright = '© 2015-2019 Jonathan Harris, 2020-2023 EDCD' diff --git a/resources/EDMC_Installer_Config_template.txt b/resources/EDMC_Installer_Config_template.txt index ff00f4cf7..d8b53e920 100644 --- a/resources/EDMC_Installer_Config_template.txt +++ b/resources/EDMC_Installer_Config_template.txt @@ -65,3 +65,15 @@ begin end; end; end; + + +[Registry] +; Create the registry key for the custom file type +Root: HKCR; Subkey: "edmc"; Flags: uninsdeletekey +; Create the registry values for the custom file type +Root: HKCR; Subkey: "edmc"; ValueType: string; ValueName: ""; ValueData: "{#MyAppName}"; Flags: uninsdeletevalue +Root: HKCR; Subkey: "edmc\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0"; Flags: uninsdeletevalue +Root: HKCR; Subkey: "edmc\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""; Flags: uninsdeletevalue + +; Register the URL protocol handler +Root: HKCR; Subkey: "edmc"; ValueType: string; ValueName: "URL Protocol"; ValueData: ""; Flags: uninsdeletevalue From 775c6a770a6ae62ddedf4e5ade4005dd46238b07 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Thu, 3 Aug 2023 16:29:42 -0400 Subject: [PATCH 03/11] #2045 Make Description Less Useless --- build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index e48f299cf..4ee997587 100644 --- a/build.py +++ b/build.py @@ -143,7 +143,8 @@ def build() -> None: ) version_info: dict = { - "description": "Downloads commodity market and other station data from the game" + "description": "Elite Dangerous Market Connector (EDMC)", + "comments": "Downloads commodity market and other station data from the game" " Elite Dangerous for use with all popular online and offline trading tools.", "company_name": "EDCD", # Used by WinSparkle "product_name": appname, # Used by WinSparkle From 7c77175f2b9baeb21c962cd130cd254f572cee71 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Thu, 3 Aug 2023 16:30:24 -0400 Subject: [PATCH 04/11] #1936 Make About Version Copyable --- EDMarketConnector.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index d97c54114..7ff468ca1 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -427,7 +427,7 @@ def _(x: str) -> str: import tkinter.filedialog import tkinter.font import tkinter.messagebox -from tkinter import ttk +from tkinter import ttk, constants as tkc import commodity import plug @@ -1844,7 +1844,11 @@ def __init__(self, parent: tk.Tk): # version tk.Label(frame).grid(row=row, column=0) # spacer row += 1 - self.appversion_label = tk.Label(frame, text=appversion()) + self.appversion_label = tk.Text(frame, height=1, width=20, wrap=tkc.NONE, bd=0) + self.appversion_label.insert("1.0", str(appversion())) + self.appversion_label.tag_configure("center", justify="center") + self.appversion_label.tag_add("center", "1.0", "end") + self.appversion_label.config(state=tkc.DISABLED, bg=frame.cget("background"), font="TkDefaultFont") self.appversion_label.grid(row=row, column=0, sticky=tk.E) # LANG: Help > Release Notes self.appversion = HyperlinkLabel(frame, compound=tk.RIGHT, text=_('Release Notes'), From 816d04199208d3fad6ab15f9228a4149ec1a6804 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Thu, 3 Aug 2023 16:30:50 -0400 Subject: [PATCH 05/11] #1462 Remove Deprecated load_module() --- plug.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plug.py b/plug.py index 5bc8c8262..50a7a716a 100644 --- a/plug.py +++ b/plug.py @@ -58,10 +58,9 @@ def __init__(self, name: str, loadfile: Optional[str], plugin_logger: Optional[l try: filename = 'plugin_' filename += name.encode(encoding='ascii', errors='replace').decode('utf-8').replace('.', '_') - module = importlib.machinery.SourceFileLoader( - filename, - loadfile - ).load_module() + spec = importlib.util.spec_from_file_location(filename, loadfile) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) if getattr(module, 'plugin_start3', None): newname = module.plugin_start3(os.path.dirname(loadfile)) From d88bd7005553b51056f12db25aaebac37921a01b Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Thu, 3 Aug 2023 16:32:59 -0400 Subject: [PATCH 06/11] #2047 Mask API Keys in Default Plugins --- plugins/edsm.py | 20 +++++++++++++++++++- plugins/inara.py | 21 ++++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/plugins/edsm.py b/plugins/edsm.py index 256f89f29..fa135049f 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -125,6 +125,7 @@ def __init__(self): this = This() +show_password_var = tk.BooleanVar() STATION_UNDOCKED: str = '×' # "Station" name to display when not docked = U+00D7 __cleanup = str.maketrans({' ': None, '\n': None}) @@ -275,6 +276,14 @@ def plugin_stop() -> None: logger.debug('Done.') +def toggle_password_visibility(): + """Toggle if the API Key is visible or not.""" + if show_password_var.get(): + this.apikey.config(show="") + else: + this.apikey.config(show="*") + + def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> tk.Frame: """ Plugin preferences setup hook. @@ -346,11 +355,20 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> tk.Fr # LANG: EDSM API key label this.apikey_label = nb.Label(frame, text=_('API Key')) # EDSM setting this.apikey_label.grid(row=cur_row, padx=PADX, sticky=tk.W) - this.apikey = nb.Entry(frame) + this.apikey = nb.Entry(frame, show="*", width=50) this.apikey.grid(row=cur_row, column=1, padx=PADX, pady=PADY, sticky=tk.EW) prefs_cmdr_changed(cmdr, is_beta) + show_password_var.set(False) # Password is initially masked + show_password_checkbox = nb.Checkbutton( + frame, + text="Show API Key", + variable=show_password_var, + command=toggle_password_visibility, + ) + show_password_checkbox.grid(columnspan=2, padx=BUTTONX, pady=(5, 0), sticky=tk.W) + return frame diff --git a/plugins/inara.py b/plugins/inara.py index a5b17bd0a..7f7abbd18 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -152,6 +152,8 @@ def filter_events(self, key: Credentials, predicate: Callable[[Event], bool]) -> this = This() +show_password_var = tk.BooleanVar() + # last time we updated, if unset in config this is 0, which means an instant update LAST_UPDATE_CONF_KEY = 'inara_last_update' EVENT_COLLECT_TIME = 31 # Minimum time to take collecting events before requesting a send @@ -242,6 +244,14 @@ def plugin_stop() -> None: logger.debug('Done.') +def toggle_password_visibility(): + """Toggle if the API Key is visible or not.""" + if show_password_var.get(): + this.apikey.config(show="") + else: + this.apikey.config(show="*") + + def plugin_prefs(parent: ttk.Notebook, cmdr: str, is_beta: bool) -> tk.Frame: """Plugin Preferences UI hook.""" x_padding = 10 @@ -281,11 +291,20 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str, is_beta: bool) -> tk.Frame: # LANG: Inara API key label this.apikey_label = nb.Label(frame, text=_('API Key')) # Inara setting this.apikey_label.grid(row=12, padx=x_padding, sticky=tk.W) - this.apikey = nb.Entry(frame) + this.apikey = nb.Entry(frame, show="*", width=50) this.apikey.grid(row=12, column=1, padx=x_padding, pady=y_padding, sticky=tk.EW) prefs_cmdr_changed(cmdr, is_beta) + show_password_var.set(False) # Password is initially masked + show_password_checkbox = nb.Checkbutton( + frame, + text="Show API Key", + variable=show_password_var, + command=toggle_password_visibility, + ) + show_password_checkbox.grid(columnspan=2, padx=x_padding, pady=(5, 0), sticky=tk.W) + return frame From dc52e7684f7bdb5713b88afbcde8d7a148c327a0 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Thu, 3 Aug 2023 16:44:11 -0400 Subject: [PATCH 07/11] #1122 Set MinVer for EDMC to Win8 --- resources/EDMC_Installer_Config_template.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/EDMC_Installer_Config_template.txt b/resources/EDMC_Installer_Config_template.txt index d8b53e920..7810270ba 100644 --- a/resources/EDMC_Installer_Config_template.txt +++ b/resources/EDMC_Installer_Config_template.txt @@ -31,6 +31,7 @@ OutputDir=. LicenseFile=LICENSE AlwaysShowDirOnReadyPage=yes UninstallDisplayIcon={app}\{#MyAppExeName} +MinVersion=6.2 [Languages] From db73b9d775975b972ca1b562b9c70f056a3cf07d Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Thu, 3 Aug 2023 17:31:46 -0400 Subject: [PATCH 08/11] #2047 Suppress Inaccurate MyPy --- plug.py | 4 ++-- plugins/edsm.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plug.py b/plug.py index 50a7a716a..480874e97 100644 --- a/plug.py +++ b/plug.py @@ -58,8 +58,8 @@ def __init__(self, name: str, loadfile: Optional[str], plugin_logger: Optional[l try: filename = 'plugin_' filename += name.encode(encoding='ascii', errors='replace').decode('utf-8').replace('.', '_') - spec = importlib.util.spec_from_file_location(filename, loadfile) - module = importlib.util.module_from_spec(spec) + spec = importlib.util.spec_from_file_location(filename, loadfile) # type: ignore + module = importlib.util.module_from_spec(spec) # type: ignore spec.loader.exec_module(module) if getattr(module, 'plugin_start3', None): diff --git a/plugins/edsm.py b/plugins/edsm.py index fa135049f..9f2602b68 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -279,9 +279,9 @@ def plugin_stop() -> None: def toggle_password_visibility(): """Toggle if the API Key is visible or not.""" if show_password_var.get(): - this.apikey.config(show="") + this.apikey.config(show="") # type: ignore else: - this.apikey.config(show="*") + this.apikey.config(show="*") # type: ignore def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> tk.Frame: From b75b6be23f5483e2f13bfd9f45f1c1e84a86ca09 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Thu, 3 Aug 2023 17:56:09 -0400 Subject: [PATCH 09/11] #1443 Update GitHub Workflow Submodules --- .github/workflows/submodule-update.yml | 40 +++++++++++++++++++------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index f047a03f2..61b4da3b0 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -1,11 +1,10 @@ ---- name: Submodule Updates on: push: - branches: [ develop ] - # schedule: - # - cron: '0 12 * * *' + branches: [develop] + schedule: + - cron: '0 12 * * *' jobs: check_submodules: @@ -44,25 +43,44 @@ jobs: echo 'changes=false' >> $GITHUB_OUTPUT fi exit 0 - - - name: Create submodules changes branch + + - name: Create or Update submodules changes branch if: steps.check_for_changes.outputs.changes == 'true' run: | - git checkout -b "submodule-change/$GITHUB_RUN_ID" $CHECKOUT_BRANCH + git fetch origin "submodule-change/$GITHUB_RUN_ID" || git checkout -b "submodule-change/$GITHUB_RUN_ID" $CHECKOUT_BRANCH git commit -am "updating submodules" git push --set-upstream origin "submodule-change/$GITHUB_RUN_ID" - - name: Create pull request against target branch + - name: Create or Update pull request against target branch if: steps.check_for_changes.outputs.changes == 'true' uses: actions/github-script@v6 with: github-token: "${{ secrets.GITHUB_TOKEN }}" script: | - await github.rest.pulls.create({ + const { data: pulls } = await github.rest.pulls.list({ owner: '${{ github.repository_owner }}', repo: '${{ github.repository }}'.split('/')[1].trim(), head: 'submodule-change/${{ github.run_id }}', base: '${{ env.PR_AGAINST_BRANCH }}', - title: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, - body: '${{ steps.check_for_changes.outputs.changes_text }}', + state: 'open', }); + if (pulls.length > 0) { + // If an open pull request exists, update it + const pull_number = pulls[0].number; + await github.rest.pulls.update({ + owner: '${{ github.repository_owner }}', + repo: '${{ github.repository }}'.split('/')[1].trim(), + pull_number, + body: '${{ steps.check_for_changes.outputs.changes_text }}', + }); + } else { + // If no open pull request exists, create a new one + await github.rest.pulls.create({ + owner: '${{ github.repository_owner }}', + repo: '${{ github.repository }}'.split('/')[1].trim(), + head: 'submodule-change/${{ github.run_id }}', + base: '${{ env.PR_AGAINST_BRANCH }}', + title: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, + body: '${{ steps.check_for_changes.outputs.changes_text }}', + }); + } From 0f5be049ed5b9cffc5c0bb049b834bab063999ba Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Thu, 3 Aug 2023 18:05:39 -0400 Subject: [PATCH 10/11] #1462 Suppress MyPy, who is Wrong. --- plug.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plug.py b/plug.py index 480874e97..58939e3f6 100644 --- a/plug.py +++ b/plug.py @@ -60,8 +60,8 @@ def __init__(self, name: str, loadfile: Optional[str], plugin_logger: Optional[l filename += name.encode(encoding='ascii', errors='replace').decode('utf-8').replace('.', '_') spec = importlib.util.spec_from_file_location(filename, loadfile) # type: ignore module = importlib.util.module_from_spec(spec) # type: ignore - spec.loader.exec_module(module) - + spec.loader.exec_module(module) # type: ignore + # These type-ignores will need to be looked at. MyPy is wrong. if getattr(module, 'plugin_start3', None): newname = module.plugin_start3(os.path.dirname(loadfile)) self.name = newname and str(newname) or name From 3bbae8f71bc2bd4cdf237df31d63fc63fe707764 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Thu, 3 Aug 2023 18:51:07 -0400 Subject: [PATCH 11/11] #1936 Update Length --- EDMarketConnector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 7ff468ca1..da7683ee9 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -1844,7 +1844,7 @@ def __init__(self, parent: tk.Tk): # version tk.Label(frame).grid(row=row, column=0) # spacer row += 1 - self.appversion_label = tk.Text(frame, height=1, width=20, wrap=tkc.NONE, bd=0) + self.appversion_label = tk.Text(frame, height=1, width=len(str(appversion())), wrap=tkc.NONE, bd=0) self.appversion_label.insert("1.0", str(appversion())) self.appversion_label.tag_configure("center", justify="center") self.appversion_label.tag_add("center", "1.0", "end")