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