KB0083 - MSI error: A major upgrade has been detected...

KB0083 - MSI error: A major upgrade has been detected...

Scope

This article only applies to Windows Server with MSI installation of PowerShell Universal.

Background

You are attempting to install PowerShell Universal 5.6.0 or above and are encountering the below message that "A major upgrade has been detected". This may or may not be expected. This article will cover both scenarios.

(figure shows the "A major upgrade has been detected." warning dialog)

Explanation (when the 'major upgrade' warning dialog is expected)

The PowerShell Universal 5.6.0 and above will check for previously installed versions of PowerShell Universal. If the major version is detected as below 5 then the above warning will be shown. PowerShell Universal version 4.x and below must be uninstalled prior to installing version 5. The database and settings files will be left behind after uninstalling. Customers upgrading from 4.x to 5.x should see the detailed guidance on this at https://docs.powershelluniversal.com/v4-beta/getting-started/upgrading.


(figure shows the Add/Remove Programs on Windows Server 2016 with PowerShell Universal 4.5.4 selected)

Explanation (when the 'major upgrade' warning dialog is NOT expected)

In this case you can try checking the registry for signs of multiple installations. The registry key to check (the key that the MSI checks in relation to this warning dialog) on supported Windows Server should be: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall (for 32-bit OS remove the 'WOW6432Node' from the key).  Look at each sub-key within to find instances where the display name is PowerShell Universal. Below is a screenshot from Regedit showing two instances of PowerShell Universal installed:



When you find the version 4 key, refer to the UninstallString for the removal command. Below is a PowerShell command for Windows Server that can help to parse through the keys and identify versions of installed PowerShell Universal on your Windows Server along with the Uninstall String:

For 64-bit OS
  1. (Get-ChildItem -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall' | Where-Object { (Get-ItemProperty -Path $_.PSPath -Name 'DisplayName' -EA 0).displayname -eq 'PowerShell Universal'}) | ForEach-Object { [PSCustomObject]@{Name = $_.GetValue('DisplayName'); Version = $_.GetValue('DisplayVersion'); Uninstall = $_.GetValue('UninstallString')} } | Sort-Object -Property DisplayVersion
(figure shows a Windows Server with two versions of PowerShell Universal installed)

For 32-bit OS

  1. (Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall' | Where-Object { (Get-ItemProperty -Path $_.PSPath -Name 'DisplayName' -EA 0).displayname -eq 'PowerShell Universal'}) | ForEach-Object { [PSCustomObject]@{Name = $_.GetValue('DisplayName'); Version = $_.GetValue('DisplayVersion'); Uninstall = $_.GetValue('UninstallString')} } | Sort-Object -Property DisplayVersion

Sometimes applications installed by MSI can leave behind remnants if a previous uninstallation stalled or failed for some reason. The root cause could also be health issues  with the server itself. As a best practice, please make a backup of your server before attempting to rectify MSI installation issues.