Skip to content

Commit 2940e08

Browse files
committed
Add Windows Installer script and build Installer in GHA
1 parent 6443f43 commit 2940e08

File tree

3 files changed

+89
-0
lines changed

3 files changed

+89
-0
lines changed

.github/workflows/windows.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ jobs:
4242
user_info="$bintrayUser:$bintrayApiKey"
4343
curl -T $zipfile --user $user_info https://api.bintray.com/content/open-ephys-gui/Test/Test-windows/$gui_ver/$zipfile
4444
curl -X POST --user $user_info https://api.bintray.com/content/open-ephys-gui/Test/Test-windows/$gui_ver/publish
45+
cd ../Resources/Installers/Windows
46+
iscc "windows_installer_script.iss"
47+
installer=Open-Ephys_Installer_${gui_ver}-beta.exe
48+
mv Open-Ephys_Installer.exe $installer
49+
curl -T $installer --user $user_info https://api.bintray.com/content/open-ephys-gui/Release-Installer/Release-Installer-windows/$gui_ver/$installer
50+
curl -X POST --user $user_info https://api.bintray.com/content/open-ephys-gui/Release-Installer/Release-Installer-windows/$gui_ver/publish
4551
shell: bash
4652
- name: deploy_release
4753
if: github.ref == 'refs/heads/master'
@@ -60,4 +66,10 @@ jobs:
6066
user_info="$bintrayUser:$bintrayApiKey"
6167
curl -T $zipfile --user $user_info https://api.bintray.com/content/open-ephys-gui/Release/Release-windows/$gui_ver/$zipfile
6268
curl -X POST --user $user_info https://api.bintray.com/content/open-ephys-gui/Release/Release-windows/$gui_ver/publish
69+
cd ../Resources/Installers/Windows
70+
iscc "windows_installer_script.iss"
71+
installer=Open-Ephys_Installer_${gui_ver}.exe
72+
mv Open-Ephys_Installer.exe $installer
73+
curl -T $installer --user $user_info https://api.bintray.com/content/open-ephys-gui/Test-Installer/Test-Installer-windows/$gui_ver/$installer
74+
curl -X POST --user $user_info https://api.bintray.com/content/open-ephys-gui/Test-Installer/Test-Installer-windows/$gui_ver/publish
6375
shell: bash
14.3 MB
Binary file not shown.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
[Setup]
2+
AppName=Open Ephys
3+
AppVersion=0.5.0
4+
AppVerName=Open Ephys 0.5.0
5+
AppPublisher=open-ephys.org
6+
AppPublisherURL=https://open-ephys.org/gui
7+
DefaultDirName={autopf}\Open Ephys
8+
DefaultGroupName=Open Ephys
9+
OutputBaseFilename=Open-Ephys_Installer
10+
OutputDir=.
11+
LicenseFile=..\..\..\Licenses\LICENSE
12+
ArchitecturesAllowed=x64
13+
ArchitecturesInstallIn64BitMode=x64
14+
ChangesAssociations=yes
15+
SetupIconFile="..\..\Build-files\icon.ico"
16+
UninstallDisplayIcon={app}\open-ephys.exe
17+
AllowNoIcons=yes
18+
WizardStyle=modern
19+
20+
[Tasks]
21+
Name: desktopicon; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
22+
Name: install_usb; Description: "Install Opal Kelly Front Panel USB driver for Open Ephys Acquisition Board"; GroupDescription: "External drivers:";
23+
24+
[Files]
25+
Source: "..\..\..\Build\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; BeforeInstall: UpdateProgress(0);
26+
Source: "..\..\DataFiles\*"; DestDir: "{userdocs}\Open Ephys\DataFiles"; Flags: ignoreversion recursesubdirs; BeforeInstall: UpdateProgress(60);
27+
Source: "vcredist_x64.exe"; DestDir: {tmp}; Flags: deleteafterinstall; BeforeInstall: UpdateProgress(70);
28+
Source: "..\..\DLLs\FrontPanelUSB-DriverOnly-4.5.5.exe"; DestDir: {tmp}; Flags: deleteafterinstall; BeforeInstall: UpdateProgress(90);
29+
30+
[Icons]
31+
Name: "{group}\Open Ephys"; Filename: "{app}\open-ephys.exe"
32+
Name: "{autodesktop}\Open Ephys"; Filename: "{app}\open-ephys.exe"; Tasks: desktopicon
33+
Name: "{autoprograms}\Open Ephys"; Filename: "{app}\open-ephys.exe"
34+
35+
[Run]
36+
Filename: "{tmp}\vcredist_x64.exe"; Parameters: "/q /norestart /q:a /c:""VCREDI~3.EXE /q:a /c:""""msiexec /i vcredist.msi /qn"""" """; Check: VCRedistNeedsInstall; WorkingDir: {app}; StatusMsg: "Installing VC++ 2019 Redistributables...";
37+
Filename: "{tmp}\FrontPanelUSB-DriverOnly-4.5.5.exe"; StatusMsg: "Installing Front Panel USB driver..."; Tasks: install_usb; Flags: skipifsilent
38+
39+
[Code]
40+
procedure UpdateProgress(Position: Integer);
41+
begin
42+
WizardForm.ProgressGauge.Position := Position * WizardForm.ProgressGauge.Max div 100;
43+
end;
44+
45+
#IFDEF UNICODE
46+
#DEFINE AW "W"
47+
#ELSE
48+
#DEFINE AW "A"
49+
#ENDIF
50+
type
51+
INSTALLSTATE = Longint;
52+
const
53+
INSTALLSTATE_INVALIDARG = -2; // An invalid parameter was passed to the function.
54+
INSTALLSTATE_UNKNOWN = -1; // The product is neither advertised or installed.
55+
INSTALLSTATE_ADVERTISED = 1; // The product is advertised but not installed.
56+
INSTALLSTATE_ABSENT = 2; // The product is installed for a different user.
57+
INSTALLSTATE_DEFAULT = 5; // The product is installed for the current user.
58+
59+
// Visual C++ 2019 Redistributable 14.25.28508
60+
VC_2019_REDIST_X86_MIN = '{2BC3BD4D-FABA-4394-93C7-9AC82A263FE2}';
61+
VC_2019_REDIST_X64_MIN = '{EEA66967-97E2-4561-A999-5C22E3CDE428}';
62+
63+
VC_2019_REDIST_X86_ADD = '{0FA68574-690B-4B00-89AA-B28946231449}';
64+
VC_2019_REDIST_X64_ADD = '{7D0B74C2-C3F8-4AF1-940F-CD79AB4B2DCE}';
65+
66+
function MsiQueryProductState(szProduct: string): INSTALLSTATE;
67+
external 'MsiQueryProductState{#AW}@msi.dll stdcall';
68+
69+
function VCVersionInstalled(const ProductID: string): Boolean;
70+
begin
71+
Result := MsiQueryProductState(ProductID) = INSTALLSTATE_DEFAULT;
72+
end;
73+
74+
function VCRedistNeedsInstall: Boolean;
75+
begin
76+
Result := not (VCVersionInstalled(VC_2019_REDIST_X64_MIN));
77+
end;

0 commit comments

Comments
 (0)