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