SQL files on Windows installed into share\sql instead of lib\sql
[public/netxms.git] / src / install / windows / common.iss
1 [Dirs]
2 Name: "{app}\etc"
3 Name: "{app}\database"
4 Name: "{app}\dump"
5 Name: "{app}\log"
6 Name: "{app}\var\backgrounds"
7 Name: "{app}\var\files"
8 Name: "{app}\var\images"
9 Name: "{app}\var\packages"
10 Name: "{app}\share"
11
12 [Registry]
13 Root: HKLM; Subkey: "Software\NetXMS"; Flags: uninsdeletekeyifempty; Components: server
14 Root: HKLM; Subkey: "Software\NetXMS\Server"; Flags: uninsdeletekey; Components: server
15 Root: HKLM; Subkey: "Software\NetXMS\Server"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"; Components: server
16 Root: HKLM; Subkey: "Software\NetXMS\Server"; ValueType: string; ValueName: "ConfigFile"; ValueData: "{app}\etc\netxmsd.conf"; Components: server
17
18 [Run]
19 Filename: "{app}\var\rm.exe"; Parameters: "-f ""{app}\bin\*.manifest"""; WorkingDir: "{app}\bin"; StatusMsg: "Removing old manifest files..."; Flags: runhidden
20 Filename: "{app}\var\rm.exe"; Parameters: "-rf ""{app}\bin\Microsoft.VC80.*"""; WorkingDir: "{app}\var"; StatusMsg: "Removing old CRT files..."; Flags: runhidden
21 Filename: "{app}\var\rm.exe"; Parameters: "-rf ""{app}\lib\ndd\Microsoft.VC80.CRT"""; WorkingDir: "{app}\var"; StatusMsg: "Removing old CRT files..."; Flags: runhidden
22 Filename: "{app}\var\rm.exe"; Parameters: "-f ""{app}\bin\libnetxmsw.*"""; WorkingDir: "{app}\bin"; StatusMsg: "Removing old DLL files..."; Flags: runhidden
23 Filename: "{app}\var\rm.exe"; Parameters: "-f ""{app}\bin\libnxclw.*"""; WorkingDir: "{app}\bin"; StatusMsg: "Removing old DLL files..."; Flags: runhidden
24 Filename: "{app}\var\rm.exe"; Parameters: "-f ""{app}\bin\libnxdbw.*"""; WorkingDir: "{app}\bin"; StatusMsg: "Removing old DLL files..."; Flags: runhidden
25 Filename: "{app}\var\rm.exe"; Parameters: "-f ""{app}\bin\libnxmapw.*"""; WorkingDir: "{app}\bin"; StatusMsg: "Removing old DLL files..."; Flags: runhidden
26 Filename: "{app}\var\rm.exe"; Parameters: "-f ""{app}\bin\libnxsnmpw.*"""; WorkingDir: "{app}\bin"; StatusMsg: "Removing old DLL files..."; Flags: runhidden
27 Filename: "{app}\var\rm.exe"; Parameters: "-rf ""{app}\var\mibs"""; WorkingDir: "{app}\bin"; StatusMsg: "Removing old MIB directory..."; Flags: runhidden
28 Filename: "{app}\var\rm.exe"; Parameters: "-rf ""{app}\lib\sql"""; WorkingDir: "{app}\bin"; StatusMsg: "Removing old SQL files..."; Flags: runhidden
29 Filename: "{app}\var\vcredist.exe"; WorkingDir: "{app}\var"; StatusMsg: "Installing Visual C++ runtime..."; Flags: waituntilterminated
30 Filename: "{app}\bin\nxmibc.exe"; Parameters: "-z -d ""{app}\share\mibs"" -o ""{app}\var\netxms.mib"""; WorkingDir: "{app}\bin"; StatusMsg: "Compiling MIB files..."; Flags: runhidden; Components: server
31 Filename: "{app}\bin\nxconfig.exe"; Parameters: "--create-agent-config"; WorkingDir: "{app}\bin"; StatusMsg: "Creating agent's configuration file..."; Components: server
32 Filename: "{app}\bin\nxagentd.exe"; Parameters: "-c ""{app}\etc\nxagentd.conf"" -I"; WorkingDir: "{app}\bin"; StatusMsg: "Installing agent service..."; Flags: runhidden; Components: server
33 Filename: "{app}\bin\nxagentd.exe"; Parameters: "-s"; WorkingDir: "{app}\bin"; StatusMsg: "Starting agent service..."; Flags: runhidden; Components: server
34 Filename: "{app}\bin\nxconfig.exe"; Parameters: "--configure-if-needed"; WorkingDir: "{app}\bin"; StatusMsg: "Running server configuration wizard..."; Components: server
35 Filename: "{app}\bin\nxdbmgr.exe"; Parameters: "-c ""{app}\etc\netxmsd.conf"" upgrade"; WorkingDir: "{app}\bin"; StatusMsg: "Upgrading database..."; Flags: runhidden; Components: server
36 Filename: "{app}\bin\netxmsd.exe"; Parameters: "--check-service"; WorkingDir: "{app}\bin"; StatusMsg: "Checking core service configuration..."; Flags: runhidden; Components: server
37 Filename: "{app}\bin\netxmsd.exe"; Parameters: "-s"; WorkingDir: "{app}\bin"; StatusMsg: "Starting core service..."; Flags: runhidden; Components: server
38
39 [UninstallRun]
40 Filename: "{app}\bin\netxmsd.exe"; Parameters: "-S"; StatusMsg: "Stopping core service..."; RunOnceId: "StopCoreService"; Flags: runhidden; Components: server
41 Filename: "{app}\bin\netxmsd.exe"; Parameters: "-R"; StatusMsg: "Uninstalling core service..."; RunOnceId: "DelCoreService"; Flags: runhidden; Components: server
42 Filename: "{app}\bin\nxagentd.exe"; Parameters: "-S"; StatusMsg: "Stopping agent service..."; RunOnceId: "StopAgentService"; Flags: runhidden; Components: server
43 Filename: "{app}\bin\nxagentd.exe"; Parameters: "-R"; StatusMsg: "Uninstalling agent service..."; RunOnceId: "DelAgentService"; Flags: runhidden; Components: server
44
45 [Code]
46 Var
47 HttpdSettingsPage: TInputQueryWizardPage;
48 flagStartConsole: Boolean;
49
50 #include "firewall.iss"
51
52 Function InitializeSetup(): Boolean;
53 Var
54 i, nCount : Integer;
55 param : String;
56 Begin
57 // Set default values for flags
58 flagStartConsole := FALSE;
59
60 // Parse command line parameters
61 nCount := ParamCount;
62 For i := 1 To nCount Do Begin
63 param := ParamStr(i);
64
65 If Pos('/RUNCONSOLE', param) = 1 Then Begin
66 flagStartConsole := TRUE;
67 End;
68 End;
69
70 Result := TRUE;
71 End;
72
73 Procedure DeinitializeSetup;
74 Var
75 strExecName: String;
76 iResult: Integer;
77 Begin
78 If flagStartConsole Then Begin
79 strExecName := ExpandConstant('{app}\bin\nxcon.exe');
80 If FileExists(strExecName) Then
81 Begin
82 Exec(strExecName, '', ExpandConstant('{app}\bin'), SW_SHOW, ewNoWait, iResult);
83 End;
84 End;
85 End;
86
87 Procedure StopAllServices;
88 Var
89 iResult: Integer;
90 Begin
91 Exec('net.exe', 'stop NetXMSCore', ExpandConstant('{app}\bin'), 0, ewWaitUntilTerminated, iResult);
92 Exec('net.exe', 'stop NetXMSAgentdW32', ExpandConstant('{app}\bin'), 0, ewWaitUntilTerminated, iResult);
93 End;
94
95 Procedure InitializeWizard;
96 Begin
97 HttpdSettingsPage := CreateInputQueryPage(wpSelectTasks,
98 'Select Master Server', 'Where is master server for web interface?',
99 'Please enter host name or IP address of NetXMS master server. NetXMS web interface you are installing will provide connectivity to that server.');
100 HttpdSettingsPage.Add('NetXMS server:', False);
101 HttpdSettingsPage.Values[0] := GetPreviousData('MasterServer', 'localhost');
102 End;
103
104 Procedure RegisterPreviousData(PreviousDataKey: Integer);
105 Begin
106 SetPreviousData(PreviousDataKey, 'MasterServer', HttpdSettingsPage.Values[0]);
107 End;
108
109 Function ShouldSkipPage(PageID: Integer): Boolean;
110 Begin
111 If PageID = HttpdSettingsPage.ID Then
112 Result := not IsComponentSelected('websrv')
113 Else
114 Result := False;
115 End;
116
117 Function GetMasterServer(Param: String): String;
118 Begin
119 Result := HttpdSettingsPage.Values[0];
120 End;
121
122 Procedure CurStepChanged(CurStep: TSetupStep);
123 Begin
124 If CurStep=ssPostInstall Then Begin
125 SetFirewallException('NetXMS Server', ExpandConstant('{app}')+'\bin\netxmsd.exe');
126 SetFirewallException('NetXMS Agent', ExpandConstant('{app}')+'\bin\nxagentd.exe');
127 End;
128 End;
129
130 Procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
131 Begin
132 If CurUninstallStep=usPostUninstall Then Begin
133 RemoveFirewallException(ExpandConstant('{app}')+'\bin\netxmsd.exe');
134 RemoveFirewallException(ExpandConstant('{app}')+'\bin\nxagentd.exe');
135 End;
136 End;