Enforce upgrade component rules
Forcer les règles de mise à niveau de composants
Explanation
This policy setting causes the Windows Installer to enforce strict rules for component upgrades.
If you enable this policy setting, strict upgrade rules will be enforced by the Windows Installer which may cause some upgrades to fail. Upgrades can fail if they attempt to do one of the following:
(1) Remove a component from a feature.
This can also occur if you change the GUID of a component. The component identified by the original GUID appears to be removed and the component as identified by the new GUID appears as a new component.
(2) Add a new feature to the top or middle of an existing feature tree.
The new feature must be added as a new leaf feature to an existing feature tree.
If you disable or do not configure this policy setting, the Windows Installer will use less restrictive rules for component upgrades.
Ce paramètre de stratégie force Windows Installer à appliquer des règles strictes concernant les mises à niveau des composants.
Si vous activez ce paramètre de stratégie, Windows Installer applique des règles strictes de mise à niveau, au risque de faire échouer certaines mises à niveau. Les mises à niveau peuvent échouer si elles tentent d’effectuer l’une des actions suivantes :
(1) Supprimer un composant d’une fonctionnalité.
Ce comportement peut également se produire si vous modifiez le GUID d’un composant. Le composant identifié par le GUID initial s’avère être supprimé et le composant identifié par le nouveau GUID apparaît comme nouveau composant.
(2) Ajouter une nouvelle fonctionnalité au début ou au milieu d’une arborescence de fonctionnalités existantes.
La nouvelle fonctionnalité doit être ajoutée en tant que fonctionnalité feuille dans une arborescence de fonctionnalités existantes.
Si vous désactivez ce paramètre de stratégie ou si vous ne le configurez pas, Windows Installer utilise des règles moins restrictives pour les mises à niveau des composants.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer- Value name
EnforceUpgradeComponentRules
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_DWORD = 0 |
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: MSI/MSI_EnforceUpgradeComponentRules
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Installer'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'EnforceUpgradeComponentRules' -Value 1 -Type DWordDisable
# Disable: MSI/MSI_EnforceUpgradeComponentRules
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Installer'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'EnforceUpgradeComponentRules' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": MSI/MSI_EnforceUpgradeComponentRules
$k = 'HKLM:\Software\Policies\Microsoft\Windows\Installer'
Remove-ItemProperty -Path $k -Name 'EnforceUpgradeComponentRules' -ErrorAction SilentlyContinue