-
Notifications
You must be signed in to change notification settings - Fork 2
/
InnoSetup.txt
90 lines (74 loc) · 3.75 KB
/
InnoSetup.txt
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
; Script generated by the ASCOM Driver Installer Script Generator 6.0.0.0
; Generated by Everett Quebral on 10/11/2016 (UTC)
;
[Setup]
AppID={{44d473a9-5f1c-43b3-8207-33bfbb38777e}
AppName=ASCOM EQFocuser Focuser Driver
AppVerName=ASCOM EQFocuser Focuser Driver 1.0.8
AppVersion=1.0.8
AppPublisher=Everett Quebral <Everett.Quebral@gmail.com>
AppPublisherURL=mailto:Everett.Quebral@gmail.com
AppSupportURL=http://everettquebral.com/
AppUpdatesURL=http://everettquebral.com/
VersionInfoVersion=1.0.8
MinVersion=0,5.0.2195sp4
DefaultDirName="{cf}\ASCOM\Focuser"
DisableDirPage=yes
DisableProgramGroupPage=yes
OutputDir="."
OutputBaseFilename="EQFocuser 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\Focuser folder created by Platform, always
UninstallFilesDir="{cf}\ASCOM\Uninstall\Focuser\EQFocuser"
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Dirs]
Name: "{cf}\ASCOM\Uninstall\Focuser\EQFocuser"
; TODO: Add subfolders below {app} as needed (e.g. Name: "{app}\MyFolder")
[Files]
Source: "D:\Projects\EQFocuser\EQFocuser\bin\Release\ASCOM.EQFocuser.Focuser.dll"; DestDir: "{app}"
; Require a read-me HTML to appear after installation, maybe driver's Help doc
Source: "D:\Projects\EQFocuser\EQFocuser\ReadMe.htm"; 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.EQFocuser.Focuser.dll"""; Flags: runhidden 32bit
Filename: "{dotnet4064}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.EQFocuser.Focuser.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.EQFocuser.Focuser.dll"""; Flags: runhidden 32bit
; This helps to give a clean uninstall
Filename: "{dotnet4064}\regasm.exe"; Parameters: "/codebase ""{app}\ASCOM.EQFocuser.Focuser.dll"""; Flags: runhidden 64bit; Check: IsWin64
Filename: "{dotnet4064}\regasm.exe"; Parameters: "-u ""{app}\ASCOM.EQFocuser.Focuser.dll"""; Flags: runhidden 64bit; Check: IsWin64
[CODE]
//
// Before the installer UI appears, verify that the (prerequisite)
// ASCOM Platform 6.0 or greater is installed, including both Helper
// components. Utility is required for all types (COM and .NET)!
//
// 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;