1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-15 00:30:33 +03:00

Merge pull request #2060 from HullSeals/fix/2048/capi-auth-issues

Fix cAPI Hanging Auth Issue on EDMC Protocol
LGTM, it's only missing translation of the auth popup which can be added later since that's not critical.
This commit is contained in:
Phoebe 2023-08-08 20:51:08 +02:00 committed by GitHub
commit 8a344c8c33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 18 deletions

View File

@ -15,6 +15,7 @@ import json
import numbers
import os
import random
import sys
import threading
import time
import tkinter as tk
@ -743,6 +744,10 @@ class Session(object):
self.state = Session.STATE_INIT # Will try to authorize again on next login or query
self.auth = None
raise # Bad thing happened
if getattr(sys, 'frozen', False):
tk.messagebox.showinfo(title="Authentication Successful",
message="Authentication with cAPI Successful.\n"
"You may now close the Frontier login tab if it is still open.")
def close(self) -> None:
"""Close the `request.Session()."""

View File

@ -52,7 +52,8 @@ appcmdname = 'EDMC'
# <https://semver.org/#semantic-versioning-specification-semver>
# Major.Minor.Patch(-prerelease)(+buildmetadata)
# NB: Do *not* import this, use the functions appversion() and appversion_nobuild()
_static_appversion = '5.9.3'
_static_appversion = '5.9.4'
_cached_version: Optional[semantic_version.Version] = None
copyright = '© 2015-2019 Jonathan Harris, 2020-2023 EDCD'

View File

@ -1,4 +1,5 @@
#define MyAppName "EDMarketConnector"
#define MyAppLongName "Elite Dangerous Market Connector"
#define MyAppVersion "$appver"
#define MyAppPublisher "EDCD"
#define MyAppURL "https://edcd.github.io/"
@ -32,7 +33,7 @@ LicenseFile=LICENSE
AlwaysShowDirOnReadyPage=yes
UninstallDisplayIcon={app}\{#MyAppExeName}
MinVersion=6.2
ChangesAssociations = yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
@ -45,36 +46,49 @@ Source: "dist.win32\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "dist.win32\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{autoprograms}\{#MyAppLongName}"; Filename: "{app}\{#MyAppExeName}"; Comment: "EDMC";
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon;
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
;Check if a WiX-based installation exists. If so, kill it with fire.
[Code]
function IsWixInstalled: Boolean;
var
Uninstall: String;
begin
Result := RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5E9AD4D3-0365-41D5-9586-9368745DD109}', 'UninstallString', Uninstall);
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: Integer;
Uninstall: String;
begin
if (CurStep = ssInstall) then begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5E9AD4D3-0365-41D5-9586-9368745DD109}', 'UninstallString', Uninstall) then begin
MsgBox('Warning: an old version of EDMC is installed! Please close EDMC while we remove the old version!', mbInformation, MB_OK);
Uninstall := '/x {5E9AD4D3-0365-41D5-9586-9368745DD109}';
Exec('MsiExec.exe', Uninstall, '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
end;
if (CurStep = ssInstall) and IsWixInstalled then
begin
MsgBox('Warning: an old version of EDMC is installed! Please close EDMC while we remove the old version!', mbInformation, MB_OK);
Uninstall := '/x {5E9AD4D3-0365-41D5-9586-9368745DD109}';
Exec('MsiExec.exe', Uninstall, '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
end;
end;
[Registry]
; Create the registry key for the custom file type
; Create the main registry key under HKCR
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
; 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