Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / remoting / host / installer / win / chromoting.wxs
1 <?xml version="1.0"?>
2 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3
4   <?define EventSourceName = "chromoting" ?>
5   <?define ServiceName = "chromoting" ?>
6
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?>
20
21   <?if $(var.OfficialBuild) != 0 ?>
22     <?define ChromotingKeyPath = "Google\Chrome Remote Desktop" ?>
23   <?else?>
24     <?define ChromotingKeyPath = "Chromoting" ?>
25   <?endif?>
26
27   <?define FirewallName = "$(var.ChromotingHost)" ?>
28
29   <?define OmahaAppid = "{b210701e-ffc4-49e3-932b-370728c72662}" ?>
30   <?define UpgradeCode = "2b21f767-e157-4fa6-963c-55834c1433a6" ?>
31
32   <?define CoreBinary = "remoting_core.dll" ?>
33   <?define HostBinary = "remoting_host.exe" ?>
34
35   <?define ChromotingTypelib = "{b6396c45-b0cc-456b-9f49-f12964ee6df4}" ?>
36
37   <!-- AppIDs used by the COM components. -->
38   <?define ControllerAppid = "{4ff35d5e-d226-4550-9248-03e7779e67de}" ?>
39   <?define RdpAppid = "{52e6fd1a-f16e-49c0-aacb-5436a915448b}" ?>
40
41   <?define ControllerClass = "ElevatedController Class" ?>
42   <?define ControllerProgid =
43       "ChromotingElevatedController.ElevatedController" ?>
44
45   <?define IRdpDesktopSessionId = "{6a7699f0-ee43-43e7-aa30-a6738f9bd470}" ?>
46   <?define IRdpDesktopSessionEventHandlerId =
47       "{b59b96da-83cb-40ee-9b91-c377400fc3e3}" ?>
48
49   <!--
50     The long hex value(s) below are security descriptors generated from SDDL
51     definition using the PowerShell script below:
52
53     $sddl = "<SDDL definition goes here>"
54     $i = ([wmiclass]"Win32_SecurityDescriptorHelper").SDDLToBinarySD($sddl).BinarySD
55     -join ($i | foreach {$_.ToString("X2")})
56   -->
57
58   <!--
59     A security descriptor that gives SYSTEM, built-in administrators and
60     LocalService accounts COM_RIGHTS_EXECUTE, COM_RIGHTS_EXECUTE_LOCAL, and
61     COM_RIGHTS_ACTIVATE_LOCAL rights. It specifies a mandatory label that
62     specifies "no execute up" policy for medium integrity level.
63
64     $sddl = "O:BAG:BAD:(A;;0xb;;;SY)(A;;0xb;;;BA)(A;;0xb;;;LS)S:(ML;;NX;;;ME)"
65   -->
66   <?define RdpSd = "010014807800000088000000140000003000000002001C000100000011001400040000000101000000000010002000000200480003000000000014000B000000010100000000000512000000000018000B00000001020000000000052000000020020000000014000B0000000101000000000005130000000102000000000005200000002002000001020000000000052000000020020000" ?>
67
68   <!-- Verify that all required parameters are defined. -->
69   <?ifndef ControllerClsid ?>
70     <?error ControllerClsid must be defined ?>
71   <?endif?>
72
73   <?ifndef RdpDesktopSessionClsid ?>
74     <?error RdpDesktopSessionClsid must be defined ?>
75   <?endif?>
76
77   <?ifndef Version ?>
78     <?error Version must be defined ?>
79   <?endif?>
80
81   <Product Id="*"
82            Language="1033"
83            Manufacturer="$(var.Manufacturer)"
84            Name="$(var.ChromotingHost)"
85            UpgradeCode="$(var.UpgradeCode)"
86            Version="$(var.Version)">
87
88     <Package Comments="$(var.ChromotingHost) Package"
89              Compressed="yes"
90              Description="$(var.ChromotingHost) Package"
91              InstallerVersion="200"
92              Manufacturer="$(var.Manufacturer)"
93              InstallScope="perMachine"/>
94
95     <Condition
96       Message="$(var.ChromotingHost) is only supported on Windows XP, Windows Server 2003, or higher.">
97       <![CDATA[Installed OR (VersionNT >= 501)]]>
98     </Condition>
99
100     <!-- The upgrade rules below could be expressed with MajorUpgrade element.
101          Unfortunately, there is a bug in WiX decompiler (Dark) corrupting
102          InstallExecuteSequence table. The installation compiled from
103          the disassembled .msi schedules RemoveExistingProducts after
104          InstallFinalize while the original installation schedules it after
105          InstallInitialize. Fortunately, the verbose version of the upgrade
106          rules below decompiles correctly, so we use it instead.
107          See http://crbug.com/145265 for more details.
108     -->
109     <Upgrade Id="$(var.UpgradeCode)">
110       <UpgradeVersion IncludeMinimum="no"
111                       Minimum="$(var.Version)"
112                       OnlyDetect="yes"
113                       Property="NEWERVERSIONDETECTED" />
114       <UpgradeVersion IncludeMaximum="yes"
115                       IncludeMinimum="yes"
116                       Maximum="$(var.Version)"
117                       Minimum="0.0.0.0"
118                       Property="OLDERVERSIONBEINGUPGRADED" />
119       <!-- Detect versions that didn't handle the usagestats value properly. -->
120       <UpgradeVersion IncludeMaximum="yes"
121                       IncludeMinimum="yes"
122                       Maximum="24.0.1312.29"
123                       Minimum="0.0.0.0"
124                       Property="BROKENUSAGESTATSVERSION" />
125     </Upgrade>
126
127     <Condition Message="A later version of [ProductName] is already installed. Setup will now exit.">
128       NOT NEWERVERSIONDETECTED
129     </Condition>
130
131     <Media Id="1" Cabinet="chromoting.cab" EmbedCab="yes"/>
132
133     <Directory Id="TARGETDIR" Name="SourceDir">
134       <Directory Id="ProgramFilesFolder">
135         <?if $(var.OfficialBuild) != 0 ?>
136           <Directory Id="program_files_google" Name="Google">
137             <Directory Id="chromoting" Name="Chrome Remote Desktop">
138               <Directory Id="binaries" Name="$(var.Version)"/>
139             </Directory>
140           </Directory>
141         <?else?>
142           <Directory Id="chromoting" Name="Chromoting">
143             <Directory Id="binaries" Name="$(var.Version)"/>
144           </Directory>
145         <?endif?>
146       </Directory>
147       <Directory Id="CommonAppDataFolder">
148         <?if $(var.OfficialBuild) != 0 ?>
149           <Directory Id="common_app_data_google" Name="Google">
150             <Directory Id="config_files" Name="Chrome Remote Desktop"/>
151           </Directory>
152         <?else?>
153           <Directory Id="config_files" Name="Chromoting"/>
154         <?endif?>
155       </Directory>
156     </Directory>
157
158     <DirectoryRef Id="binaries">
159       <Component Id="sas" Guid="*">
160         <File Id="sas.dll"
161               DiskId="1"
162               Name="sas.dll"
163               Vital="yes"/>
164       </Component>
165
166       <Component Id="remoting_core" Guid="*">
167         <File Id="$(var.CoreBinary)"
168               DiskId="1"
169               KeyPath="yes"
170               Name="$(var.CoreBinary)"
171               Vital="yes"/>
172
173         <util:EventSource xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
174                           Name="$(var.EventSourceName)"
175                           Log="Application"
176                           CategoryCount="1"
177                           CategoryMessageFile="[#$(var.CoreBinary)]"
178                           EventMessageFile="[#$(var.CoreBinary)]"
179                           SupportsErrors="yes"
180                           SupportsInformationals="yes"/>
181       </Component>
182
183       <Component Id="remoting_desktop" Guid="*">
184         <File Id="remoting_desktop.exe"
185               DiskId="1"
186               KeyPath="yes"
187               Name="remoting_desktop.exe"
188               Vital="yes"/>
189       </Component>
190
191       <Component Id="remoting_native_messaging_host" Guid="*">
192         <File Id="remoting_native_messaging_host.exe"
193               DiskId="1"
194               KeyPath="yes"
195               Name="remoting_native_messaging_host.exe"
196               Vital="yes"/>
197       </Component>
198
199       <Component Id="remote_assistance_host" Guid="*">
200         <File Id="remote_assistance_host.exe"
201               DiskId="1"
202               KeyPath="yes"
203               Name="remote_assistance_host.exe"
204               Vital="yes"/>
205       </Component>
206
207       <Component Id="native_messaging_host_manifest" Guid="*">
208         <File Id="com.google.chrome.remote_desktop.json"
209               DiskId="1"
210               KeyPath="yes"
211               Name="com.google.chrome.remote_desktop.json"
212               Vital="yes"/>
213       </Component>
214
215       <Component Id="remote_assistance_host_manifest" Guid="*">
216         <File Id="com.google.chrome.remote_assistance.json"
217               DiskId="1"
218               KeyPath="yes"
219               Name="com.google.chrome.remote_assistance.json"
220               Vital="yes"/>
221       </Component>
222
223       <Component Id="icudtl" Guid="*">
224         <File Id="icudtl.dat"
225               DiskId="1"
226               KeyPath="yes"
227               Name="icudtl.dat"
228               Vital="yes"/>
229       </Component>
230
231       <Component Id="remoting_host" Guid="*">
232         <File Id="remoting_host.exe"
233               DiskId="1"
234               Name="remoting_host.exe"
235               Vital="yes"/>
236
237         <ServiceInstall Id="install_service"
238                         Type="ownProcess"
239                         Vital="yes"
240                         Name="$(var.ServiceName)"
241                         DisplayName="[chromoting_service_display_name]"
242                         Description="[chromoting_service_description]"
243                         Arguments="--type=daemon --host-config=&quot;[config_files]host.json&quot;"
244                         Start="demand"
245                         Account="LocalSystem"
246                         ErrorControl="ignore"
247                         Interactive="no">
248           <!-- Configure the service to restart after one minute when it
249                crashes.
250           -->
251           <util:ServiceConfig
252               xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
253               FirstFailureActionType="restart"
254               ResetPeriodInDays="1"
255               RestartServiceDelayInSeconds="60"
256               SecondFailureActionType="restart"
257               ThirdFailureActionType="restart"/>
258         </ServiceInstall>
259
260         <ServiceControl Id="start_service"
261                         Stop="both"
262                         Remove="uninstall"
263                         Name="$(var.ServiceName)"
264                         Wait="yes" />
265
266         <fire:FirewallException xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension"
267                                 Id="me2me_firewall_exception"
268                                 IgnoreFailure="yes"
269                                 Name="$(var.FirewallName)"
270                                 Profile="all"
271                                 Program="[#remoting_host.exe]"
272                                 Scope="any" />
273       </Component>
274
275       <?if $(var.OfficialBuild) != 0 ?>
276         <Component Id="omaha_registration" Guid="*">
277           <RegistryKey Id="omaha_client_key"
278                        Root="HKLM"
279                        Key="SOFTWARE\Google\Update\Clients\$(var.OmahaAppid)"
280                        Action="create">
281             <RegistryValue Type="string"
282                            Name="pv"
283                            Value="$(var.Version)"/>
284
285             <RegistryValue Type="string"
286                            Name="name"
287                            Value="$(var.ChromotingHost)"/>
288           </RegistryKey>
289         </Component>
290       <?endif?>
291
292       <Component Id="remoting_lib" Guid="*">
293         <RegistryKey Root="HKLM"
294                      Key="SOFTWARE\Classes">
295           <RegistryKey Key="AppId">
296             <RegistryKey Key="$(var.ControllerAppid)" Action="create">
297               <RegistryValue Type="string"
298                              Value="ChromotingElevatedController"/>
299             </RegistryKey>
300
301             <RegistryKey Key="$(var.RdpAppid)" Action="create">
302               <RegistryValue Type="string"
303                              Value="ChromotingRdpDesktopSession"/>
304               <RegistryValue Name="AccessPermission"
305                              Type="binary"
306                              Value="$(var.RdpSd)"/>
307               <RegistryValue Name="LaunchPermission"
308                              Type="binary"
309                              Value="$(var.RdpSd)"/>
310               <RegistryValue Name="RunAs"
311                              Type="string"
312                              Value="NT AUTHORITY\LocalService"/>
313             </RegistryKey>
314
315           </RegistryKey>
316
317           <RegistryKey Key="$(var.ControllerProgid)" Action="create">
318             <RegistryValue Type="string"
319                            Value="$(var.ControllerClass)"/>
320
321             <RegistryKey Key="CLSID" Action="create">
322               <RegistryValue Type="string"
323                              Value="$(var.ControllerClsid)"/>
324             </RegistryKey>
325
326             <RegistryKey Key="CurVer" Action="create">
327               <RegistryValue Type="string"
328                              Value="$(var.ControllerProgid).$(var.Version)"/>
329             </RegistryKey>
330           </RegistryKey>
331
332           <RegistryKey Key="$(var.ControllerProgid).$(var.Version)"
333                        Action="create">
334             <RegistryValue Type="string"
335                            Value="$(var.ControllerClass)"/>
336
337             <RegistryKey Key="CLSID" Action="create">
338               <RegistryValue Type="string"
339                              Value="$(var.ControllerClsid)"/>
340             </RegistryKey>
341           </RegistryKey>
342
343           <RegistryKey Key="CLSID">
344             <RegistryKey Key="$(var.ControllerClsid)" Action="create">
345               <RegistryValue Type="string"
346                              Value="$(var.ControllerClass)"/>
347
348               <RegistryValue Type="string"
349                              Name="AppID"
350                              Value="$(var.ControllerAppid)"/>
351
352               <RegistryValue Type="string"
353                              Name="LocalizedString"
354                              Value="@[binaries]$(var.CoreBinary),-103"/>
355
356               <RegistryKey Key="LocalServer32" Action="create">
357                 <RegistryValue Type="string"
358                                Value="[binaries]$(var.HostBinary) --type=controller"/>
359               </RegistryKey>
360
361               <RegistryKey Key="ProgID" Action="create">
362                 <RegistryValue Type="string"
363                                Value="$(var.ControllerProgid).$(var.Version)"/>
364               </RegistryKey>
365
366               <RegistryKey Key="TypeLib" Action="create">
367                 <RegistryValue Type="string"
368                                Value="$(var.ChromotingTypelib)"/>
369               </RegistryKey>
370
371               <RegistryKey Key="VersionIndependentProgID" Action="create">
372                 <RegistryValue Type="string"
373                                Value="$(var.ControllerProgid)"/>
374               </RegistryKey>
375
376               <RegistryKey Key="Elevation" Action="create">
377                 <RegistryValue Type="integer"
378                                Name="Enabled"
379                                Value="1"/>
380                 <RegistryValue Type="string"
381                                Name="IconReference"
382                                Value="@[binaries]$(var.CoreBinary),-104"/>
383               </RegistryKey>
384             </RegistryKey>
385             <RegistryKey Key="$(var.RdpDesktopSessionClsid)" Action="create">
386               <RegistryValue Type="string"
387                              Value="RdpDesktopSession Class"/>
388
389               <RegistryValue Type="string"
390                              Name="AppID"
391                              Value="$(var.RdpAppid)"/>
392
393               <RegistryKey Key="LocalServer32" Action="create">
394                 <RegistryValue Type="string"
395                                Value="[binaries]$(var.HostBinary) --type=rdp_desktop_session"/>
396               </RegistryKey>
397
398               <RegistryKey Key="TypeLib" Action="create">
399                 <RegistryValue Type="string"
400                                Value="$(var.ChromotingTypelib)"/>
401               </RegistryKey>
402             </RegistryKey>
403
404             <!-- IRdpDesktopSession PSFactory -->
405             <RegistryKey Key="$(var.IRdpDesktopSessionId)"
406                          Action="create">
407               <RegistryValue Type="string"
408                              Value="IRdpDesktopSession PSFactory"/>
409
410               <RegistryKey Key="InprocServer32" Action="create">
411                 <RegistryValue Type="string"
412                                Value="[binaries]$(var.CoreBinary)"/>
413               </RegistryKey>
414             </RegistryKey>
415
416             <!-- IRdpDesktopSessionEventHandler PSFactory -->
417             <RegistryKey Key="$(var.IRdpDesktopSessionEventHandlerId)"
418                          Action="create">
419               <RegistryValue Type="string"
420                              Value="IRdpDesktopSessionEventHandler PSFactory"/>
421
422               <RegistryKey Key="InprocServer32" Action="create">
423                 <RegistryValue Type="string"
424                                Value="[binaries]$(var.CoreBinary)"/>
425               </RegistryKey>
426             </RegistryKey>
427           </RegistryKey>
428
429           <RegistryKey Key="Interface">
430             <!-- IDaemonControl2 interface -->
431             <RegistryKey Key="{655bd819-c08c-4b04-80c2-f160739ff6ef}"
432                          Action="create">
433               <RegistryKey Key="ProxyStubClsid32" Action="create">
434                 <RegistryValue Type="string"
435                                Value="{00020424-0000-0000-C000-000000000046}"/>
436               </RegistryKey>
437
438               <RegistryKey Key="TypeLib" Action="create">
439                 <RegistryValue Type="string"
440                                Value="$(var.ChromotingTypelib)"/>
441               </RegistryKey>
442             </RegistryKey>
443
444             <!-- IDaemonControl interface -->
445             <RegistryKey Key="{e051a481-6345-4ba1-bdb1-cf7929955268}"
446                          Action="create">
447               <RegistryKey Key="ProxyStubClsid32" Action="create">
448                 <RegistryValue Type="string"
449                                Value="{00020424-0000-0000-C000-000000000046}"/>
450               </RegistryKey>
451
452               <RegistryKey Key="TypeLib" Action="create">
453                 <RegistryValue Type="string"
454                                Value="$(var.ChromotingTypelib)"/>
455               </RegistryKey>
456             </RegistryKey>
457
458             <!-- IRdpDesktopSession interface -->
459             <RegistryKey Key="$(var.IRdpDesktopSessionId)"
460                          Action="create">
461               <RegistryValue Type="string"
462                              Value="IRdpDesktopSession"/>
463               <RegistryKey Key="ProxyStubClsid32" Action="create">
464                 <RegistryValue Type="string"
465                                Value="$(var.IRdpDesktopSessionId)"/>
466               </RegistryKey>
467             </RegistryKey>
468
469             <!-- IRdpDesktopSessionEventHandler interface -->
470             <RegistryKey Key="$(var.IRdpDesktopSessionEventHandlerId)"
471                          Action="create">
472               <RegistryValue Type="string"
473                              Value="IRdpDesktopSessionEventHandler"/>
474               <RegistryKey Key="ProxyStubClsid32" Action="create">
475                 <RegistryValue Type="string"
476                                Value="$(var.IRdpDesktopSessionEventHandlerId)"/>
477               </RegistryKey>
478
479               <RegistryKey Key="TypeLib" Action="create">
480                 <RegistryValue Type="string"
481                                Value="$(var.ChromotingTypelib)"/>
482               </RegistryKey>
483             </RegistryKey>
484           </RegistryKey>
485
486           <RegistryKey Key="Typelib">
487             <RegistryKey Key="$(var.ChromotingTypelib)" Action="create">
488               <RegistryKey Key="1.0" Action="create">
489                 <RegistryValue Type="string"
490                                Value="Chromoting 1.0 Type Library"/>
491                 <RegistryKey Key="0" Action="create">
492                   <RegistryKey Key="win32" Action="create">
493                     <RegistryValue Type="string"
494                                    Value="[binaries]$(var.CoreBinary)"/>
495                   </RegistryKey>
496                 </RegistryKey>
497
498                 <RegistryKey Key="FLAGS" Action="create">
499                   <RegistryValue Type="string"
500                                  Value="0"/>
501                 </RegistryKey>
502
503                 <RegistryKey Key="HELPDIR" Action="create">
504                   <RegistryValue Type="string"
505                                  Value="[binaries]"/>
506                 </RegistryKey>
507               </RegistryKey>
508             </RegistryKey>
509           </RegistryKey>
510         </RegistryKey>
511
512       </Component>
513
514       <!-- Creates the pairing registry store and protect it with an ACL. -->
515       <Component Id="remoting_pairing_registry" Guid="960bc7eb-a816-428b-90e8-ad13336955d5">
516         <RegistryKey Root="HKLM"
517                      Key="SOFTWARE\$(var.ChromotingKeyPath)\paired-clients"
518                      Action="create">
519           <RegistryKey Key="clients" Action="create"/>
520           <RegistryKey Key="secrets" Action="create">
521             <!-- Gives full access to SYSTEM only. -->
522             <!-- Cannot use the builtin PermissionEx element because it maps
523                  to the MsiLockPermissionsEx table which is not supported on
524                  Windows Installer version 4.5 or lower. Also Cannot use
525                  PermissionEx in WixUtilExtension because it automatically
526                  inherits all the ACLs from the parent. -->
527             <Permission User="SYSTEM"
528                         GenericAll="yes"
529                         ChangePermission="yes"
530                         TakeOwnership="yes"/>
531             <Permission User="Administrators"
532                         Domain="[LOCAL_MACHINE_NAME]"
533                         GenericAll="yes"
534                         ChangePermission="yes"
535                         TakeOwnership="yes"/>
536           </RegistryKey>
537         </RegistryKey>
538         <CreateFolder/>
539       </Component>
540
541       <Component Id="native_messaging_host_registry" Guid="*">
542         <RegistryKey Root="HKLM"
543                      Key="SOFTWARE\Google\chrome\NativeMessagingHosts"
544                      Action="create">
545           <RegistryKey Key="com.google.chrome.remote_desktop" Action="create">
546             <RegistryValue
547                 Type="string"
548                 Value="[binaries]com.google.chrome.remote_desktop.json"/>
549           </RegistryKey>
550         </RegistryKey>
551         <CreateFolder/>
552       </Component>
553
554       <Component Id="remote_assistance_host_registry" Guid="*">
555         <RegistryKey Root="HKLM"
556                      Key="SOFTWARE\Google\chrome\NativeMessagingHosts"
557                      Action="create">
558           <RegistryKey Key="com.google.chrome.remote_assistance"
559                        Action="create">
560             <RegistryValue
561                 Type="string"
562                 Value="[binaries]com.google.chrome.remote_assistance.json"/>
563           </RegistryKey>
564         </RegistryKey>
565         <CreateFolder/>
566       </Component>
567
568       <!-- Register with Sawbuck. See http://code.google.com/p/sawbuck/. -->
569       <Component Id="sawbuck_provider" Guid="*">
570         <RegistryKey Root="HKLM"
571                      Key="SOFTWARE\Google\Sawbuck\Providers">
572           <RegistryKey Key="{2db51ca1-4fd8-4b88-b5a2-fb8606b66b02}"
573                        Action="create">
574             <RegistryValue Type="string" Value="Chromoting"/>
575             <RegistryValue Name="default_flags" Type="integer" Value="1"/>
576             <RegistryValue Name="default_level" Type="integer" Value="4"/>
577             <RegistryKey Key="Flags" Action="create">
578               <RegistryKey Key="Stack Trace" Action="create">
579                 <RegistryValue Type="integer" Value="1"/>
580               </RegistryKey>
581               <RegistryKey Key="Text Only" Action="create">
582                 <RegistryValue Type="integer" Value="2"/>
583               </RegistryKey>
584             </RegistryKey>
585           </RegistryKey>
586         </RegistryKey>
587       </Component>
588
589       <!-- Delete the usagestats flag to reset the crash dump reporting settings
590            for existing users. -->
591       <Component Id="delete_usagestats"
592                  Guid="5c73f2b9-b865-426f-81cc-90a27ebb54aa"
593                  KeyPath="yes">
594         <Condition>BROKENUSAGESTATSVERSION</Condition>
595         <RemoveRegistryValue
596             Id="usagestats"
597             Key="SOFTWARE\Google\Update\ClientStateMedium\$(var.OmahaAppid)"
598             Name="usagestats"
599             Root="HKLM" />
600       </Component>
601
602     </DirectoryRef>
603
604     <DirectoryRef Id="config_files">
605       <!-- Delete debug.log from previous versions -->
606       <Component Id="delete_debug_log"
607                  Guid="b309082a-e6fa-4dc7-98e4-3d83c896561d">
608         <RemoveFile Id="debug.log"
609                     Name="debug.log"
610                     On="both" />
611       </Component>
612     </DirectoryRef>
613
614     <!-- The service is always installed in the stopped state with start type
615          set to 'manual'. This becomes a problem when upgrading an existing
616          installation that is configured to start the service automatically.
617
618          Here we check the startup type before making any changes, then restart
619          the service and change its startup type as needed once the installation
620          is finished. -->
621     <Property Id="CHROMOTING_SERVICE_START_TYPE">
622       <RegistrySearch Id="chromoting_service_start_type"
623                       Root="HKLM"
624                       Key="SYSTEM\CurrentControlSet\services\$(var.ServiceName)"
625                       Name="Start"
626                       Type="raw" />
627     </Property>
628
629     <CustomAction Id="query_auto_start_service"
630                   Property="auto_start_service"
631                   Value="[CHROMOTING_SERVICE_START_TYPE]" />
632
633     <CustomAction Id="set_auto_start_service"
634                   Impersonate="no"
635                   Execute="deferred"
636                   Script="jscript">
637       <![CDATA[
638         var controller = new ActiveXObject("$(var.ControllerProgid)");
639         controller.StartDaemon();
640       ]]>
641     </CustomAction>
642
643     <CustomAction Id="set_service_display_name"
644                   Property="chromoting_service_display_name"
645                   Value="@[binaries]$(var.CoreBinary),-101" />
646     <CustomAction Id="set_service_description"
647                   Property="chromoting_service_description"
648                   Value="@[binaries]$(var.CoreBinary),-102" />
649
650     <!-- XP does not support MUI strings in the service name and description, so
651          we fall back to plain strings on XP. -->
652     <CustomAction Id="set_service_display_name_xp"
653                   Property="chromoting_service_display_name"
654                   Value="$(var.ChromotingServiceName)" />
655     <CustomAction Id="set_service_description_xp"
656                   Property="chromoting_service_description"
657                   Value="$(var.ChromotingServiceDescription)" />
658
659     <UIRef Id="WixUI_ErrorProgressText" />
660
661     <Feature Id="chromoting_host" Level="1" Title="$(var.ChromotingHost)">
662       <ComponentRef Id="delete_debug_log"/>
663       <ComponentRef Id="delete_usagestats"/>
664       <?if $(var.OfficialBuild) != 0 ?>
665         <ComponentRef Id="omaha_registration"/>
666       <?endif?>
667       <ComponentRef Id="icudtl"/>
668       <ComponentRef Id="native_messaging_host_manifest"/>
669       <ComponentRef Id="native_messaging_host_registry"/>
670       <ComponentRef Id="remote_assistance_host"/>
671       <ComponentRef Id="remote_assistance_host_manifest"/>
672       <ComponentRef Id="remote_assistance_host_registry"/>
673       <ComponentRef Id="remoting_native_messaging_host"/>
674       <ComponentRef Id="remoting_core"/>
675       <ComponentRef Id="remoting_desktop"/>
676       <ComponentRef Id="remoting_host"/>
677       <ComponentRef Id="remoting_lib"/>
678       <ComponentRef Id="remoting_pairing_registry"/>
679       <ComponentRef Id="sas"/>
680       <ComponentRef Id="sawbuck_provider"/>
681     </Feature>
682
683     <!-- Set the icon shown in Add/Remove Programs. -->
684     <Icon Id="chromoting.ico" SourceFile="chromoting.ico"/>
685     <Property Id="ARPPRODUCTICON" Value="chromoting.ico" />
686
687     <InstallExecuteSequence>
688       <Custom Action="query_auto_start_service" Before="InstallInitialize"/>
689       <Custom Action="set_auto_start_service" After="StartServices">
690         <![CDATA[NOT REMOVE AND (auto_start_service = "#2")]]>
691       </Custom>
692
693       <!-- Set the serivce name and description -->
694       <Custom Action="set_service_display_name_xp" Before="InstallInitialize">
695         <![CDATA[VersionNT < 600]]>
696       </Custom>
697       <Custom Action="set_service_description_xp" Before="InstallInitialize">
698         <![CDATA[VersionNT < 600]]>
699       </Custom>
700       <Custom Action="set_service_display_name" Before="InstallInitialize">
701         <![CDATA[VersionNT >= 600]]>
702       </Custom>
703       <Custom Action="set_service_description" Before="InstallInitialize">
704         <![CDATA[VersionNT >= 600]]>
705       </Custom>
706
707       <!-- Schedule RemoveExistingProducts before installing any files.
708            See http://msdn.microsoft.com/en-us/library/aa371197.aspx. -->
709       <RemoveExistingProducts After="InstallInitialize" />
710     </InstallExecuteSequence>
711   </Product>
712 </Wix>