Revert "Merged all Chromoting Host code into remoting_core.dll (Windows)."
[chromium-blink-merge.git] / remoting / host / installer / win / chromoting.wxs
blob7a88536f58d5eb8ad9a5567197de8b52843925fa
1 <?xml version="1.0"?>
2 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
4 <?define EventSourceName = "chromoting" ?>
5 <?define ServiceName = "chromoting" ?>
7 <!-- TODO(alexeypa): There strings should be localized,
8 see http://crbug.com/121785 -->
9 <?if $(var.Branding) ~= Chrome ?>
10 <?define ChromotingHost = "Chrome Remote Desktop Host" ?>
11 <?define ChromotingServiceName = "Chrome Remote Desktop Service" ?>
12 <?define ChromotingServiceDescription = "This service enables incoming connections from Chrome Remote Desktop clients." ?>
13 <?define Manufacturer = "Google Inc." ?>
14 <?else?>
15 <?define ChromotingHost = "Chromoting Host" ?>
16 <?define ChromotingServiceName = "Chromoting Service" ?>
17 <?define ChromotingServiceDescription = "This service enables incoming connections from Chromoting clients." ?>
18 <?define Manufacturer = "The Chromium Authors" ?>
19 <?endif?>
21 <?define FirewallName = "$(var.ChromotingHost)" ?>
23 <?define OmahaAppid = "{b210701e-ffc4-49e3-932b-370728c72662}" ?>
24 <?define UpgradeCode = "2b21f767-e157-4fa6-963c-55834c1433a6" ?>
26 <?define ControllerAppid = "{4ff35d5e-d226-4550-9248-03e7779e67de}" ?>
27 <?define ControllerBinary = "remoting_controller.exe" ?>
28 <?define ControllerClass = "ElevatedController Class" ?>
29 <?define ControllerProgid =
30 "ChromotingElevatedController.ElevatedController" ?>
31 <?define ControllerTypelib = "{9d9a5a2c-576e-4acd-9c75-aabff74b205d}" ?>
33 <!--
34 The long hex value below is a security descriptor that allows SYSTEM,
35 built-in administrators and interactive users to call methods of a COM
36 object (COM_RIGHTS_EXECUTE and COM_RIGHTS_EXECUTE_LOCAL). The security
37 descriptor was generated from SDDL definition using the PowerShell script
38 below:
40 $sddl = "O:BAG:BAD:(A;;0x3;;;IU)(A;;0x3;;;SY)(A;;0x3;;;BA)"
41 $i = ([wmiclass]"Win32_SecurityDescriptorHelper").SDDLToBinarySD($sddl).BinarySD
42 -join ($i | foreach {$_.ToString("X2")})
43 -->
44 <?define ControllerSd = "010004805C0000006C00000000000000140000000200480003000000000014000300000001010000000000050400000000001400030000000101000000000005120000000000180003000000010200000000000520000000200200000102000000000005200000002002000001020000000000052000000020020000" ?>
46 <?ifndef ControllerClsid ?>
47 <?error ControllerClsid must be defined ?>
48 <?endif?>
50 <?ifndef Version ?>
51 <?error Version must be defined ?>
52 <?endif?>
54 <Product Id="*"
55 Language="1033"
56 Manufacturer="$(var.Manufacturer)"
57 Name="$(var.ChromotingHost)"
58 UpgradeCode="$(var.UpgradeCode)"
59 Version="$(var.Version)">
61 <Package Comments="$(var.ChromotingHost) Package"
62 Compressed="yes"
63 Description="$(var.ChromotingHost) Package"
64 InstallerVersion="200"
65 Manufacturer="$(var.Manufacturer)"
66 InstallScope="perMachine"/>
68 <Condition
69 Message="$(var.ChromotingHost) is only supported on Windows XP, Windows Server 2003, or higher.">
70 <![CDATA[Installed OR (VersionNT >= 501)]]>
71 </Condition>
73 <!-- The upgrade rules below could be expressed with MajorUpgrade element.
74 Unfortunately, there is a bug in WiX decompiler (Dark) corrupting
75 InstallExecuteSequence table. The installation compiled from
76 the disassembled .msi schedules RemoveExistingProducts after
77 InstallFinalize while the original installation schedules it after
78 InstallInitialize. Fortunately, the verbose version of the upgrade
79 rules below decompiles correctly, so we use it instead.
80 See http://crbug.com/145265 for more details.
81 -->
82 <Upgrade Id="$(var.UpgradeCode)">
83 <UpgradeVersion IncludeMinimum="no"
84 Minimum="$(var.Version)"
85 OnlyDetect="yes"
86 Property="NEWERVERSIONDETECTED" />
87 <UpgradeVersion IncludeMaximum="yes"
88 IncludeMinimum="yes"
89 Maximum="$(var.Version)"
90 Minimum="0.0.0.0"
91 Property="OLDERVERSIONBEINGUPGRADED" />
92 <!-- Detect versions that didn't handle the usagestats value properly. -->
93 <UpgradeVersion IncludeMaximum="yes"
94 IncludeMinimum="yes"
95 Maximum="24.0.1312.29"
96 Minimum="0.0.0.0"
97 Property="BROKENUSAGESTATSVERSION" />
98 </Upgrade>
100 <Condition Message="A later version of [ProductName] is already installed. Setup will now exit.">
101 NOT NEWERVERSIONDETECTED
102 </Condition>
104 <Media Id="1" Cabinet="chromoting.cab" EmbedCab="yes"/>
106 <Directory Id="TARGETDIR" Name="SourceDir">
107 <Directory Id="ProgramFilesFolder">
108 <?if $(var.OfficialBuild) != 0 ?>
109 <Directory Id="program_files_google" Name="Google">
110 <Directory Id="chromoting" Name="Chrome Remote Desktop">
111 <Directory Id="binaries" Name="$(var.Version)"/>
112 </Directory>
113 </Directory>
114 <?else?>
115 <Directory Id="chromoting" Name="Chromoting">
116 <Directory Id="binaries" Name="$(var.Version)"/>
117 </Directory>
118 <?endif?>
119 </Directory>
120 <Directory Id="CommonAppDataFolder">
121 <?if $(var.OfficialBuild) != 0 ?>
122 <Directory Id="common_app_data_google" Name="Google">
123 <Directory Id="config_files" Name="Chrome Remote Desktop"/>
124 </Directory>
125 <?else?>
126 <Directory Id="config_files" Name="Chromoting"/>
127 <?endif?>
128 </Directory>
129 </Directory>
131 <DirectoryRef Id="binaries">
132 <Component Id="sas" Guid="*">
133 <File Id="sas.dll"
134 DiskId="1"
135 Name="sas.dll"
136 Vital="yes"/>
137 </Component>
139 <?if $(var.RemotingMultiProcess) != 0 ?>
140 <Component Id="remoting_desktop" Guid="*">
141 <File Id="remoting_desktop.exe"
142 DiskId="1"
143 KeyPath="yes"
144 Name="remoting_desktop.exe"
145 Vital="yes"/>
146 </Component>
147 <?endif?>
149 <Component Id="remoting_daemon" Guid="*">
150 <File Id="remoting_daemon.exe"
151 DiskId="1"
152 KeyPath="yes"
153 Name="remoting_daemon.exe"
154 Vital="yes"/>
156 <ServiceInstall Id="install_service"
157 Type="ownProcess"
158 Vital="yes"
159 Name="$(var.ServiceName)"
160 DisplayName="[chromoting_service_display_name]"
161 Description="[chromoting_service_description]"
162 Arguments="--host-config=&quot;[config_files]host.json&quot;"
163 Start="demand"
164 Account="LocalSystem"
165 ErrorControl="ignore"
166 Interactive="no" />
168 <ServiceControl Id="start_service"
169 Stop="both"
170 Remove="uninstall"
171 Name="$(var.ServiceName)"
172 Wait="yes" />
173 </Component>
175 <Component Id="remoting_host" Guid="*">
176 <File Id="remoting_host.exe"
177 DiskId="1"
178 Name="remoting_host.exe"
179 Vital="yes"/>
180 <util:EventSource xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
181 Name="$(var.EventSourceName)"
182 Log="Application"
183 CategoryCount="1"
184 CategoryMessageFile="[#remoting_host.exe]"
185 EventMessageFile="[#remoting_host.exe]"
186 SupportsErrors="yes"
187 SupportsInformationals="yes"/>
189 <fire:FirewallException xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension"
190 Id="me2me_firewall_exception"
191 IgnoreFailure="yes"
192 Name="$(var.FirewallName)"
193 Profile="all"
194 Program="[#remoting_host.exe]"
195 Scope="any" />
196 </Component>
198 <?if $(var.OfficialBuild) != 0 ?>
199 <Component Id="omaha_registration" Guid="*">
200 <RegistryKey Id="omaha_client_key"
201 Root="HKLM"
202 Key="SOFTWARE\Google\Update\Clients\$(var.OmahaAppid)"
203 Action="create">
204 <RegistryValue Type="string"
205 Name="pv"
206 Value="$(var.Version)"/>
208 <RegistryValue Type="string"
209 Name="name"
210 Value="$(var.ChromotingHost)"/>
211 </RegistryKey>
212 </Component>
213 <?endif?>
215 <Component Id="remoting_controller" Guid="*">
216 <File Id="$(var.ControllerBinary)"
217 DiskId="1"
218 Name="$(var.ControllerBinary)"
219 Vital="yes"/>
221 <RegistryKey Root="HKLM"
222 Key="SOFTWARE\Classes">
223 <RegistryKey Key="AppId">
224 <RegistryKey Key="$(var.ControllerAppid)" Action="create">
225 <RegistryValue Type="string"
226 Value="ChromotingElevatedController"/>
227 <RegistryValue Name="AccessPermission"
228 Type="binary"
229 Value="$(var.ControllerSd)"/>
230 </RegistryKey>
232 <RegistryKey Key="$(var.ControllerBinary)" Action="create">
233 <RegistryValue Type="string"
234 Name="AppID"
235 Value="$(var.ControllerAppid)"/>
236 </RegistryKey>
237 </RegistryKey>
239 <RegistryKey Key="$(var.ControllerProgid)" Action="create">
240 <RegistryValue Type="string"
241 Value="$(var.ControllerClass)"/>
243 <RegistryKey Key="CLSID" Action="create">
244 <RegistryValue Type="string"
245 Value="$(var.ControllerClsid)"/>
246 </RegistryKey>
248 <RegistryKey Key="CurVer" Action="create">
249 <RegistryValue Type="string"
250 Value="$(var.ControllerProgid).$(var.Version)"/>
251 </RegistryKey>
252 </RegistryKey>
254 <RegistryKey Key="$(var.ControllerProgid).$(var.Version)"
255 Action="create">
256 <RegistryValue Type="string"
257 Value="$(var.ControllerClass)"/>
259 <RegistryKey Key="CLSID" Action="create">
260 <RegistryValue Type="string"
261 Value="$(var.ControllerClsid)"/>
262 </RegistryKey>
263 </RegistryKey>
265 <RegistryKey Key="CLSID">
266 <RegistryKey Key="$(var.ControllerClsid)" Action="create">
267 <RegistryValue Type="string"
268 Value="$(var.ControllerClass)"/>
270 <RegistryValue Type="string"
271 Name="AppID"
272 Value="$(var.ControllerAppid)"/>
274 <RegistryValue Type="string"
275 Name="LocalizedString"
276 Value="@[#$(var.ControllerBinary)],-100"/>
278 <RegistryKey Key="LocalServer32" Action="create">
279 <RegistryValue Type="string"
280 Value="[#$(var.ControllerBinary)]"/>
281 </RegistryKey>
283 <RegistryKey Key="ProgID" Action="create">
284 <RegistryValue Type="string"
285 Value="$(var.ControllerProgid).$(var.Version)"/>
286 </RegistryKey>
288 <RegistryKey Key="TypeLib" Action="create">
289 <RegistryValue Type="string"
290 Value="$(var.ControllerTypelib)"/>
291 </RegistryKey>
293 <RegistryKey Key="VersionIndependentProgID" Action="create">
294 <RegistryValue Type="string"
295 Value="$(var.ControllerProgid)"/>
296 </RegistryKey>
298 <RegistryKey Key="Elevation" Action="create">
299 <RegistryValue Type="integer"
300 Name="Enabled"
301 Value="1"/>
302 <RegistryValue Type="string"
303 Name="IconReference"
304 Value="@[#$(var.ControllerBinary)],-101"/>
305 </RegistryKey>
306 </RegistryKey>
307 </RegistryKey>
309 <RegistryKey Key="Interface">
310 <RegistryKey Key="{655bd819-c08c-4b04-80c2-f160739ff6ef}"
311 Action="create">
312 <RegistryKey Key="ProxyStubClsid32" Action="create">
313 <RegistryValue Type="string"
314 Value="{00020424-0000-0000-C000-000000000046}"/>
315 </RegistryKey>
317 <RegistryKey Key="TypeLib" Action="create">
318 <RegistryValue Type="string"
319 Value="$(var.ControllerTypelib)"/>
320 </RegistryKey>
321 </RegistryKey>
323 <RegistryKey Key="{e051a481-6345-4ba1-bdb1-cf7929955268}"
324 Action="create">
325 <RegistryKey Key="ProxyStubClsid32" Action="create">
326 <RegistryValue Type="string"
327 Value="{00020424-0000-0000-C000-000000000046}"/>
328 </RegistryKey>
330 <RegistryKey Key="TypeLib" Action="create">
331 <RegistryValue Type="string"
332 Value="$(var.ControllerTypelib)"/>
333 </RegistryKey>
334 </RegistryKey>
335 </RegistryKey>
337 <RegistryKey Key="Typelib">
338 <RegistryKey Key="$(var.ControllerTypelib)" Action="create">
339 <RegistryKey Key="1.1" Action="create">
340 <RegistryKey Key="0" Action="create">
341 <RegistryKey Key="win32" Action="create">
342 <RegistryValue Type="string"
343 Value="[#$(var.ControllerBinary)]"/>
344 </RegistryKey>
345 </RegistryKey>
347 <RegistryKey Key="FLAGS" Action="create">
348 <RegistryValue Type="string"
349 Value="0"/>
350 </RegistryKey>
352 <RegistryKey Key="HELPDIR" Action="create">
353 <RegistryValue Type="string"
354 Value="[binaries]"/>
355 </RegistryKey>
356 </RegistryKey>
357 </RegistryKey>
358 </RegistryKey>
359 </RegistryKey>
361 </Component>
363 <!-- Register with Sawbuck. See http://code.google.com/p/sawbuck/. -->
364 <Component Id="sawbuck_provider" Guid="*">
365 <RegistryKey Root="HKLM"
366 Key="SOFTWARE\Google\Sawbuck\Providers">
367 <RegistryKey Key="{2db51ca1-4fd8-4b88-b5a2-fb8606b66b02}"
368 Action="create">
369 <RegistryValue Type="string" Value="Chromoting"/>
370 <RegistryValue Name="default_flags" Type="integer" Value="1"/>
371 <RegistryValue Name="default_level" Type="integer" Value="4"/>
372 <RegistryKey Key="Flags" Action="create">
373 <RegistryKey Key="Stack Trace" Action="create">
374 <RegistryValue Type="integer" Value="1"/>
375 </RegistryKey>
376 <RegistryKey Key="Text Only" Action="create">
377 <RegistryValue Type="integer" Value="2"/>
378 </RegistryKey>
379 </RegistryKey>
380 </RegistryKey>
381 </RegistryKey>
382 </Component>
384 <!-- Delete the usagestats flag to reset the crash dump reporting settings
385 for existing users. -->
386 <Component Id="delete_usagestats"
387 Guid="5c73f2b9-b865-426f-81cc-90a27ebb54aa"
388 KeyPath="yes">
389 <Condition>BROKENUSAGESTATSVERSION</Condition>
390 <RemoveRegistryValue
391 Id="usagestats"
392 Key="SOFTWARE\Google\Update\ClientStateMedium\$(var.OmahaAppid)"
393 Name="usagestats"
394 Root="HKLM" />
395 </Component>
397 </DirectoryRef>
399 <DirectoryRef Id="config_files">
400 <!-- Delete debug.log from previous versions -->
401 <Component Id="delete_debug_log"
402 Guid="b309082a-e6fa-4dc7-98e4-3d83c896561d">
403 <RemoveFile Id="debug.log"
404 Name="debug.log"
405 On="both" />
406 </Component>
407 </DirectoryRef>
409 <!-- The service is always installed in the stopped state with start type
410 set to 'manual'. This becomes a problem when upgrading an existing
411 installation that is configured to start the service automatically.
413 Here we check the startup type before making any changes, then restart
414 the service and change its startup type as needed once the installation
415 is finished. -->
416 <Property Id="CHROMOTING_SERVICE_START_TYPE">
417 <RegistrySearch Id="chromoting_service_start_type"
418 Root="HKLM"
419 Key="SYSTEM\CurrentControlSet\services\$(var.ServiceName)"
420 Name="Start"
421 Type="raw" />
422 </Property>
424 <CustomAction Id="query_auto_start_service"
425 Property="auto_start_service"
426 Value="[CHROMOTING_SERVICE_START_TYPE]" />
428 <CustomAction Id="set_auto_start_service"
429 Impersonate="no"
430 Execute="deferred"
431 Script="jscript">
432 <![CDATA[
433 var controller = new ActiveXObject("$(var.ControllerProgid)");
434 controller.StartDaemon();
436 </CustomAction>
438 <CustomAction Id="set_service_display_name"
439 Property="chromoting_service_display_name"
440 Value="@[binaries]remoting_daemon.exe,-101" />
441 <CustomAction Id="set_service_description"
442 Property="chromoting_service_description"
443 Value="@[binaries]remoting_daemon.exe,-102" />
445 <!-- XP does not support MUI strings in the service name and description, so
446 we fall back to plain strings on XP. -->
447 <CustomAction Id="set_service_display_name_xp"
448 Property="chromoting_service_display_name"
449 Value="$(var.ChromotingServiceName)" />
450 <CustomAction Id="set_service_description_xp"
451 Property="chromoting_service_description"
452 Value="$(var.ChromotingServiceDescription)" />
454 <UIRef Id="WixUI_ErrorProgressText" />
456 <Feature Id="chromoting_host" Level="1" Title="$(var.ChromotingHost)">
457 <ComponentRef Id="delete_debug_log"/>
458 <ComponentRef Id="delete_usagestats"/>
459 <?if $(var.OfficialBuild) != 0 ?>
460 <ComponentRef Id="omaha_registration"/>
461 <?endif?>
462 <ComponentRef Id="remoting_controller"/>
463 <ComponentRef Id="remoting_daemon"/>
464 <?if $(var.RemotingMultiProcess) != 0 ?>
465 <ComponentRef Id="remoting_desktop"/>
466 <?endif?>
467 <ComponentRef Id="remoting_host"/>
468 <ComponentRef Id="sas"/>
469 <ComponentRef Id="sawbuck_provider"/>
470 </Feature>
472 <!-- Set the icon shown in Add/Remove Programs. -->
473 <Icon Id="chromoting.ico" SourceFile="chromoting.ico"/>
474 <Property Id="ARPPRODUCTICON" Value="chromoting.ico" />
476 <InstallExecuteSequence>
477 <Custom Action="query_auto_start_service" Before="InstallInitialize"/>
478 <Custom Action="set_auto_start_service" After="StartServices">
479 <![CDATA[NOT REMOVE AND (auto_start_service = "#2")]]>
480 </Custom>
482 <!-- Set the serivce name and description -->
483 <Custom Action="set_service_display_name_xp" Before="InstallInitialize">
484 <![CDATA[VersionNT < 600]]>
485 </Custom>
486 <Custom Action="set_service_description_xp" Before="InstallInitialize">
487 <![CDATA[VersionNT < 600]]>
488 </Custom>
489 <Custom Action="set_service_display_name" Before="InstallInitialize">
490 <![CDATA[VersionNT >= 600]]>
491 </Custom>
492 <Custom Action="set_service_description" Before="InstallInitialize">
493 <![CDATA[VersionNT >= 600]]>
494 </Custom>
496 <!-- Schedule RemoveExistingProducts before installing any files.
497 See http://msdn.microsoft.com/en-us/library/aa371197.aspx. -->
498 <RemoveExistingProducts After="InstallInitialize" />
499 </InstallExecuteSequence>
500 </Product>
501 </Wix>