0

updater: Force Install feature for MSI installers

This is a follow-up CL to r1456197 and r1454963.

Fixed: 408017292
Change-Id: If7f6e55ad23686d13580373af172ec32d5bc0321
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6513376
Commit-Queue: Joshua Pawlicki <waffles@chromium.org>
Auto-Submit: S Ganesh <ganesh@chromium.org>
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1456967}
This commit is contained in:
S. Ganesh
2025-05-07 06:53:31 -07:00
committed by Chromium LUCI CQ
parent 167bb9f9e9
commit bb99b54722
2 changed files with 30 additions and 23 deletions
chrome/updater/win/signing
docs/updater

@ -78,16 +78,18 @@
</Property> </Property>
<Property Id="AllowDowngradeSubstitution" Value="false" /> <Property Id="AllowDowngradeSubstitution" Value="false" />
<!-- Allows running the `updater` with a `--recover` option to recover from <!-- Allows running the `updater` with a `--force-install` option. This
cases where the installed `updater` may be non-operational. force-installs the installer that is run with this switch and makes it
the active `updater`. In addition, if the MSI is tagged, this also
installs the application(s) that are implicitly specified in the tag.
--> -->
<Property Id="RUNRECOVER" Secure="yes" /> <Property Id="RUNFORCEINSTALL" Secure="yes" />
<!-- Eliminates "warning LGHT1076 : ICE71: The Media table has no entries." --> <!-- Eliminates "warning LGHT1076 : ICE71: The Media table has no entries." -->
<Media Id="1" /> <Media Id="1" />
<Feature Id="Complete" Level="1" AllowAbsent="yes"> <Feature Id="Complete" Level="1" AllowAbsent="yes">
<Level Value="0" Condition="RUNRECOVER &lt;&gt; &quot;&quot;" /> <Level Value="0" Condition="RUNFORCEINSTALL &lt;&gt; &quot;&quot;" />
<ComponentRef Id="ProductClientState" /> <ComponentRef Id="ProductClientState" />
</Feature> </Feature>
@ -223,10 +225,10 @@
/> />
<CustomAction <CustomAction
Id="DoRunRecover" Id="DoRunForceInstall"
Impersonate="no" Impersonate="no"
Execute="deferred" Execute="deferred"
ExeCommand="--recover --system" ExeCommand="--force-install --system"
Return="check" Return="check"
BinaryRef="$(var.ProductNameLegalIdentifier)Installer" BinaryRef="$(var.ProductNameLegalIdentifier)Installer"
/> />
@ -236,7 +238,7 @@
<Custom Action="NewerVersionError" <Custom Action="NewerVersionError"
After="FindRelatedProducts" After="FindRelatedProducts"
Condition="((RUNRECOVER = &quot;&quot;) AND NEWPRODUCTFOUND AND (ALLOWDOWNGRADE = &quot;&quot;))" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND NEWPRODUCTFOUND AND (ALLOWDOWNGRADE = &quot;&quot;))"
/> />
<!-- The conditions in the following custom actions trigger the action when either: <!-- The conditions in the following custom actions trigger the action when either:
@ -253,19 +255,19 @@
<Custom <Custom
Action="ExtractTagInfoFromInstaller" Action="ExtractTagInfoFromInstaller"
Before="SetProductTagProperty" Before="SetProductTagProperty"
Condition="((RUNRECOVER = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))"
/> />
<!-- Now start forming [ProdutTag], first with the appguid and name. --> <!-- Now start forming [ProdutTag], first with the appguid and name. -->
<Custom <Custom
Action="SetProductTagProperty" Action="SetProductTagProperty"
Before="AppendCustomParamsToProductTagProperty" Before="AppendCustomParamsToProductTagProperty"
Condition="((RUNRECOVER = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))"
/> />
<!-- Add on the build-time string. --> <!-- Add on the build-time string. -->
<Custom <Custom
Action="AppendCustomParamsToProductTagProperty" Action="AppendCustomParamsToProductTagProperty"
Before="TaggedMSIOverrideProductTagProperty" Before="TaggedMSIOverrideProductTagProperty"
Condition="((RUNRECOVER = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))"
/> />
<!-- Override the tag completely if the MSI is tagged, or if the caller <!-- Override the tag completely if the MSI is tagged, or if the caller
has set the `TAGSTRING` property. Among all actions that change has set the `TAGSTRING` property. Among all actions that change
@ -275,46 +277,46 @@
<Custom <Custom
Action="TaggedMSIOverrideProductTagProperty" Action="TaggedMSIOverrideProductTagProperty"
Before="BuildInstallCommand" Before="BuildInstallCommand"
Condition="((RUNRECOVER = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL)) AND (TAGSTRING &lt;&gt; &quot;&quot;)" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL)) AND (TAGSTRING &lt;&gt; &quot;&quot;)"
/> />
<Custom <Custom
Action="SetOptArgsProperty" Action="SetOptArgsProperty"
Before="AppendEnterpriseToOptArgsProperty" Before="AppendEnterpriseToOptArgsProperty"
Condition="((RUNRECOVER = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))"
/> />
<Custom <Custom
Action="AppendEnterpriseToOptArgsProperty" Action="AppendEnterpriseToOptArgsProperty"
Before="BuildInstallCommand" Before="BuildInstallCommand"
Condition="((RUNRECOVER = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL)) AND (NOGOOGLEUPDATEPING &lt;&gt; &quot;&quot;)" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL)) AND (NOGOOGLEUPDATEPING &lt;&gt; &quot;&quot;)"
/> />
<!-- Set [AllowDowngradeSubstitution] to true if downgrades are allowed. --> <!-- Set [AllowDowngradeSubstitution] to true if downgrades are allowed. -->
<Custom <Custom
Action="DoAllowDowngradeSubstitution" Action="DoAllowDowngradeSubstitution"
Before="BuildInstallCommand" Before="BuildInstallCommand"
Condition="((RUNRECOVER = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL)) AND (ALLOWDOWNGRADE &lt;&gt; &quot;&quot;)" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL)) AND (ALLOWDOWNGRADE &lt;&gt; &quot;&quot;)"
/> />
<Custom <Custom
Action="BuildInstallCommand" Action="BuildInstallCommand"
Before="SetAppGuidProperty" Before="SetAppGuidProperty"
Condition="((RUNRECOVER = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))"
/> />
<Custom <Custom
Action="SetAppGuidProperty" Action="SetAppGuidProperty"
Before="ShowInstallerResultUIString" Before="ShowInstallerResultUIString"
Condition="((RUNRECOVER = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))"
/> />
<Custom <Custom
Action="ShowInstallerResultUIString" Action="ShowInstallerResultUIString"
Before="DoInstall" Before="DoInstall"
Condition="((RUNRECOVER = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))"
/> />
<Custom <Custom
Action="DoInstall" Action="DoInstall"
After="InstallFiles" After="InstallFiles"
Condition="((RUNRECOVER = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND ((?ProductClientState=2) AND ($ProductClientState=3)) OR ((?ProductClientState=3) AND REINSTALL))"
/> />
<!-- The conditions in the following custom actions trigger the action when the product is <!-- The conditions in the following custom actions trigger the action when the product is
@ -323,24 +325,24 @@
<Custom <Custom
Action="CallUninstallerArgs.SetProperty" Action="CallUninstallerArgs.SetProperty"
Before="CallUninstaller.SetProperty" Before="CallUninstaller.SetProperty"
Condition="((RUNRECOVER = &quot;&quot;) AND (?ProductClientState=3) AND ($ProductClientState=2) AND NOT UPGRADINGPRODUCTCODE)" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND (?ProductClientState=3) AND ($ProductClientState=2) AND NOT UPGRADINGPRODUCTCODE)"
/> />
<Custom <Custom
Action="CallUninstaller.SetProperty" Action="CallUninstaller.SetProperty"
Before="CallUninstaller" Before="CallUninstaller"
Condition="((RUNRECOVER = &quot;&quot;) AND (?ProductClientState=3) AND ($ProductClientState=2) AND NOT UPGRADINGPRODUCTCODE)" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND (?ProductClientState=3) AND ($ProductClientState=2) AND NOT UPGRADINGPRODUCTCODE)"
/> />
<Custom <Custom
Action="CallUninstaller" Action="CallUninstaller"
Before="RemoveFiles" Before="RemoveFiles"
Condition="((RUNRECOVER = &quot;&quot;) AND (?ProductClientState=3) AND ($ProductClientState=2) AND NOT UPGRADINGPRODUCTCODE)" Condition="((RUNFORCEINSTALL = &quot;&quot;) AND (?ProductClientState=3) AND ($ProductClientState=2) AND NOT UPGRADINGPRODUCTCODE)"
/> />
<!-- Google Update will uninstall itself if the product is the only app it <!-- Google Update will uninstall itself if the product is the only app it
so no need to have an uninstall operation. --> so no need to have an uninstall operation. -->
<Custom Action="DoRunRecover" <Custom Action="DoRunForceInstall"
After="InstallInitialize" After="InstallInitialize"
Condition="RUNRECOVER &lt;&gt; &quot;&quot;" Condition="RUNFORCEINSTALL &lt;&gt; &quot;&quot;"
/> />
</InstallExecuteSequence> </InstallExecuteSequence>

@ -368,6 +368,11 @@ process is determined by command-line arguments:
* Installs the application(s) that are implicitly specified in the tagged * Installs the application(s) that are implicitly specified in the tagged
metainstaller, or explicitly specified using the `--install` or metainstaller, or explicitly specified using the `--install` or
`--handoff` parameters. `--handoff` parameters.
* `RUNFORCEINSTALL` (for MSI installers)
* Allows running an MSI metainstaller with the `--force-install` option.
* In addition, if the MSI is tagged, this also installs the application(s)
that are implicitly specified in the tag.
* For example, `msiexec /i GoogleChrome.msi RUNFORCEINSTALL=1`.
* --test * --test
* Exit immediately with no error. * Exit immediately with no error.
* --healthcheck * --healthcheck