| OLD | NEW |
| (Empty) |
| 1 <?xml version='1.0' encoding='windows-1252'?> | |
| 2 <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'> | |
| 3 <?define UpdateKeyPath = 'SOFTWARE\Google\Update' ?> | |
| 4 | |
| 5 <!-- This fragment assumes machine install (ALLUSER=1). --> | |
| 6 | |
| 7 <Fragment Id='FragmentGoogleUpdate' > | |
| 8 <!-- Detect whether product is already registered with Google Update. --> | |
| 9 <Property Id='PRODUCT_REGISTERED_VERSION'> | |
| 10 <RegistrySearch Id='$(var.ProductNameLegalIdentifier)RegistrationSearch' | |
| 11 Root='HKLM' | |
| 12 Key='$(var.UpdateKeyPath)\Clients\$(var.ProductGuid)' | |
| 13 Name='pv' Type='raw' /> | |
| 14 </Property> | |
| 15 | |
| 16 <Binary Id='GoogleUpdateSetup' | |
| 17 SourceFile='$(var.GoogleUpdateMetainstallerPath)' /> | |
| 18 | |
| 19 <!-- This fragment needs a component that can be referenced. | |
| 20 Components must be in Directory[Ref] elements and cannot be empty. | |
| 21 Thus, we have a registry value write that has no effect. | |
| 22 To avoid multiple Directory elements with the 'ProgramFilesFolder' Id, | |
| 23 assume that the product MSI has defined a it and reference it here. --> | |
| 24 <DirectoryRef Id='ProgramFilesFolder'> | |
| 25 <Directory Id='GoogleProgramDir' Name='Google'> | |
| 26 <Directory Id='UpdateDir' Name='Update'> | |
| 27 | |
| 28 <Component Id='ComponentGoogleUpdate' | |
| 29 Guid='6B528A57-0CD8-4b26-85F8-1CA05523B8F1'> | |
| 30 <!-- Clear the last UI string before running the installer so we kno
w | |
| 31 that any value present upon rollback is fresh. --> | |
| 32 <RemoveRegistryValue Key='$(var.UpdateKeyPath)\ClientState\$(var.Pro
ductGuid)' | |
| 33 Name='LastInstallerResultUIString' | |
| 34 Root='HKLM' /> | |
| 35 <RemoveRegistryValue Key='$(var.UpdateKeyPath)' | |
| 36 Name='LastInstallerResultUIString' | |
| 37 Root='HKLM' /> | |
| 38 <?ifdef UsingGoogleUpdate_1_2_171_OrLater?> | |
| 39 <RegistryValue Id='NonEmptyComponent' Action='write' | |
| 40 Root='HKLM' | |
| 41 Key='$(var.UpdateKeyPath)\ClientState\$(var.ProductGu
id)' | |
| 42 Name='EnterpriseInstall' Type='string' Value='$(var.P
roductVersion)' /> | |
| 43 <?else?> | |
| 44 <RegistryValue Id='NonEmptyComponent' Action='write' | |
| 45 Root='HKLM' | |
| 46 Key='$(var.UpdateKeyPath)\ClientState\$(var.ProductGu
id)' | |
| 47 Name='EnterpriseInstall' Type='integer' Value='1' /> | |
| 48 <?endif?> | |
| 49 </Component> | |
| 50 | |
| 51 </Directory> | |
| 52 </Directory> | |
| 53 </DirectoryRef> | |
| 54 | |
| 55 <CustomAction Id='SetProductTagProperty' | |
| 56 Property='ProductTag' | |
| 57 Value='appguid=$(var.ProductGuid)&appname=$(var.ProductName)&needs
Admin=True' | |
| 58 Execute='immediate' | |
| 59 Return='check' /> | |
| 60 <CustomAction Id='AppendCustomParamsToProductTagProperty' | |
| 61 Property='ProductTag' | |
| 62 Value='[ProductTag]$(var.ProductCustomParams)' | |
| 63 Execute='immediate' | |
| 64 Return='check' /> | |
| 65 <CustomAction Id='AppendBrandToProductTagProperty' | |
| 66 Property='ProductTag' | |
| 67 Value='[ProductTag]&brand=[BRAND]' | |
| 68 Execute='immediate' | |
| 69 Return='check' /> | |
| 70 <CustomAction Id='RollbackGoogleUpdateRegistration' | |
| 71 BinaryKey='GoogleUpdateSetup' | |
| 72 Impersonate='no' | |
| 73 Execute='rollback' | |
| 74 ExeCommand='/unregisterproduct "[ProductTag]"' | |
| 75 Return='check' /> | |
| 76 <!-- TODO(omaha): If /registerproduct is deprecated in favor of an | |
| 77 "install Omaha only" switch, we might need to update this fragment to | |
| 78 write the pv value to the product's ClientState. Otherwise, Omaha | |
| 79 might uninstall itself before the product's normal install flow writes | |
| 80 these values. --> | |
| 81 <CustomAction Id='InstallGoogleUpdateAndRegister' | |
| 82 BinaryKey='GoogleUpdateSetup' | |
| 83 Impersonate='no' | |
| 84 Execute='deferred' | |
| 85 ExeCommand='/registerproduct "[ProductTag]" /installsource enterprisemsi' | |
| 86 Return='check' /> | |
| 87 | |
| 88 <InstallExecuteSequence> | |
| 89 <!-- Build tag property. --> | |
| 90 <Custom Action='SetProductTagProperty' | |
| 91 Before='AppendCustomParamsToProductTagProperty'> | |
| 92 (($ComponentGoogleUpdate>2) OR REINSTALL) AND (NOT DISABLE_UPDATES) | |
| 93 </Custom> | |
| 94 <Custom Action='AppendCustomParamsToProductTagProperty' | |
| 95 Before='AppendBrandToProductTagProperty'> | |
| 96 (($ComponentGoogleUpdate>2) OR REINSTALL) AND (NOT DISABLE_UPDATES) | |
| 97 </Custom> | |
| 98 <Custom Action='AppendBrandToProductTagProperty' | |
| 99 Before='RollbackGoogleUpdateRegistration'> | |
| 100 (($ComponentGoogleUpdate>2) OR REINSTALL) AND (NOT DISABLE_UPDATES) AND
(BRAND <> "") | |
| 101 </Custom> | |
| 102 | |
| 103 <!-- Install Google Update before 'InstallFiles' so that brand, etc. will | |
| 104 be present when the product is installed. --> | |
| 105 <Custom Action='RollbackGoogleUpdateRegistration' | |
| 106 Before='InstallGoogleUpdateAndRegister' | |
| 107 > | |
| 108 (($ComponentGoogleUpdate>2) OR REINSTALL) AND (NOT DISABLE_UPDATES) AND
(PRODUCT_REGISTERED_VERSION = "") | |
| 109 </Custom> | |
| 110 <Custom Action='InstallGoogleUpdateAndRegister' | |
| 111 Before='InstallFiles'> | |
| 112 (($ComponentGoogleUpdate>2) OR REINSTALL) AND (NOT DISABLE_UPDATES) | |
| 113 </Custom> | |
| 114 | |
| 115 <!-- Google Update will uninstall itself if the product is the only | |
| 116 registered product, so no need to have an uninstall operation. | |
| 117 Uninstall actions would not run when expected anyway if Omaha updates | |
| 118 the product using a normal MSI installer (without this fragment). | |
| 119 Information about this installer would be lost. Also, the uninstall | |
| 120 action might run during the first update.--> | |
| 121 | |
| 122 </InstallExecuteSequence> | |
| 123 | |
| 124 </Fragment> | |
| 125 </Wix> | |
| OLD | NEW |