Handle Updates a bit better
[shibboleth/sp.git] / msi / WiX / ShibbolethSP-noarch.wxs
1 <?xml version='1.0' encoding='UTF-8'?>\r
2 <!-- Licensed to the University Corporation for Advanced Internet\r
3      Development, Inc. (UCAID) under one or more contributor license\r
4      agreements.  See the NOTICE file distributed with this work for\r
5      additional information regarding copyright ownership. The UCAID\r
6      licenses this file to You under the Apache License, Version 2.0\r
7      (the 'License'); you may not use this file except in compliance\r
8      with the License.  You may obtain a copy of the License at\r
9      \r
10      http://www.apache.org/licenses/LICENSE-2.0\r
11      \r
12      Unless required by applicable law or agreed to in writing, software\r
13      distributed under the License is distributed on an 'AS IS' BASIS,\r
14      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
15      implied.  See the License for the specific language governing\r
16      permissions and limitations under the License.  -->\r
17 \r
18 <?include Versions.wxi ?>\r
19 \r
20 <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\r
21   <!--\r
22     This is where we put all the architecture neutral bits of the\r
23     Shibboleth install.  It turns out that it may not be all the\r
24     architecture insenstive stuff since some GUIDS may have moved\r
25   -->\r
26   <Fragment>\r
27     <!-- Files First -->\r
28     <!-- Configuration, licenses and documentation -->\r
29 \r
30     <DirectoryRef Id='INSTALLDIR'>\r
31       <Directory Id='doc' Name='doc' >\r
32         <Directory Id='doc_shibboleth' Name='shibboleth' FileSource='$(var.SPBuildDirectory)\cpp-sp\doc' >\r
33           <Component Id='main.css' Guid='{EA1366EE-0FD1-42E7-9F3F-C19E6C0D12D6}'>\r
34             <File KeyPath='yes' Name='main.css' />\r
35           </Component>\r
36           <Component Id='logo.jpg' Guid='{7F05E91A-A390-4A72-B4DC-1A4FE950B30A}'>\r
37             <File KeyPath='yes' Name='logo.jpg' />\r
38           </Component>\r
39           <Component Id='CREDITS.txt' Guid='{9A792E0C-61F1-4D08-9672-BE82FFB6B7F1}'>\r
40             <File KeyPath='yes' Name='CREDITS.txt' />\r
41           </Component>\r
42           <Component Id='LICENSE.txt' Guid='{404E7A3C-22C2-4A02-8DC0-7D5C0B25DED1}'>\r
43             <File KeyPath='yes' Name='LICENSE.txt' />\r
44           </Component>\r
45           <Component Id='NOTICE.txt' Guid='{80619251-6754-480A-AFAA-D7398482053C}'>\r
46             <File KeyPath='yes' Name='NOTICE.txt' />\r
47           </Component>\r
48           <Component Id='README.txt' Guid='{2E5A28EE-B70B-402B-8E6F-72E8EC1EEF0D}'>\r
49             <File KeyPath='yes' Name='README.txt'/>\r
50           </Component>\r
51           <Component Id='RELEASE.txt' Guid='{5822AF4E-BE53-4952-B662-6BE2D3913D31}'>\r
52             <File KeyPath='yes' Name='RELEASE.txt' />\r
53           </Component>\r
54         </Directory><!-- doc_shibboleth -->\r
55       </Directory><!-- doc -->\r
56       <Directory Id='etc' Name='etc' >\r
57         <Directory Id='etc_shibboleth' Name='shibboleth' FileSource='$(var.SPBuildDirectory)\cpp-sp\configs'>\r
58           <Component Id='upgrade.xsl' Guid='{D8D1270C-2F85-4465-8EC0-F5F30A2B3EDD}'>\r
59             <File KeyPath='yes' Name='upgrade.xsl' />\r
60           </Component>\r
61           <Component Id='example_metadata.xml' Guid='{D9852008-249D-405D-8059-5DAD307D2723}' Permanent='yes'>\r
62             <File KeyPath='yes' Name='example-metadata.xml' />\r
63           </Component>\r
64           <Component Id='example_shibboleth2.xml' Guid='{85415A41-2B4E-406F-9CFC-63CFC360A9C7}' Permanent='yes'>\r
65             <File KeyPath='yes' Name='example-shibboleth2.xml' />\r
66           </Component>\r
67           <Component Id='keygen.bat' Guid='{A5BBCB8B-42B3-4402-B66D-66D2971F509F}'>\r
68             <File KeyPath='yes' Name='keygen.bat'/>\r
69           </Component>\r
70           <Component Id='xsltproc.js' Guid='{B87F4A53-3C37-45DA-BE6F-C46790FA7C2D}'>\r
71             <File KeyPath='yes' Name='xsltproc.js' />\r
72           </Component>\r
73           <Directory Id='etc_shibboleth_dist' Name='dist' FileSource='$(var.SPBuildDirectory)\cpp-sp\configs'>\r
74             <Component Id='apache.config.in' Guid='{AF4EB2B1-2489-4E39-A89E-1CA7AC2B7483}'>\r
75               <File KeyPath='yes' Name='apache.config.in' />\r
76             </Component>\r
77             <Component Id='apache2.config.in' Guid='{85BF72A1-FBA8-4955-ACCF-ABC83B1292C9}'>\r
78               <File KeyPath='yes' Name='apache2.config.in' />\r
79             </Component>\r
80             <Component Id='apache22.config.in' Guid='{6AEBA525-8F52-4D14-BAEE-0292A2E214D1}'>\r
81               <File KeyPath='yes' Name='apache22.config.in' />\r
82             </Component>\r
83             <Component Id='apache24.config.in' Guid='{3562B68A-E54A-4F1B-9F10-BDACB5FFE8CB}'>\r
84               <File KeyPath='yes' Name='apache24.config.in' />\r
85             </Component>\r
86             <Component Id='sslError.html' Guid='{A74BA230-C49F-4151-BBF4-AA80D554D099}'>\r
87               <File KeyPath='yes' Name='sslError.html' />\r
88             </Component>\r
89             <Component Id='bindingTemplate.html' Guid='{F5A3A434-9209-43EC-9314-1F705055DDEC}'>\r
90               <File KeyPath='yes' Name='bindingTemplate.html' />\r
91             </Component>\r
92             <Component Id='globalLogout.html' Guid='{E65F580D-5489-4D79-A8FC-F9FFED666FC1}'>\r
93               <File KeyPath='yes' Name='globalLogout.html' />\r
94             </Component>\r
95             <Component Id='localLogout.html' Guid='{70FA3A47-A950-4074-BC13-C56D94497BD9}'>\r
96               <File KeyPath='yes' Name='localLogout.html' />\r
97             </Component>\r
98             <Component Id='attribute_map.xml' Guid='{878C9456-E65F-4541-A0FA-975379EAC6B6}'>\r
99               <File KeyPath='yes' Name='attribute-map.xml' />\r
100             </Component>\r
101             <Component Id='attribute_policy.xml' Guid='{55B88F7B-E2EA-4B70-87B7-33C566B9F992}'>\r
102               <File KeyPath='yes' Name='attribute-policy.xml'/>\r
103             </Component>\r
104             <Component Id='shibboleth2.xml' Guid='{E520FEDE-3F0E-47C6-9345-47223B82825A}'>\r
105               <File KeyPath='yes' Name='shibboleth2.xml' Source='$(var.SPBuildDirectory)\cpp-sp\configs\win-shibboleth2.xml' />\r
106             </Component>\r
107             <Component Id='console.logger' Guid='{8AC85980-32B9-4EA2-9245-167FB1AB2570}'>\r
108               <File KeyPath='yes' Name='console.logger' />\r
109             </Component>\r
110             <Component Id='discoveryTemplate.html' Guid='{A9573113-4387-46DD-A636-84482AF2C672}'>\r
111               <File KeyPath='yes' Name='discoveryTemplate.html' />\r
112             </Component>\r
113             <Component Id='postTemplate.html' Guid='{5B7111E8-8E04-42F1-AB02-E47AFB7C3D28}'>\r
114               <File KeyPath='yes' Name='postTemplate.html' />\r
115             </Component>\r
116             <Component Id='partialLogout.html' Guid='{E1F6208B-3C70-4632-B84C-C7D141DC4192}'>\r
117               <File KeyPath='yes' Name='partialLogout.html' />\r
118             </Component>\r
119             <Component Id='protocols.xml' Guid='{B226CAAC-2D18-411A-9FBF-3FE237EBEF4D}'>\r
120               <File KeyPath='yes' Name='protocols.xml' />\r
121             </Component>\r
122             <Component Id='security_policy.xml' Guid='{0EC04525-FCCF-4B60-8797-9B0CEC222B8C}'>\r
123               <File KeyPath='yes' Name='security-policy.xml' />\r
124             </Component>\r
125             <Component Id='accessError.html' Guid='{6FAA81A0-A020-4E60-A37D-1EC4D0D5FD06}'>\r
126               <File KeyPath='yes' Name='accessError.html' />\r
127             </Component>\r
128             <Component Id='attrChecker.html' Guid='{BDF4837C-A887-4F1C-841C-DC13DFF8A46E}'>\r
129               <File KeyPath='yes' Name='attrChecker.html' />\r
130             </Component>\r
131             <Component Id='metadataError.html' Guid='{8C46D04A-A943-4FA4-AFCB-9B040306C2C0}'>\r
132               <File KeyPath='yes' Name='metadataError.html' />\r
133             </Component>\r
134             <Component Id='native.logger.in' Guid='{8586D4C7-E237-4C7F-BC79-DE0B06473395}'>\r
135               <File KeyPath='yes' Name='native.logger.in' />\r
136             </Component>\r
137             <Component Id='sessionError.html' Guid='{8AA240B3-DC5D-4687-B321-4F5E1BAEA820}'>\r
138               <File KeyPath='yes' Name='sessionError.html' />\r
139             </Component>\r
140             <Component Id='shibd.logger.in' Guid='{D8DA3D14-F779-4691-A883-4995158D2A74}'>\r
141               <File KeyPath='yes' Name='shibd.logger.in' />\r
142             </Component>\r
143           </Directory><!-- etc_shibboleth_dist -->\r
144         </Directory><!-- etc_shibboleth -->\r
145       </Directory><!-- etc_dist -->\r
146       <Directory Id='var' Name='var'>\r
147         <Directory Id='var_cache' Name='cache'>\r
148           <Directory Id='var_cache_shibboleth' Name='shibboleth'>\r
149             <Component Id='var_cache_shibboleth_folder' Guid='{6C978639-DDCF-40BD-90F8-690B3E05586C}'>\r
150               <CreateFolder />\r
151             </Component>\r
152           </Directory><!-- var_cache_shibboleth -->\r
153         </Directory><!-- var_cache -->\r
154         <Directory Id='var_log' Name='log'>\r
155           <Directory Id='var_log_shibboleth' Name='shibboleth'>\r
156             <Component Id='var_log_shibboleth_folder' Guid='{2BFC84E4-634B-4D70-910A-D5640739C8C8}'>\r
157               <CreateFolder />\r
158             </Component>\r
159           </Directory><!-- var_log_shibboleth -->\r
160         </Directory><!-- var_log -->\r
161         <Directory Id='var_run' Name='run'>\r
162           <Directory Id='var_run_shibboleth' Name='shibboleth'>\r
163             <Component Id='var_run_shibboleth_folder' Guid='{35E176B1-965A-4571-B24E-E0C8E69B0459}'>\r
164               <CreateFolder />\r
165             </Component>\r
166           </Directory><!-- var_run_shibboleth -->\r
167         </Directory><!-- var_run -->\r
168       </Directory><!-- var -->\r
169     </DirectoryRef>\r
170 \r
171     <!-- Stuff to do the editing and copy of the files -->\r
172 \r
173     <Binary Id='EditConfigFileSrc' SourceFile='$(var.SPBuildDirectory)\cpp-sp\msi\scripts\shib_edit_config_files.vbs-wix' />\r
174 \r
175     <CustomAction Id='EditConfigFiles' \r
176                   BinaryKey='EditConfigFileSrc' VBScriptCall='' Execute='deferred' Impersonate='no' />\r
177     <CustomAction Id='SetEditConfigFiles' Property='EditConfigFiles' Value='[INSTALLDIR]' />\r
178 \r
179     <CustomAction Id='KeyGen' BinaryKey='WixCA' DllEntry='CAQuietExec' Execute='deferred' Impersonate='no' />\r
180     <CustomAction Id='SetKeyGen' Property='KeyGen' Value='&quot;[INSTALLDIR]etc\shibboleth\keygen.bat&quot;' />\r
181 \r
182     <!-- Stuff to configure IIS.  This is a one-shot (first install/last uninstall) -->\r
183 \r
184     <Binary Id='install_isapi'\r
185             SourceFile='$(var.SPBuildDirectory)\cpp-sp\msi\scripts\shib_install_isapi_filter.vbs-wix'/>\r
186     <Binary Id='uninstall_isapi' \r
187             SourceFile='$(var.SPBuildDirectory)\cpp-sp\msi\scripts\shib_uninstall_isapi_filter.vbs-wix'/>\r
188 \r
189     <CustomAction Id='SetShibInstallISAPIFilter32' Property='ShibInstallISAPIFilter' \r
190                   Value='[INSTALLDIR];@;[INSTALLDIR]lib\shibboleth\isapi_shib.dll;@;[SHIB_FILE_EXTENSION]' />\r
191     <CustomAction Id='SetShibInstallISAPIFilter64' Property='ShibInstallISAPIFilter' \r
192                   Value='[INSTALLDIR];@;[INSTALLDIR]lib64\shibboleth\isapi_shib.dll;@;[SHIB_FILE_EXTENSION]' />\r
193     <CustomAction Id='ShibInstallISAPIFilter' BinaryKey='install_isapi' \r
194                   VBScriptCall='' Execute='deferred' Impersonate='no' />\r
195 \r
196     <CustomAction Id='SetShibUninstallISAPIFilter' Property='ShibUninstallISAPIFilter' Value='[INSTALLDIR]'/>\r
197     <CustomAction Id='ShibUninstallISAPIFilter' BinaryKey='uninstall_isapi' \r
198                   VBScriptCall='' Execute='deferred' Impersonate='no' />\r
199 \r
200     <CustomAction Id='ServicePath64' BinaryKey='WixCA' DllEntry='CAQuietExec' Execute='deferred' Impersonate='no' />\r
201     <CustomAction Id='SetServicePath64' Property='ServicePath64' Value='&quot;[INSTALLDIR]etc\shibboleth\SetService64.bat&quot;' />\r
202 \r
203     <!-- Inherit the installation dir if one was set -->\r
204     <CustomAction Id='InheritInstallDir' Property='INSTALLDIR' Value='[OLD_INSTALLDIR]' />\r
205     <CustomAction Id='InheritInstallDir64' Property='INSTALLDIR' Value='[OLD_INSTALLDIR64]' />\r
206 \r
207     <!-- Set INSTALL_SHIBD correctly -->\r
208     <CustomAction Id='ClearInstallShibd' Property='INSTALL_SHIBD_SERVICE' Value='FALSE' />\r
209 \r
210     <InstallUISequence>\r
211       <!-- All we need to sequence here is setting up inherited INSTALLDIR -->\r
212 \r
213       <!-- inherit installationDir if there is something to inherit -->\r
214       <Custom Action='InheritInstallDir' After='AppSearch'>\r
215         OLD_INSTALLDIR\r
216       </Custom>\r
217       <Custom Action='InheritInstallDir64' After='InheritInstallDir'>\r
218         (NOT OLD_INSTALLDIR) AND OLD_INSTALLDIR64\r
219       </Custom>\r
220     </InstallUISequence>\r
221 \r
222     <InstallExecuteSequence>\r
223       <Custom Action='SetEditConfigFiles' Before='CostInitialize'>NOT Installed</Custom>\r
224       <Custom Action='EditConfigFiles' After='InstallFiles'>NOT Installed</Custom>\r
225 \r
226       <Custom Action='SetKeyGen' Before='CostInitialize'>NOT Installed</Custom>\r
227       <!-- Run KeyGen after WriteEnvironmentStrings so the path is set -->\r
228       <Custom Action='KeyGen' After='WriteEnvironmentStrings'>NOT Installed</Custom>\r
229 \r
230       <!-- Install IIS if\r
231            - this is an install\r
232            - AND we were told to\r
233            - AND this is NOT an upgrade\r
234         -->\r
235       <Custom Action='SetShibInstallISAPIFilter32' Before='CostInitialize'>\r
236         (NOT Installed) AND (INSTALL_ISAPI_FILTER = "TRUE") AND (NOT ALREADYINSTALLED) AND (INSTALL_32BIT) AND IISMAJORVERSION\r
237       </Custom>\r
238       <Custom Action='SetShibInstallISAPIFilter64' Before='CostInitialize'>\r
239         (NOT Installed) AND (INSTALL_ISAPI_FILTER = "TRUE") AND (NOT ALREADYINSTALLED) AND (NOT INSTALL_32BIT) AND IISMAJORVERSION\r
240       </Custom>\r
241       <Custom Action='ShibInstallISAPIFilter' After='InstallFiles'>\r
242         (NOT Installed) AND (INSTALL_ISAPI_FILTER = "TRUE") AND (NOT ALREADYINSTALLED) AND IISMAJORVERSION\r
243       </Custom>\r
244 \r
245       <!-- (try to) Uninstall IIS if\r
246            - this is an uninstall\r
247            - this is not an upgrade\r
248            -->\r
249       <Custom Action='SetShibUninstallISAPIFilter' \r
250               After='CostFinalize'>(REMOVE="ALL") AND (NOT UPGRADINGPRODUCTCODE)</Custom>\r
251       <Custom Action='ShibUninstallISAPIFilter' \r
252               Before='RemoveFiles'>(REMOVE="ALL") AND (NOT UPGRADINGPRODUCTCODE)</Custom>\r
253 \r
254       <!-- set service path to 64 bit one if this is an install and if we were told to -->\r
255 \r
256       <Custom Action='SetServicePath64' Before='CostInitialize'>\r
257         (NOT Installed) AND (INSTALL_SHIBD_SERVICE = "TRUE") AND (NOT ALREADYINSTALLED) AND (NOT INSTALL_32BIT) AND (IS64BITINSTALL = "TRUE")\r
258       </Custom>\r
259       <Custom Action='ServicePath64' After='InstallServices'>\r
260         (NOT Installed) AND (INSTALL_SHIBD_SERVICE = "TRUE") AND (NOT ALREADYINSTALLED) AND (NOT INSTALL_32BIT) AND (IS64BITINSTALL = "TRUE")\r
261       </Custom>\r
262 \r
263       <!-- Duplicate actions from the UI case -->\r
264       <Custom Action='InheritInstallDir' After='AppSearch'>\r
265         OLD_INSTALLDIR\r
266       </Custom>\r
267       <Custom Action='InheritInstallDir64' After='InheritInstallDir'>\r
268         (NOT OLD_INSTALLDIR) AND OLD_INSTALLDIR64\r
269       </Custom>\r
270 \r
271       <!-- Clear out INSTALL_SHIBD_SERVICE (Set it to FALSE) if\r
272            - This is an update\r
273            - We didn't see an appropriate registryEntry\r
274            - TODO - we don't need this here I think\r
275         -->\r
276       <Custom Action='ClearInstallShibd' After='AppSearch'>\r
277         ALREADYINSTALLED AND (NOT OLD_SERVICEINSTALLED)\r
278       </Custom>\r
279 \r
280       <!-- Do not mess with SCM if this is an upgrade -->\r
281 \r
282       <InstallServices>(NOT Installed) AND (NOT ALREADYINSTALLED) AND (INSTALL_SHIBD_SERVICE = "TRUE")</InstallServices>\r
283       <StartServices>(NOT Installed) AND (INSTALL_SHIBD_SERVICE = "TRUE")</StartServices>\r
284       <DeleteServices>(REMOVE="ALL") AND (NOT UPGRADINGPRODUCTCODE)</DeleteServices>\r
285 \r
286     </InstallExecuteSequence>\r
287   </Fragment>\r
288 </Wix>\r