1 se.gupta 1.1 ; Script generated by the Inno Setup Script Wizard.
2 ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3
4 ; define the macros for repository directory and the namespaces here.
5
6 #define REPOSITORY "'repository'"
7 #define NS_PG_INTERNAL "'root/PG_Internal'"
8 #define NS_PG_INTEROP "'root/PG_InterOp'"
9 #define NS_CIMV2 "'root/cimv2'"
10
11 ; define the Schema version to be used for building up the repository.
12 #define VER "'27'"
13
14 ; define the OpenPegasus version for the installable
15 #define OPEN_PEGASUS_VERSION "2.4"
16
17 #define SystemRootdir ReadReg(HKEY_LOCAL_MACHINE,"SOFTWARE\Microsoft\Windows NT\CurrentVersion","SystemRoot")
18 #define PegasusRootDir GetEnv('PEGASUS_HOME')
19
20
21 [Registry]
22 se.gupta 1.1 Root: HKLM; Subkey: "Software\OpenPegasus"; Flags: createvalueifdoesntexist uninsdeletekey
23 Root: HKLM; Subkey: "Software\OpenPegasus"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"
24 Root: HKLM; Subkey: "Software\OpenPegasus"; ValueType: string; ValueName: "Version"; ValueData: "{#OPEN_PEGASUS_VERSION}"
25 Root: HKLM; Subkey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment;ValueType: expandsz; ValueName: Path; ValueData: "{reg:HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment,Path};{app}\OpenPegasus\bin"
26
27 [Setup]
28 AppName=OpenPegasus
29 AppVerName=OpenPegasus {#OPEN_PEGASUS_VERSION}
30 AppPublisher=Open Pegasus Community
31 AppPublisherURL=http://www.openpegasus.org
32 AppSupportURL=http://www.openpegasus.org
33 AppUpdatesURL=http://www.openpegasus.org
34 DefaultDirName={pf}\OpenPegasus
35 DefaultGroupName=OpenPegasus
36
37 [Files]
38 Source: "{#PegasusRootDir}\bin\cimserver.exe" ; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
39 Source: "{#PegasusRootDir}\bin\UserAuthProvider.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
40 Source: "{#PegasusRootDir}\bin\pegCLIClientLib.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
41 Source: "{#PegasusRootDir}\bin\pegclient.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
42 Source: "{#PegasusRootDir}\bin\pegcliutils.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
43 se.gupta 1.1 Source: "{#PegasusRootDir}\bin\pegcommon.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
44 Source: "{#PegasusRootDir}\bin\pegcompiler.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
45 Source: "{#PegasusRootDir}\bin\pegconfig.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
46 Source: "{#PegasusRootDir}\bin\pegexportclient.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
47 Source: "{#PegasusRootDir}\bin\pegexportserver.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
48 Source: "{#PegasusRootDir}\bin\peggetoopt.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
49 Source: "{#PegasusRootDir}\bin\peghandlerservice.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
50 Source: "{#PegasusRootDir}\bin\pegindicationservice.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
51 Source: "{#PegasusRootDir}\bin\peglistener.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
52 Source: "{#PegasusRootDir}\bin\pegprm.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
53 Source: "{#PegasusRootDir}\bin\pegprovider.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
54 Source: "{#PegasusRootDir}\bin\pegprovidermanager.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
55 Source: "{#PegasusRootDir}\bin\pegrepository.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
56 Source: "{#PegasusRootDir}\bin\pegserver.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
57 Source: "{#PegasusRootDir}\bin\peguser.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
58 Source: "{#PegasusRootDir}\bin\pegwql.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
59 Source: "{#PegasusRootDir}\bin\ProviderRegistrationProvider.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
60 Source: "{#PegasusRootDir}\bin\pegauthentication.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
61 Source: "{#PegasusRootDir}\bin\OSProvider.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
62 Source: "{#PegasusRootDir}\bin\ConfigSettingProvider.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
63 Source: "{#PegasusRootDir}\bin\NamespaceProvider.dll"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
64 se.gupta 1.1 ; System files
65 Source: "{#SystemRootdir}\system32\msvcp71.dll"; DestDir: "{app}\OpenPegasus\bin"; Check: MSVCPlusPlusDotNetInstalled
66 Source: "{#SystemRootdir}\system32\msvcr71.dll"; DestDir: "{app}\OpenPegasus\bin"; Check: MSVCPlusPlusDotNetInstalled
67 ; With the above files cimserver runs
68
69 ; This is for schemas
70 Source: "{#PegasusRootDir}\Schemas\*.*"; DestDir: "{app}\OpenPegasus\Schemas"; Flags: ignoreversion recursesubdirs
71 ;Other seven CIMServer Utilities
72 Source: "{#PegasusRootDir}\bin\cimmof.exe"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
73 Source: "{#PegasusRootDir}\bin\cimmofl.exe"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
74 Source: "{#PegasusRootDir}\bin\cimauth.exe"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
75 Source: "{#PegasusRootDir}\bin\cimprovider.exe"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
76 Source: "{#PegasusRootDir}\bin\cimconfig.exe"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
77 Source: "{#PegasusRootDir}\bin\cimuser.exe"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
78
79 ; The following are the test clients, to add more clients to your installable, refer to commented lines below.
80 Source: "{#PegasusRootDir}\bin\CLI.exe"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
81 ;Source: "{#PegasusRootDir}\bin\WebClient.exe"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
82 ;Source: "{#PegasusRootDir}\bin\wbemexec.exe"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
83 ;Source: "{#PegasusRootDir}\bin\CGIClient.exe"; DestDir: "{app}\OpenPegasus\bin"; Flags: ignoreversion
84 ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
85 se.gupta 1.1
86 ; The following are optional sections for future usage. Refer to help file of Inno Setup for help on these sections.
87 [InstallDelete]
88
89 [INI]
90
91 [Tasks]
92
93 [Icons]
94
95 [Run]
96 ; NOTE: The following entry contains an English phrase ("Launch"). You are free to translate it into another language if required.
97 Filename: "{app}\OpenPegasus\bin\cimserver.exe"; Parameters: " -install"; BeforeInstall: InformUser; Check: CIMServerAsWINService
98 Filename: "{app}\OpenPegasus\bin\cimserver.exe"; Parameters: " -start"; Check: CIMServerAsWINService; AfterInstall: BuildRepository
99 Filename: "{app}\OpenPegasus\bin\cimserver.exe"; Parameters: " "; Flags: nowait; BeforeInstall: InformUser; Check: CIMServerAsAnExe; AfterInstall: BuildRepository
100
101 [UninstallDelete]
102 Type: filesandordirs; Name: "{app}\OpenPegasus"
103
104 [UninstallRun]
105 Filename: "{app}\OpenPegasus\bin\cimserver.exe"; Parameters: " -stop"; Check: CIMServiceExists
106 se.gupta 1.1 Filename: "{app}\OpenPegasus\bin\cimserver.exe"; Parameters: " -remove" ; Check: CIMServiceExists
107
108 ; If the user chooses not to install cimserver as a windows service, then we give a wait of 10000 milliseconds
109 ; so that before the repository starts getting builded , cimserver is started. CIMMOFL doesn't seem to help here.
110 [Code]
111
112 var
113 Cimservice: Boolean;
114
115 procedure InformUser();
116 begin
117 MsgBox('There will be a series of Dos prompts opening and closing before the installation finishes, this may take some time.',mbInformation,MB_OK);
118 end;
119
120 procedure BuildRepository();
121 var
122 appPath, params,dirname,filename,cimmof : String;
123 resultCode: Integer;
124 begin
125 appPath := ExpandConstant('{app}') + '\OpenPegasus';
126 cimmof := appPath + '\bin\cimmof.exe';
127 se.gupta 1.1 AddQuotes(cimmof);
128
129 if not Cimservice then
130 MsgBox('Please wait until Cimserver starts (Cmd prompt will show "Cimserver 2.4 , started".',mbInformation,MB_OK);
131
132 dirname := appPath + '\Schemas\CIM' + {#VER};
133 filename := appPath+ '\Schemas\CIM' + {#VER} + '\Core' + {#VER}+'_Qualifiers.mof';
134 params := ' -R ' + {#REPOSITORY} + ' -I ' + AddQuotes(dirname) +' -n ' + {#NS_PG_INTERNAL} + ' ' + AddQuotes(filename);
135 InstExec(cimmof,params, appPath, True, False, SW_SHOWNORMAL, resultCode);
136
137 dirname := appPath + '\Schemas\Pegasus\Internal\VER20';
138 filename := appPath+ '\Schemas\Pegasus\Internal\VER20\PG_InternalSchema20.mof';
139 params := ' -R ' + {#REPOSITORY} + ' -I ' + AddQuotes(dirname) +' -n ' + {#NS_PG_INTERNAL} + ' ' + AddQuotes(filename);
140 InstExec(cimmof,params, appPath, True, False, SW_SHOWNORMAL, resultCode);
141
142 dirname := appPath + '\Schemas\CIM' + {#VER};
143 filename := appPath+ '\Schemas\CIM' + {#VER} + '\CIM_Core' + {#VER}+'.mof';
144 params := ' -R ' + {#REPOSITORY} + ' -I ' + AddQuotes(dirname) +' -n ' + {#NS_PG_INTEROP} + ' ' + AddQuotes(filename);
145 InstExec(cimmof,params, appPath, True, False, SW_SHOWNORMAL, resultCode);
146
147 dirname := appPath + '\Schemas\CIM' + {#VER};
148 se.gupta 1.1 filename := appPath+ '\Schemas\CIM' + {#VER} + '\CIM_Event' + {#VER}+'.mof';
149 params := ' -R ' + {#REPOSITORY} + ' -I ' + AddQuotes(dirname) +' -n ' + {#NS_PG_INTEROP} + ' ' + AddQuotes(filename);
150 InstExec(cimmof,params, appPath, True, False, SW_SHOWNORMAL, resultCode);
151
152 dirname := appPath + '\Schemas\Pegasus\InterOP\VER20';
153 filename := appPath+ '\Schemas\Pegasus\InterOp\VER20\PG_InterOpSchema20.mof';
154 params := ' -R ' + {#REPOSITORY} + ' -I ' + AddQuotes(dirname) +' -n ' + {#NS_PG_INTEROP} + ' ' + AddQuotes(filename);
155 InstExec(cimmof,params, appPath, True, False, SW_SHOWNORMAL, resultCode);
156
157 dirname := appPath + '\Schemas\CIM' + {#VER};
158 filename := appPath+ '\Schemas\CIM' + {#VER} + '\CIM_Schema' + {#VER}+'.mof';
159 params := ' -R ' + {#REPOSITORY} + ' -I ' + AddQuotes(dirname) +' -n ' + {#NS_CIMV2} + ' ' + AddQuotes(filename);
160 InstExec(cimmof,params, appPath, True, False, SW_SHOWNORMAL, resultCode);
161
162 dirname := appPath + '\Schemas\Pegasus\ManagedSystem\VER20';
163 filename := appPath+ '\Schemas\Pegasus\ManagedSystem\VER20\PG_ManagedSystemSchema20.mof';
164 params := ' -R ' + {#REPOSITORY} + ' -I ' + AddQuotes(dirname) +' -n ' + {#NS_CIMV2} + ' ' + AddQuotes(filename);
165 InstExec(cimmof,params, appPath, True, False, SW_SHOWNORMAL, resultCode);
166
167 dirname := appPath + '\Schemas\Pegasus\ManagedSystem\VER20';
168 filename := appPath+ '\Schemas\Pegasus\ManagedSystem\VER20\PG_ManagedSystemSchema20R.mof';
169 se.gupta 1.1 params := ' -R ' + {#REPOSITORY} + ' -I ' + AddQuotes(dirname) +' -n ' + {#NS_PG_INTEROP} + ' ' + AddQuotes(filename);
170 InstExec(cimmof,params, appPath, True, False, SW_SHOWNORMAL, resultCode);
171
172 end;
173
174 function InitializeSetup(): Boolean;
175 var
176 OpenPegasusFound: Boolean;
177 str : String;
178 begin
179 str := 'SOFTWARE\OpenPegasus';
180 OpenPegasusFound := RegKeyExists(HKLM,str);
181 if not OpenPegasusFound then
182 begin
183 Result := True
184 Cimservice := MsgBox('Would you like to install OpenPegasus as a Windows Service', mbConfirmation, MB_YESNO) = idYes;
185 end
186 else
187 begin
188 MsgBox('OpenPegasus is already installed , please uninstall the old version first.(Setup will exit)',mbInformation,MB_OK);
189 Result := False;
190 se.gupta 1.1 end
191 end;
192
193 function NeedRestart(): Boolean;
194 begin
195 Result := True
196 end;
197
198 function MSVCPlusPlusDotNetInstalled(): Boolean;
199 begin
200 Result := True;
201 if FileExists(ExpandConstant('{#SystemRootDir}\System32\msvcp71.dll')) then
202 begin
203 if FileExists(ExpandConstant('{#SystemRootDir}\System32\msvcp71.dll')) then
204 begin
205 Result := False;
206 end;
207 end;
208 end;
209
210 function CIMServerAsWINService: Boolean;
211 se.gupta 1.1 begin
212 Result := Cimservice;
213 end;
214
215 function CIMServerAsAnExe: Boolean;
216 begin
217 Result := False;
218 if not Cimservice then
219 begin
220 Result := True;
221 end;
222 end;
223
224 function CIMServiceExists:Boolean;
225 begin
226 Result := False;
227 if Cimservice then
228 begin
229 Result := True;
230 end;
231 end;
232 se.gupta 1.1
233
234
235
236
237
238
239
240
241
|