source: raptor-distribution/MSIs/raptor-mua/tags/v1.0.1/raptor-mua.wxs @ 1725

Revision 1725, 11.4 KB checked in by rhyssmith, 5 years ago (diff)

Tagging raptor-mua v1.0.1-1 release of Raptor MUA MSI

  • 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='65a54353-a655-4347-badf-bbe005fdd3bd'
5      Name='Raptor MUA'
6      UpgradeCode='e5bc6976-ce2f-4a02-9332-47c5f7b3ecc7'
7      Manufacturer='Cardiff University'
8      Language='1033'
9      Codepage='1252'
10      Version='1.0.1'>
11
12        <Package Id='*'
13          Description='Raptor MUA'
14          Comments='Raptor MUA v1.0.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 <>""]]></Custom>
54            <Custom Action='SetUninstalling' After='SetUpgrading'><![CDATA[(REMOVE="feaRaptorMua,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 <>""]]></Custom>
60            <Custom Action='SetUninstalling' After='SetUpgrading'><![CDATA[(REMOVE="feaRaptorMua,Complete" OR REMOVE="ALL") AND NOT Upgrading]]></Custom>
61        </InstallUISequence>
62
63
64
65        <!--
66            #####################
67            # Requirements checks
68            #####################
69        -->
70
71        <!-- Only allow MSI to run if the user is an administrator (required to install/uninstall service through custom action) -->
72        <Property Id='MSIUSEREALADMINDETECTION' Value='1' />
73        <Condition Message='You need to be an administrator to install this product. Setup will now exit.'>Privileged</Condition>
74
75        <!-- Only allow MSI to run if Java is installed and we can get JAVA_HOME -->
76        <Property Id='JAVA_VERSION'>
77            <RegistrySearch Id='JavaVersionSearch' Root='HKLM' Key='SOFTWARE\JavaSoft\Java Runtime Environment' Name='CurrentVersion' Type='raw' />
78        </Property>
79        <Property Id='JAVA_HOME'>
80            <RegistrySearch Id='JavaHomeSearch' Root='HKLM' Key='SOFTWARE\JavaSoft\Java Runtime Environment\[JAVA_VERSION]' Name='JavaHome' Type='raw' />
81        </Property>
82        <Condition Message='You must install a Java JRE/JDK prior to installing this package. Setup will now exit.' ><![CDATA[JAVA_HOME <>""]]></Condition>
83
84
85
86        <!--
87            ################
88            # File Structure
89            ################
90        -->
91
92        <!-- Have to define the toplevel bit (do not even try to understand this line. It just always has to be here... -->
93        <Directory Id='TARGETDIR' Name='SourceDir'>
94
95            <!-- Install to the standard Program Files folder -->
96            <Directory Id='ProgramFilesFolder' Name='PFiles'>
97
98                <!-- Everything goes under \Program Files\Raptor -->
99                <Directory Id='RAPTORDIR' Name='Raptor'>
100
101                    <!-- Since this is the MUA, put it in \Program Files\Raptor\MUA -->
102                    <Directory Id='RAPTORMUADIR' Name='MUA'>
103
104                        <!-- All files will be installed here! -->
105
106                        <!-- This component will set the Environmental Variables for Raptor -->
107                        <Component Id='cmpRaptorMuaEnvVarHome' Guid='c00a5464-3916-49f6-8e74-919d55ff8557'>
108                            <CreateFolder />
109                            <Environment Id='SetRaptorMuaEnvVarHome'
110                              Action='set'
111                              Part='all'
112                              Name='RAPTOR_MUA_HOME'
113                              Permanent='no'
114                              System='yes'
115                              Value='[RAPTORMUADIR]' />
116                        </Component>
117
118                    </Directory>
119
120                </Directory>
121
122            </Directory>
123
124        </Directory>
125
126
127       
128        <!--
129            ##########
130            # Features
131            ##########
132        -->
133
134        <Feature Id='Complete'
135          Title='Raptor MUA v1.0.1'
136          Description='The complete package for the Raptor MUA.'
137          Display='expand'
138          Level='1'
139          ConfigurableDirectory='RAPTORDIR'>
140     
141            <Feature Id='feaRaptorMua' Title='Raptor MUA v1.0.1' Description='Raptor MUA v1.0.1' Level='1' AllowAdvertise='no' Absent='disallow'>
142                <ComponentGroupRef Id='cgrRaptorMuaRoot' />
143                <ComponentGroupRef Id='cgrRaptorMuaBatchImport' />
144                <ComponentGroupRef Id='cgrRaptorMuaBin' />
145                <ComponentGroupRef Id='cgrRaptorMuaConf' />
146                <ComponentGroupRef Id='cgrRaptorMuaKeys' />
147                <ComponentGroupRef Id='cgrRaptorMuaLib' />
148                <ComponentGroupRef Id='cgrRaptorMuaLogs' />
149                <ComponentRef Id='cmpRaptorMuaEnvVarHome' />
150            </Feature>
151
152        </Feature>
153
154
155
156        <!--
157            ###########################################
158            # Custom Actions - Service install/unistall
159            ###########################################
160        -->
161
162        <!-- Run the batch file that installs/uninstalls the service. Cannot use normal WiX thing for this due to use of java wrapper -->
163        <CustomAction Id='InstallMuaService' FileKey='filRaptorMuaBinMuaBat' ExeCommand='install' />
164        <CustomAction Id='UninstallMuaService' FileKey='filRaptorMuaBinMuaBat' ExeCommand='remove' />
165
166        <!-- Run the same batch file to start/stop/restart the service. -->
167        <CustomAction Id='StartMuaService' FileKey='filRaptorMuaBinMuaBat' ExeCommand='start' />
168        <CustomAction Id='StopMuaService' FileKey='filRaptorMuaBinMuaBat' ExeCommand='stop' />
169        <CustomAction Id='RestartMuaService' FileKey='filRaptorMuaBinMuaBat' ExeCommand='restart' />
170
171        <!-- Horrible hack. When upgrading, the restarting happens twice. So this stops it happening the first time... -->
172        <CustomAction Id='SetAlreadyRun' Property='AlreadyRun' Value='true' />
173
174
175        <!-- When installing, install service and start it -->
176        <InstallExecuteSequence>
177            <Custom Action='InstallMuaService' After='RunKeytoolExportMuaPublicKey'>Installing</Custom>
178            <Custom Action='StartMuaService' After='InstallMuaService'>Installing</Custom>
179        </InstallExecuteSequence>
180
181        <!-- When uninstalling, uninstall service (automagically stops it first) -->
182        <InstallExecuteSequence>
183            <Custom Action='StopMuaService' After='UnpublishFeatures'>Uninstalling</Custom>
184            <Custom Action='UninstallMuaService' After='StopMuaService'>Uninstalling</Custom>
185        </InstallExecuteSequence>
186
187        <!-- When upgrading, restart service (the second time this part of the IES happens) -->
188        <InstallExecuteSequence>
189            <Custom Action='RestartMuaService' After='StartServices'>Upgrading AND AlreadyRun</Custom>
190            <Custom Action='SetAlreadyRun' After='RestartMuaService'>Upgrading</Custom>
191        </InstallExecuteSequence>
192
193
194
195        <!--
196            ##############################
197            # Custom Actions - Java keygen
198            ##############################
199        -->
200
201        <!-- Set the path to the JRE keytool exe and how to run it -->
202        <CustomAction Id='SetKeytoolPath' Property='KeytoolPath' Value='[JAVA_HOME]\bin\keytool.exe' />
203
204        <!-- Create the java keystore with private key -->
205        <CustomAction Id='RunKeytoolCreateMuaPrivateKey' Property='KeytoolPath' ExeCommand='-genkey -alias raptormua -keystore "[RAPTORMUADIR]keys\raptor-mua.jks" -storepass changeit -keypass changeit -dname "CN=[ComputerName],ou=MUA,o=Raptor" -validity 7300 -keyalg RSA -keysize 2048' Return='check' />
206
207        <!-- Export the public key from the keystore -->
208        <CustomAction Id='RunKeytoolExportMuaPublicKey' Property='KeytoolPath' ExeCommand='-export -alias raptormua -keystore "[RAPTORMUADIR]keys\raptor-mua.jks" -storepass changeit -file "[RAPTORMUADIR]keys\raptor-mua-public.crt"' Return='check' />
209
210        <InstallExecuteSequence>
211            <Custom Action='SetKeytoolPath' After='AppSearch'>JAVA_HOME</Custom>
212            <Custom Action='RunKeytoolCreateMuaPrivateKey' After='InstallFinalize'>JAVA_HOME And Installing</Custom>
213            <Custom Action='RunKeytoolExportMuaPublicKey' After='RunKeytoolCreateMuaPrivateKey'>JAVA_HOME And Installing</Custom>
214        </InstallExecuteSequence>
215
216
217
218        <!--
219            ########################
220            # Guess at Config Values
221            ########################
222        -->
223
224        <!-- Metadata values -->
225        <Property Id='MUAENTITYID' Value='https://thisservername.example.com/raptor-mua' />
226        <Property Id='MUAORGANISATIONNAME' Value='Example University' />
227        <Property Id='MUASERVICENAME' Value='Raptor MUA' />
228        <Property Id='MUACONTACTEMAIL' Value='someone@example.com' />
229
230
231
232        <!--
233            ################
234            # User Interface
235            ################
236        -->
237 
238        <!-- Add/Remove Programs Stuff -->
239        <Icon Id='Raptor.exe' SourceFile='source\installer\raptor.ico' />
240        <Property Id='ARPPRODUCTICON' Value='Raptor.exe' />
241        <Property Id='ARPHELPLINK' Value='http://iam.cf.ac.uk/Raptor' />
242
243        <!-- Variables for the UI -->
244        <WixVariable Id='WixUILicenseRtf' Value='source\installer\License.rtf' />
245        <WixVariable Id='WixUIBannerBmp' Value='source\installer\raptor-msi-banner.bmp' />
246        <WixVariable Id='WixUIDialogBmp' Value='source\installer\raptor-msi-dialog.bmp' />
247
248        <!-- Change to Mondo style -->
249        <UI Id='RaptorWixUI'>
250            <UIRef Id='WixUI_FeatureTree' />
251            <UIRef Id='WixUI_ErrorProgressText' />
252
253            <DialogRef Id='RaptorMsiDlgMuaMetadata' />
254
255            <Publish Dialog='CustomizeDlg' Control='Next' Event='NewDialog' Value='RaptorMsiDlgMuaMetadata'>Installing</Publish>
256            <Publish Dialog='VerifyReadyDlg' Control='Back' Event='NewDialog' Value='RaptorMsiDlgMuaMetadata'>Installing</Publish>
257        </UI>
258
259    </Product>
260</Wix>
Note: See TracBrowser for help on using the repository browser.