1
+ ; Script generated by the Inno Setup Script Wizard.
2
+ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3
+
4
+ #define MyAppName " DroneAPI"
5
+ ; #define MyAppVersion "1"
6
+ #define MyAppPublisher " 3D Robotics, Inc"
7
+ #define MyAppURL " https://github.com/diydrones/dronekit-python"
8
+ #define MyAppExeName " "
9
+
10
+ [Setup]
11
+ ; NOTE: The value of AppId uniquely identifies this application.
12
+ ; Do not use the same AppId value in installers for other applications.
13
+ ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
14
+ AppId = {{35EE5962-C212-4874 -90EC-50863DD1537D}
15
+ AppName = {#MyAppName }
16
+ AppVersion = {#MyAppVersion}
17
+ ;AppVerName={#MyAppName} {#MyAppVersion}
18
+ AppPublisher = {#MyAppPublisher}
19
+ AppPublisherURL = {#MyAppURL}
20
+ AppSupportURL = {#MyAppURL}
21
+ AppUpdatesURL = {#MyAppURL}
22
+ CreateAppDir = no
23
+ OutputBaseFilename = DroneAPIsetup-{#MyAppVersion}
24
+ Compression = lzma
25
+ SolidCompression = yes
26
+ LicenseFile = ..\LICENSE
27
+ DisableDirPage = yes
28
+
29
+ [Languages]
30
+ Name : " english" ; MessagesFile : " compiler:Default.isl"
31
+
32
+ [Files]
33
+ Source : " ..\droneapi\*" ; DestDir : " {code:GetMAVProxyPath}\droneapi" ; Flags : ignoreversion recursesubdirs createallsubdirs
34
+ Source : " ..\examples\*" ; DestDir : " {code:GetMAVProxyPath}\examples" ; Flags : ignoreversion recursesubdirs createallsubdirs
35
+ ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
36
+
37
+ ; Check if MAVProxy is installed (if so, get the install path)
38
+ [Code]
39
+ function IsMAVProxyInstalled : boolean;
40
+ begin
41
+ result := RegKeyExists(HKEY_LOCAL_MACHINE,
42
+ ' Software\Microsoft\Windows\CurrentVersion\Uninstall\{D81B9EDA-1357-462E-96E4-B47372709F7C}_is1' );
43
+ end ;
44
+
45
+ function GetMAVProxyPath (Dummy: string): string;
46
+ var
47
+ sInstallPath: string;
48
+ MAVProxyPath: string;
49
+ begin
50
+ MAVProxyPath := ' Software\Microsoft\Windows\CurrentVersion\Uninstall\{D81B9EDA-1357-462E-96E4-B47372709F7C}_is1'
51
+ sInstallPath := ' ' ;
52
+ RegQueryStringValue(HKLM, MAVProxyPath, ' InstallLocation' , sInstallPath);
53
+ Result := sInstallPath;
54
+ end ;
55
+
56
+ function InitializeSetup : boolean;
57
+ begin
58
+ result := IsMAVProxyInstalled;
59
+ if not result then
60
+ MsgBox(' You need to install MAVProxy before you install DroneAPI. Install MAVProxy and then run this installer again.' , mbError, MB_OK);
61
+ end ;
62
+
63
+ function MAVDir_CreatePage (PreviousPageId: Integer): Integer;
64
+ var
65
+ Page: TWizardPage;
66
+ Label1: TLabel;
67
+ MAVDir: TEdit;
68
+ begin
69
+ Page := CreateCustomPage(
70
+ PreviousPageId,
71
+ ' Installation Directory' ,
72
+ ' '
73
+ );
74
+
75
+ Label1 := TLabel.Create(Page);
76
+ with Label1 do
77
+ begin
78
+ Parent := Page.Surface;
79
+ Caption := ' DroneAPI will be installed in the MAVProxy directory:'
80
+ Left := ScaleX(16 );
81
+ Top := ScaleY(0 );
82
+ Width := ScaleX(300 );
83
+ Height := ScaleY(17 );
84
+ end ;
85
+
86
+ MAVDir := TEdit.Create(Page);
87
+ with MAVDir do
88
+ begin
89
+ Parent := Page.Surface;
90
+ Left := ScaleX(16 );
91
+ Top := ScaleY(24 );
92
+ Width := ScaleX(300 );
93
+ Height := ScaleY(25 );
94
+ TabOrder := 0 ;
95
+ Text := GetMAVProxyPath(' ' );
96
+ Enabled := False;
97
+ end
98
+
99
+ end ;
100
+
101
+ procedure InitializeWizard ();
102
+ begin
103
+ MAVDir_CreatePage(wpLicense);
104
+ end ;
0 commit comments