Windows installer; ship the dashboard template
- packaging/: PyInstaller spec (one folder, windowed, Python included), Inno Setup script (per-user install, Start menu, optional desktop icon, WebView2 check), build.ps1, app icon. - Bundled exe also runs the CLI (output to %LOCALAPPDATA%\myGarmin\cli.log). - Fix: .gitignore pattern dashboard*.html also hid src/mygarmin/report/dashboard.html, so the template was never committed and fresh clones could not build a dashboard. Patterns anchored; data file types (*.gpx, *.csv, *.json, *.gz, *.log) ignored too. - Self-test runs beside an open app (own WebView2 data folder, no single-instance check). - Neutral example values in a docstring and the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
69
packaging/myGarmin.iss
Normal file
69
packaging/myGarmin.iss
Normal file
@@ -0,0 +1,69 @@
|
||||
; Inno Setup script for myGarmin. Built by packaging\build.ps1 (passes /DAppVersion=x.y.z).
|
||||
; Installs per user (no admin rights) into %LOCALAPPDATA%\Programs\myGarmin. The user's library folder,
|
||||
; settings and Garmin token live elsewhere and are never touched by setup or uninstall.
|
||||
#ifndef AppVersion
|
||||
#define AppVersion "0.0.0"
|
||||
#endif
|
||||
|
||||
[Setup]
|
||||
AppId={{6B0E8C5A-3F2D-4C1B-9E7A-2D5F8A1C4B90}
|
||||
AppName=myGarmin
|
||||
AppVersion={#AppVersion}
|
||||
AppVerName=myGarmin {#AppVersion}
|
||||
AppPublisher=myGarmin (open source, MIT)
|
||||
AppPublisherURL=https://services.doorduin.co.za/gitea/public/myGarminApp
|
||||
DefaultDirName={autopf}\myGarmin
|
||||
DefaultGroupName=myGarmin
|
||||
DisableProgramGroupPage=yes
|
||||
PrivilegesRequired=lowest
|
||||
PrivilegesRequiredOverridesAllowed=dialog
|
||||
ArchitecturesAllowed=x64compatible
|
||||
ArchitecturesInstallIn64BitMode=x64compatible
|
||||
MinVersion=10.0
|
||||
OutputDir=..\build\installer
|
||||
OutputBaseFilename=myGarmin-setup-{#AppVersion}
|
||||
SetupIconFile=myGarmin.ico
|
||||
UninstallDisplayIcon={app}\myGarmin.exe
|
||||
LicenseFile=..\LICENSE
|
||||
Compression=lzma2/max
|
||||
SolidCompression=yes
|
||||
WizardStyle=modern
|
||||
CloseApplications=yes
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
|
||||
|
||||
[Files]
|
||||
Source: "..\build\dist\myGarmin\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
|
||||
[Icons]
|
||||
Name: "{group}\myGarmin"; Filename: "{app}\myGarmin.exe"
|
||||
Name: "{group}\Uninstall myGarmin"; Filename: "{uninstallexe}"
|
||||
Name: "{autodesktop}\myGarmin"; Filename: "{app}\myGarmin.exe"; Tasks: desktopicon
|
||||
|
||||
[Run]
|
||||
Filename: "{app}\myGarmin.exe"; Description: "{cm:LaunchProgram,myGarmin}"; Flags: nowait postinstall skipifsilent
|
||||
|
||||
[Code]
|
||||
// The app window uses Microsoft Edge WebView2 (part of Windows 11; usually present on Windows 10).
|
||||
function HasWebView2(): Boolean;
|
||||
var v: String;
|
||||
begin
|
||||
Result := RegQueryStringValue(HKLM, 'SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}', 'pv', v)
|
||||
or RegQueryStringValue(HKCU, 'Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}', 'pv', v);
|
||||
Result := Result and (v <> '') and (v <> '0.0.0.0');
|
||||
end;
|
||||
|
||||
function InitializeSetup(): Boolean;
|
||||
var code: Integer;
|
||||
begin
|
||||
Result := True;
|
||||
if not HasWebView2() then
|
||||
if MsgBox('myGarmin needs the Microsoft Edge WebView2 Runtime, which is not installed on this PC.' + #13#10#13#10 +
|
||||
'Open the Microsoft download page now? (Install the "Evergreen Bootstrapper", then run this setup again.)',
|
||||
mbConfirmation, MB_YESNO) = IDYES then
|
||||
begin
|
||||
ShellExec('open', 'https://developer.microsoft.com/microsoft-edge/webview2/', '', '', SW_SHOWNORMAL, ewNoWait, code);
|
||||
Result := False;
|
||||
end;
|
||||
end;
|
||||
Reference in New Issue
Block a user