source: raptor-distribution/MSIs/raptor-web/trunk/raptor-web.wxs @ 1747

Revision 1747, 12.7 KB checked in by rhyssmith, 5 years ago (diff)

Adding raptor-web v1.2.1 MSI sources

  • Property svn:executable set to *
Line 
1<?xml version='1.0'?>
2<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
3
4    <Product Id='51bdd125-ce44-4212-894f-c35ec6777f75'
5      Name='Raptor Web'
6      UpgradeCode='fe94dcab-4c5e-4277-a83d-bdceebc23ee3'
7      Manufacturer='Cardiff University'
8      Language='1033'
9      Codepage='1252'
10      Version='1.2.1'>
11
12        <Package Id='*'
13          Description='Raptor Web'
14          Comments='Raptor Web v1.2.1'
15          Manufacturer='Cardiff University'
16          InstallerVersion='301'
17          SummaryCodepage='1252'
18          AdminImage='yes'
19          InstallPrivileges='elevated'
20          InstallScope='perMachine'
21          Compressed='yes' />
22
23
24
25        <!--
26            #############
27            # MSI options
28            #############
29        -->
30
31        <!-- Allows upgrading of software. Schedule changed from default to not delete configured conf files on upgrade -->
32        <MajorUpgrade
33          Schedule='afterInstallExecute'
34          DowngradeErrorMessage='A later version of [ProductName] is already installed. Setup will now exit.'/>
35
36        <!-- Embeds all source into a single .cab file in the MSI -->
37        <Media Id='1' Cabinet='Product.cab' EmbedCab='yes' />
38
39
40
41        <!--
42            #####################################
43            # Figure out what the MSI is doing...
44            #####################################
45        -->
46
47        <CustomAction Id='SetINSTALLING' Property='INSTALLING' Value='true' />
48        <CustomAction Id='SetUPGRADING' Property='UPGRADING' Value='true' />
49        <CustomAction Id='SetUNINSTALLING' Property='UNINSTALLING' Value='true' />
50
51        <InstallExecuteSequence>
52            <Custom Action='SetINSTALLING' After='FindRelatedProducts'><![CDATA[NOT Installed AND NOT WIX_UPGRADE_DETECTED <>""]]></Custom>
53            <Custom Action='SetUPGRADING' After='SetINSTALLING'><![CDATA[WIX_UPGRADE_DETECTED <>"" OR UPGRADINGPRODUCTCODE <>""]]></Custom>
54            <Custom Action='SetUNINSTALLING' After='SetUPGRADING'><![CDATA[(REMOVE="feaRaptorWeb,Complete" OR REMOVE="ALL") AND NOT UPGRADING]]></Custom>
55        </InstallExecuteSequence>
56
57        <InstallUISequence>
58            <Custom Action='SetINSTALLING' After='FindRelatedProducts'><![CDATA[NOT Installed AND NOT WIX_UPGRADE_DETECTED <>""]]></Custom>
59            <Custom Action='SetUPGRADING' After='SetINSTALLING'><![CDATA[WIX_UPGRADE_DETECTED <>"" OR UPGRADINGPRODUCTCODE <>""]]></Custom>
60            <Custom Action='SetUNINSTALLING' After='SetUPGRADING'><![CDATA[(REMOVE="feaRaptorWeb,Complete" OR REMOVE="ALL") AND NOT UPGRADING]]></Custom>
61        </InstallUISequence>
62
63
64        <!--
65            #####################
66            # Requirements checks
67            #####################
68        -->
69
70        <!-- Only allow MSI to run if the user is an administrator (required to install/uninstall service through custom action) -->
71        <Property Id='MSIUSEREALADMINDETECTION' Value='1' />
72        <Condition Message='You need to be an administrator to install this product. Setup will now exit.'>Privileged</Condition>
73
74        <!-- Only allow MSI to run if Java is installed and we can get JAVA_HOME -->
75        <Property Id='JAVA_VERSION'>
76            <RegistrySearch Id='JavaVersionSearch' Root='HKLM' Key='SOFTWARE\JavaSoft\Java Runtime Environment' Name='CurrentVersion' Type='raw' />
77        </Property>
78        <Property Id='JAVA_HOME'>
79            <RegistrySearch Id='JavaHomeSearch' Root='HKLM' Key='SOFTWARE\JavaSoft\Java Runtime Environment\[JAVA_VERSION]' Name='JavaHome' Type='raw' />
80        </Property>
81        <Condition Message='You must install a Java JRE/JDK prior to installing this package. Setup will now exit.' ><![CDATA[JAVA_HOME <>""]]></Condition>
82
83
84
85        <!--
86            ################
87            # File Structure
88            ################
89        -->
90       
91        <!-- Have to define the toplevel bit (do not even try to understand this line. It just always has to be here... -->
92        <Directory Id='TARGETDIR' Name='SourceDir'>
93
94            <!-- Install to the standard Program Files folder -->
95            <Directory Id='ProgramFilesFolder' Name='PFiles'>
96
97                <!-- Everything goes under \Program Files\Raptor -->
98                <Directory Id='RAPTORDIR' Name='Raptor'>
99
100                    <!-- Since this is the Web, put it in \Program Files\Raptor\Web -->
101                    <Directory Id='RAPTORWEBDIR' Name='Web'>
102   
103                        <!-- All files will be installed here! -->
104
105                        <!-- This component will set the Environmental Variables for Raptor -->
106                        <Component Id='cmpRaptorWebEnvVarHome' Guid='99df8133-7121-48fb-880b-8b1f1127f274'>
107                            <CreateFolder />
108                            <Environment Id='SetRaptorWebEnvVarHome'
109                              Action='set'
110                              Part='all'
111                              Name='RAPTOR_WEB_HOME'
112                              Permanent='no'
113                              System='yes'
114                              Value='[RAPTORWEBDIR]' />
115                        </Component>
116
117                    </Directory>
118               
119                </Directory>
120       
121            </Directory>
122           
123        </Directory>
124       
125
126       
127        <!--
128            ##########
129            # Features
130            ##########
131        -->
132
133        <Feature Id='Complete'
134          Title='Raptor Web v1.2.1'
135          Description='The complete package for Raptor Web.'
136          Display='expand'
137          Level='1'
138          ConfigurableDirectory='RAPTORDIR'>
139     
140            <Feature Id='feaRaptorWeb' Title='Raptor Web v1.2.1' Description='Raptor Web v1.2.1' Level='1' AllowAdvertise='no' Absent='disallow'>
141                <ComponentGroupRef Id='cgrRaptorWebRoot' />
142                <ComponentGroupRef Id='cgrRaptorWebBin' />
143                <ComponentGroupRef Id='cgrRaptorWebConf' />
144                <ComponentGroupRef Id='cgrRaptorWebKeys' />
145                <ComponentGroupRef Id='cgrRaptorWebLib' />
146                <ComponentGroupRef Id='cgrRaptorWebLogs' />
147                <ComponentGroupRef Id='cgrRaptorWebWebapp' />
148                <ComponentRef Id='cmpRaptorWebEnvVarHome' />
149            </Feature>
150
151        </Feature>
152
153
154
155        <!--
156            ###########################################
157            # Custom Actions - Service install/unistall
158            ###########################################
159        -->
160
161        <!-- Run the batch file that installs/uninstalls the service. Cannot use normal WiX thing for this due to use of java wrapper -->
162        <CustomAction Id='InstallWebService' FileKey='filRaptorWebBinWebBat' ExeCommand='install' />
163        <CustomAction Id='UninstallWebService' FileKey='filRaptorWebBinWebBat' ExeCommand='remove' />
164
165        <!-- Run the same batch file to start/stop/restart the service. -->
166        <CustomAction Id='StartWebService' FileKey='filRaptorWebBinWebBat' ExeCommand='start' />
167        <CustomAction Id='StopWebService' FileKey='filRaptorWebBinWebBat' ExeCommand='stop' />
168        <CustomAction Id='RestartWebService' FileKey='filRaptorWebBinWebBat' ExeCommand='restart' />
169
170        <!-- Special actions for Raptor v1.2.1 only -->
171        <CustomAction Id='InstallWebServiceSpecial' FileKey='filRaptorWebBinWebBat' ExeCommand='install' />
172        <CustomAction Id='StartWebServiceSpecial' FileKey='filRaptorWebBinWebBat' ExeCommand='start' />
173
174
175        <!-- When installing, install service and start it -->
176        <InstallExecuteSequence>
177            <Custom Action='InstallWebService' After='RunKeytoolExportWebPublicKey'>INSTALLING</Custom>
178            <Custom Action='StartWebService' After='InstallFinalize'>INSTALLING</Custom>
179        </InstallExecuteSequence>
180
181        <!-- When uninstalling, uninstall service (automagically stops it first) -->
182        <InstallExecuteSequence>
183            <Custom Action='StopWebService' After='UnpublishFeatures'>UNINSTALLING</Custom>
184            <Custom Action='UninstallWebService' After='StopWebService'>UNINSTALLING</Custom>
185        </InstallExecuteSequence>
186
187        <!-- When upgrading, restart service -->
188        <InstallExecuteSequence>
189            <!-- For Raptor v1.2.1 only, install service and start since previous versions will uninstall stuff incorrectly -->
190            <Custom Action='InstallWebServiceSpecial' After='InstallFinalize'><![CDATA[UPGRADING AND REMOVE<>"ALL"]]></Custom>
191            <Custom Action='StartWebServiceSpecial' After='InstallWebServiceSpecial'><![CDATA[UPGRADING AND REMOVE<>"ALL"]]></Custom>
192
193            <!-- This is what would normally be called - restart only -->
194            <Custom Action='RestartWebService' After='StartServices'><![CDATA[UPGRADING AND REMOVE="ALL"]]></Custom>
195        </InstallExecuteSequence>
196
197
198
199        <!--
200            ##############################
201            # Custom Actions - Java keygen
202            ##############################
203        -->
204
205        <!-- Set the path to the JRE keytool exe and how to run it -->
206        <CustomAction Id='SetKeytoolPath' Property='KeytoolPath' Value='[JAVA_HOME]\bin\keytool.exe' />
207
208        <!-- Create the java keystore with private key -->
209        <CustomAction Id='RunKeytoolCreateWebPrivateKey' Property='KeytoolPath' ExeCommand='-genkey -alias raptorweb -keystore "[RAPTORWEBDIR]keys\raptor-web.jks" -storepass changeit -keypass changeit -dname "CN=[ComputerName],ou=WEB,o=Raptor" -validity 7300 -keyalg RSA -keysize 2048' Return='check' />
210
211        <!-- Export the public key from the keystore -->
212        <CustomAction Id='RunKeytoolExportWebPublicKey' Property='KeytoolPath' ExeCommand='-export -alias raptorweb -keystore "[RAPTORWEBDIR]keys\raptor-web.jks" -storepass changeit -file "[RAPTORWEBDIR]keys\raptor-web-public.crt"' Return='check' />
213
214        <InstallExecuteSequence>
215            <Custom Action='SetKeytoolPath' After='AppSearch'>JAVA_HOME</Custom>
216            <Custom Action='RunKeytoolCreateWebPrivateKey' After='InstallFinalize'>JAVA_HOME And INSTALLING</Custom>
217            <Custom Action='RunKeytoolExportWebPublicKey' After='RunKeytoolCreateWebPrivateKey'>JAVA_HOME And INSTALLING</Custom>
218        </InstallExecuteSequence>
219       
220
221
222        <!--
223            ##############################
224            # Custom Actions - Backup of files
225            ##############################
226        -->
227
228        <Binary Id='BackupConfigFileSrc' SourceFile='source\installer\raptor_vb_webconf.vbs' />
229
230        <CustomAction Id='BackupConfigFiles' BinaryKey='BackupConfigFileSrc' VBScriptCall='' Execute='deferred' Impersonate='no' />
231        <CustomAction Id='SetBackupConfigFiles' Property='BackupConfigFiles' Value='[RAPTORWEBDIR]' />
232
233        <!-- Schedule these CAs to run -->
234        <InstallExecuteSequence>
235            <Custom Action='SetBackupConfigFiles' Before='CostInitialize'></Custom>
236            <Custom Action='BackupConfigFiles' After='InstallInitialize'><![CDATA[UPGRADING AND REMOVE<>"ALL"]]></Custom>
237        </InstallExecuteSequence>
238
239
240
241        <!--
242            ########################
243            # Guess at Config Values
244            ########################
245        -->
246
247        <!-- Metadata values -->
248        <Property Id='WEBENTITYID' Value='https://thisservername.example.com/raptor-web' />
249        <Property Id='WEBORGANISATIONNAME' Value='Example University' />
250        <Property Id='WEBSERVICENAME' Value='Raptor Web' />
251        <Property Id='WEBCONTACTEMAIL' Value='someone@example.com' />
252
253
254
255        <!--
256            ################
257            # User Interface
258            ################
259        -->
260 
261        <!-- Add/Remove Programs Stuff -->
262        <Icon Id='Raptor.ico' SourceFile='source\installer\raptor.ico' />
263        <Property Id='ARPPRODUCTICON' Value='Raptor.ico' />
264        <Property Id='ARPHELPLINK' Value='http://iam.cf.ac.uk/Raptor' />
265
266        <!-- Variables for the UI -->
267        <WixVariable Id='WixUILicenseRtf' Value='source\installer\License.rtf' />
268        <WixVariable Id='WixUIBannerBmp' Value='source\installer\raptor-msi-banner.bmp' />
269        <WixVariable Id='WixUIDialogBmp' Value='source\installer\raptor-msi-dialog.bmp' />
270
271        <!-- Change to Mondo style -->
272        <UI Id='RaptorWixUI'>
273            <UIRef Id='WixUI_FeatureTree' />
274            <UIRef Id='WixUI_ErrorProgressText' />
275
276            <DialogRef Id='RaptorMsiDlgWebMetadata' />
277
278            <Publish Dialog='CustomizeDlg' Control='Next' Event='NewDialog' Value='RaptorMsiDlgWebMetadata'>INSTALLING</Publish>
279            <Publish Dialog='VerifyReadyDlg' Control='Back' Event='NewDialog' Value='RaptorMsiDlgWebMetadata'>INSTALLING</Publish>
280        </UI>
281
282    </Product>
283</Wix>
Note: See TracBrowser for help on using the repository browser.