-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rotator Setup.iss
145 lines (126 loc) · 8.3 KB
/
Rotator Setup.iss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
;
; Script generated by the ASCOM Driver Installer Script Generator 6.5.0.0
; Generated by Othmar Ehrhardt on 02.06.2021 (UTC)
;
[Setup]
AppID={{402ba3d5-8078-4399-babd-cf1d10a2f847}
AppName=ASCOM StroblRotator Rotator Driver
AppVerName=ASCOM StroblRotator Rotator Driver 1.2.1
AppVersion=1.2.1
AppPublisher=Othmar Ehrhardt <othmar.ehrhardt@t-online.de>
AppPublisherURL=mailto:othmar.ehrhardt@t-online.de
AppSupportURL=https://ascomtalk.groups.io/g/Help
AppUpdatesURL=https://ascom-standards.org/
VersionInfoVersion=1.2.1
MinVersion=6.1.7601
DefaultDirName="{cf}\ASCOM\Rotator"
DisableDirPage=yes
DisableProgramGroupPage=yes
OutputDir="."
OutputBaseFilename="StroblRotator Setup"
Compression=lzma
SolidCompression=yes
; Put there by Platform if Driver Installer Support selected
WizardImageFile="C:\Program Files (x86)\ASCOM\Platform 6 Developer Components\Installer Generator\Resources\WizardImage.bmp"
LicenseFile="C:\Program Files (x86)\ASCOM\Platform 6 Developer Components\Installer Generator\Resources\CreativeCommons.txt"
; {cf}\ASCOM\Uninstall\Rotator folder created by Platform, always
UninstallFilesDir="{cf}\ASCOM\Uninstall\Rotator\StroblRotator"
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Dirs]
Name: "{cf}\ASCOM\Uninstall\Rotator\StroblRotator"
; TODO: Add subfolders below {app} as needed (e.g. Name: "{app}\MyFolder")
[Files]
Source: "C:\_develop\ASCOM.Stroblhofwarte.Rotator\ASCOM.Stroblhofwarte.Rotator\ASCOM.Stroblhofwarte.Rotator\bin\Release\ASCOM.Stroblhofwarte.Rotator.dll"; DestDir: "{app}"
Source: "C:\_develop\ASCOM.Stroblhofwarte.Rotator\ASCOM.Stroblhofwarte.Rotator\ASCOM.Stroblhofwarte.mqtt.Rotator\bin\Release\ASCOM.Stroblhofwarte.mqtt.Rotator.dll"; DestDir: "{app}"
Source: "C:\_develop\ASCOM.Stroblhofwarte.Rotator\ASCOM.Stroblhofwarte.Rotator\ASCOM.Stroblhofwarte.mqtt.Focuser\bin\Release\ASCOM.Stroblhofwarte.mqtt.Focuser.dll"; DestDir: "{app}"
Source: "C:\_develop\ASCOM.Stroblhofwarte.Rotator\ASCOM.Stroblhofwarte.Rotator\ASCOM.Stroblhofwarte.mqtt.FilterWheel\bin\Release\ASCOM.Stroblhofwarte.mqtt.FilterWheel.dll"; DestDir: "{app}"
Source: "C:\_develop\ASCOM.Stroblhofwarte.Rotator\ASCOM.Stroblhofwarte.Rotator\Signed3rdParty\M2Mqtt.Net.dll"; DestDir: "{app}"
; Require a read-me HTML to appear after installation, maybe driver's Help doc
Source: "C:\_develop\ASCOM.Stroblhofwarte.Rotator\ASCOM.Stroblhofwarte.Rotator\README.html"; DestDir: "{app}"; Flags: isreadme
; TODO: Add other files needed by your driver here (add subfolders above)
; Only if driver is .NET
[Run]
; Only for .NET assembly/in-proc drivers
Filename: "{dotnet4032}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.Stroblhofwarte.Rotator.dll"""; Flags: runhidden 32bit
Filename: "{dotnet4064}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.Stroblhofwarte.Rotator.dll"""; Flags: runhidden 64bit; Check: IsWin64
Filename: "{dotnet4032}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.Stroblhofwarte.mqtt.Rotator.dll"""; Flags: runhidden 32bit
Filename: "{dotnet4064}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.Stroblhofwarte.mqtt.Rotator.dll"""; Flags: runhidden 64bit; Check: IsWin64
Filename: "{dotnet4032}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.Stroblhofwarte.mqtt.Focuser.dll"""; Flags: runhidden 32bit
Filename: "{dotnet4064}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.Stroblhofwarte.mqtt.Focuser.dll"""; Flags: runhidden 64bit; Check: IsWin64
Filename: "{dotnet4032}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.Stroblhofwarte.mqtt.FilterWheel.dll"""; Flags: runhidden 32bit
Filename: "{dotnet4064}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.Stroblhofwarte.mqtt.FilterWheel.dll"""; Flags: runhidden 64bit; Check: IsWin64
; Only if driver is .NET
[UninstallRun]
; Only for .NET assembly/in-proc drivers
Filename: "{dotnet4032}\regasm.exe"; Parameters: "-u ""{app}\ASCOM.Stroblhofwarte.Rotator.dll"""; Flags: runhidden 32bit
Filename: "{dotnet4032}\regasm.exe"; Parameters: "-u ""{app}\ASCOM.Stroblhofwarte.mqtt.Rotator.dll"""; Flags: runhidden 32bit
Filename: "{dotnet4032}\regasm.exe"; Parameters: "-u ""{app}\ASCOM.Stroblhofwarte.mqtt.Focuser.dll"""; Flags: runhidden 32bit
Filename: "{dotnet4032}\regasm.exe"; Parameters: "-u ""{app}\ASCOM.Stroblhofwarte.mqtt.FilterWheel.dll"""; Flags: runhidden 32bit
; This helps to give a clean uninstall
Filename: "{dotnet4064}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.Stroblhofwarte.Rotator.dll"""; Flags: runhidden 64bit; Check: IsWin64
Filename: "{dotnet4064}\regasm.exe"; Parameters: "-u ""{app}\ASCOM.Stroblhofwarte.Rotator.dll"""; Flags: runhidden 64bit; Check: IsWin64
Filename: "{dotnet4064}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.Stroblhofwarte.mqtt.Rotator.dll"""; Flags: runhidden 64bit; Check: IsWin64
Filename: "{dotnet4064}\regasm.exe"; Parameters: "-u ""{app}\ASCOM.Stroblhofwarte.mqtt.Rotator.dll"""; Flags: runhidden 64bit; Check: IsWin64
Filename: "{dotnet4064}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.Stroblhofwarte.mqtt.Focuser.dll"""; Flags: runhidden 64bit; Check: IsWin64
Filename: "{dotnet4064}\regasm.exe"; Parameters: "-u ""{app}\ASCOM.Stroblhofwarte.mqtt.Focuser.dll"""; Flags: runhidden 64bit; Check: IsWin64
Filename: "{dotnet4064}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.Stroblhofwarte.mqtt.FilterWheel.dll"""; Flags: runhidden 64bit; Check: IsWin64
Filename: "{dotnet4064}\regasm.exe"; Parameters: "-u ""{app}\ASCOM.Stroblhofwarte.mqtt.FilterWheel.dll"""; Flags: runhidden 64bit; Check: IsWin64
[Code]
const
REQUIRED_PLATFORM_VERSION = 6.2; // Set this to the minimum required ASCOM Platform version for this application
//
// Function to return the ASCOM Platform's version number as a double.
//
function PlatformVersion(): Double;
var
PlatVerString : String;
begin
Result := 0.0; // Initialise the return value in case we can't read the registry
try
if RegQueryStringValue(HKEY_LOCAL_MACHINE_32, 'Software\ASCOM','PlatformVersion', PlatVerString) then
begin // Successfully read the value from the registry
Result := StrToFloat(PlatVerString); // Create a double from the X.Y Platform version string
end;
except
ShowExceptionMessage;
Result:= -1.0; // Indicate in the return value that an exception was generated
end;
end;
//
// Before the installer UI appears, verify that the required ASCOM Platform version is installed.
//
function InitializeSetup(): Boolean;
var
PlatformVersionNumber : double;
begin
Result := FALSE; // Assume failure
PlatformVersionNumber := PlatformVersion(); // Get the installed Platform version as a double
If PlatformVersionNumber >= REQUIRED_PLATFORM_VERSION then // Check whether we have the minimum required Platform or newer
Result := TRUE
else
if PlatformVersionNumber = 0.0 then
MsgBox('No ASCOM Platform is installed. Please install Platform ' + Format('%3.1f', [REQUIRED_PLATFORM_VERSION]) + ' or later from http://www.ascom-standards.org', mbCriticalError, MB_OK)
else
MsgBox('ASCOM Platform ' + Format('%3.1f', [REQUIRED_PLATFORM_VERSION]) + ' or later is required, but Platform '+ Format('%3.1f', [PlatformVersionNumber]) + ' is installed. Please install the latest Platform before continuing; you will find it at http://www.ascom-standards.org', mbCriticalError, MB_OK);
end;
// Code to enable the installer to uninstall previous versions of itself when a new version is installed
procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: Integer;
UninstallExe: String;
UninstallRegistry: String;
begin
if (CurStep = ssInstall) then // Install step has started
begin
// Create the correct registry location name, which is based on the AppId
UninstallRegistry := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppId")}' + '_is1');
// Check whether an extry exists
if RegQueryStringValue(HKLM, UninstallRegistry, 'UninstallString', UninstallExe) then
begin // Entry exists and previous version is installed so run its uninstaller quietly after informing the user
MsgBox('Setup will now remove the previous version.', mbInformation, MB_OK);
Exec(RemoveQuotes(UninstallExe), ' /SILENT', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
sleep(1000); //Give enough time for the install screen to be repainted before continuing
end
end;
end;