Skip to content

Commit

Permalink
windows: bundle Visual C++ with installer
Browse files Browse the repository at this point in the history
  • Loading branch information
adil192 committed Mar 17, 2023
1 parent dba4616 commit 6cdaaf3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ jobs:
- name: Build Windows
run: flutter build windows

- name: Download Visual C++ Redistributable
shell: bash
run: |
curl -L -o installers/vc_redist.x64.exe https://aka.ms/vs/17/release/vc_redist.x64.exe
- name: Build Windows Installer
run: ISCC.exe installers/desktop_inno_script.iss

Expand Down
2 changes: 1 addition & 1 deletion installers/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SaberInstaller.exe

vc_redist.x64.exe
16 changes: 13 additions & 3 deletions installers/desktop_inno_script.iss
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "{#SourcePath}\..\build\windows\runner\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: "{#SourcePath}\..\build\windows\runner\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; Visual C++ Redistributable
Source: "{#SourcePath}\vc_redist.x64.exe"; DestDir: "{tmp}"; Flags: ignoreversion deleteafterinstall

[Registry]
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKey}"; ValueData: ""; Flags: uninsdeletevalue
Expand All @@ -58,6 +60,14 @@ Root: HKA; Subkey: "Software\Classes\Applications\{#MyAppExeName}\SupportedTypes
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[CustomMessages]
InstallVCRedist=Install Visual C++ Redistributable

[Run]
Filename: "{tmp}\vc_redist.x64.exe"; \
Description: "{cm:InstallVCRedist}"; \
Parameters: "/quiet"; \
Flags: waituntilterminated postinstall skipifsilent
Filename: "{app}\{#MyAppExeName}"; \
Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; \
Flags: nowait postinstall skipifsilent

0 comments on commit 6cdaaf3

Please sign in to comment.