Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/deploy-launcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,19 @@ jobs:
shell: pwsh
run: |
choco install innosetup --no-progress -y
# Bundle the VC++ runtime installer so torch's c10.dll has its deps on
# clean machines; the installer only runs it when the runtime is absent.
Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vc_redist.x64.exe `
-OutFile dist\vc_redist.x64.exe -MaximumRetryCount 5 -RetryIntervalSec 5
# Inno resolves relative paths against the .iss file's folder, so pass
# absolute paths for the source exe and the output dir (repo-root dist).
$exe = (Resolve-Path dist\photomap.exe).Path
$vc = (Resolve-Path dist\vc_redist.x64.exe).Path
$out = (Resolve-Path dist).Path
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" `
"/DAppVersion=$env:VERSION" `
"/DSourceExe=$exe" `
"/DVCRedist=$vc" `
"/O$out" `
INSTALL\launcher\windows\photomap.iss

Expand Down
19 changes: 19 additions & 0 deletions INSTALL/launcher/windows/photomap.iss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#ifndef SourceExe
#define SourceExe "dist\photomap.exe"
#endif
#ifndef VCRedist
#define VCRedist "dist\vc_redist.x64.exe"
#endif

#define AppName "PhotoMapAI"
#define AppExe "photomap.exe"
Expand Down Expand Up @@ -44,11 +47,27 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{

[Files]
Source: "{#SourceExe}"; DestDir: "{app}"; DestName: "{#AppExe}"; Flags: ignoreversion
; Bundled VC++ runtime installer; only extracted when the runtime is missing.
Source: "{#VCRedist}"; DestDir: "{tmp}"; Flags: deleteafterinstall; Check: VCRedistNeeded

[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExe}"
Name: "{group}\Uninstall {#AppName}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#AppExe}"; Tasks: desktopicon

[Run]
; PyTorch needs the Microsoft Visual C++ runtime (vcruntime140.dll, etc.).
; Install it silently only when absent (one UAC prompt; skipped otherwise).
Filename: "{tmp}\vc_redist.x64.exe"; Parameters: "/install /quiet /norestart"; StatusMsg: "Installing Microsoft Visual C++ Runtime..."; Check: VCRedistNeeded; Flags: waituntilterminated
Filename: "{app}\{#AppExe}"; Description: "{cm:LaunchProgram,{#AppName}}"; Flags: nowait postinstall skipifsilent

[Code]
function VCRedistNeeded(): Boolean;
var
Installed: Cardinal;
begin
// Read the native 64-bit view for the VC++ 2015-2022 x64 runtime key.
Result := True;
if RegQueryDWordValue(HKLM64, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\X64', 'Installed', Installed) then
Result := (Installed <> 1);
end;
Loading