Skip to content

Commit

Permalink
Added the VC++ Redistrbutable to the installer.
Browse files Browse the repository at this point in the history
  • Loading branch information
maforget committed Aug 26, 2024
1 parent 080168a commit 846aa6d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $env:GITHUB_OUTPUT

- name: Download VC++ Redistributable (x64)
run: |
mkdir ComicRack\bin\Release\net48\_CommonRedist
curl -L -o ComicRack\bin\Release\net48\_CommonRedist\vc_redist.x64.exe https://aka.ms/vs/17/release/vc_redist.x64.exe
- name: Compile installer
uses: Minionguyjpro/Inno-Setup-Action@v1.2.4
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ jobs:

- name: Package Files
run: powershell Compress-Archive -Path 'ComicRack\bin\Release\net48\*' -DestinationPath 'ComicRackCE_v${{ github.event.inputs.version }}.zip' -Force

- name: Download VC++ Redistributable (x64)
run: |
mkdir ComicRack\bin\Release\net48\_CommonRedist
curl -L -o ComicRack\bin\Release\net48\_CommonRedist\vc_redist.x64.exe https://aka.ms/vs/17/release/vc_redist.x64.exe
- name: Compile installer
uses: Minionguyjpro/Inno-Setup-Action@v1.2.4
Expand Down
30 changes: 29 additions & 1 deletion Installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ChangesAssociations=yes
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=ComicRack\bin\Release\net48\License.txt
PrivilegesRequiredOverridesAllowed=dialog
PrivilegesRequired=admin
OutputDir=.
OutputBaseFilename={#MyAppSetupFile}
Compression=lzma
Expand Down Expand Up @@ -80,6 +80,7 @@ Source: "ComicRack\bin\Release\net48\Resources\*"; DestDir: "{app}\Resources"; F
Source: "ComicRack\bin\Release\net48\Resources\Icons\*"; DestDir: "{app}\Resources\Icons"; Flags: ignoreversion; Components: additional
Source: "ComicRack\bin\Release\net48\Resources\Textures\*"; DestDir: "{app}\Resources\Textures"; Flags: ignoreversion recursesubdirs; Components: additional
Source: "ComicRack\bin\Release\net48\Scripts\*"; DestDir: "{app}\Scripts"; Flags: ignoreversion; Components: app
Source: "ComicRack\bin\Release\net48\_CommonRedist\VC_redist.x64.exe"; DestDir: {tmp}; Flags: dontcopy

[Registry]
; Comics
Expand Down Expand Up @@ -138,6 +139,10 @@ Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}";
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Components: desktop

[Run]
Filename: "{tmp}\VC_redist.x64.exe"; Parameters: "/install /passive /norestart"; \
Check: Is64BitInstallMode and VC2022RedistNeedsInstall; \
Flags: waituntilterminated; \
StatusMsg: "Installing VC++ 2022 redistributables..."
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Code]
Expand Down Expand Up @@ -202,6 +207,29 @@ begin
end;
end;
function VC2022RedistNeedsInstall: Boolean;
var
Version: String;
begin
if RegQueryStringValue(HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Version',
Version) then
begin
// Is the installed version at least 14.40 ?
Log('VC Redist Version check : found ' + Version);
Result := (CompareStr(Version, 'v14.40.33810.00')<0);
end
else
begin
// Not even an old version installed
Result := True;
end;
if (Result) then
begin
ExtractTemporaryFile('VC_redist.x64.exe');
end;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
if CurPageID = wpReady then begin
Expand Down

0 comments on commit 846aa6d

Please sign in to comment.