How to find the UpgradeCode and ProductCode of an installed application in Windows 7

后端 未结 11 1331
囚心锁ツ
囚心锁ツ 2020-11-27 04:36

I have an application installed on my machine. I also have its source code but somehow the ProductCode and UpgradeCode of this application were changed.

Now I want t

相关标签:
11条回答
  • 2020-11-27 05:08

    If you have msi installer open it with Orca (tool from Microsoft), table Property (rows UpgradeCode, ProductCode, Product version etc) or table Upgrade column Upgrade Code.

    Try to find instller via registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall find required subkey and watch value InstallSource. Maybe along the way you'll be able to find the MSI file.

    0 讨论(0)
  • 2020-11-27 05:09

    Powershell handles tasks like this fairly handily:

    $productCode = (gwmi win32_product | `
                    ? { $_.Name -Like "<PRODUCT NAME HERE>*" } | `
                    % { $_.IdentifyingNumber } | `
                    Select-Object -First 1)
    

    You can then use it to get the uninstall information as well:

    $wow = ""
    $is32BitInstaller = $True # or $False
    
    if($is32BitInstaller -and [System.Environment]::Is64BitOperatingSystem) 
    {
        $wow = "\Wow6432Node" 
    }
    
    $regPath = "HKEY_LOCAL_MACHINE\SOFTWARE$wow\Microsoft\Windows\CurrentVersion\Uninstall"
    
    dir "HKLM:\SOFTWARE$wow\Microsoft\Windows\CurrentVersion\Uninstall" | `
    ? { $_.Name -Like "$regPath\$productCode"  }
    
    0 讨论(0)
  • 2020-11-27 05:12

    To everyone using:

    Get-WMIObject win32_product
    

    You should be aware that this will run a self-heal on every single MSI application installed on the PC. If you were to check eventvwr it will say it has finished reconfiguring each product.

    In this case i use the following (a mixture of Yan Sklyarenko's method):

    $Reg = @( "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*", "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" )
    $InstalledApps = Get-ItemProperty $Reg -EA 0
    $WantedApp = $InstalledApps | Where { $_.DisplayName -like "*<part of product>*" }
    

    Now if you were to type:

    $WantedApp.PSChildName
    

    You would be given the following:

    PS D:\SCCM> $WantedApp.PSChildName
    {047904BA-C065-40D5-969A-C7D91CA93D62}
    

    If your organization uses loads of MST's whilst installing applications you would want to avoid running self-heals encase they revert some crucial settings.

    • Note - This will find your product code, then the upgrade can be found as Yan mentioned. I usually, though, just use either 'InstEd It!' or 'Orca' then go to the Property table of the MSI and it lists them right at the top.
    0 讨论(0)
  • 2020-11-27 05:13

    If you don't have the msi and you need the upgrade code, rather than the product code then the answer is here: How can I find the upgrade code for an installed application in C#?

    0 讨论(0)
  • 2020-11-27 05:14

    You can use the MsiEnumProductsEx and MsiGetProductInfoEx methods to enumerate all the installed applications on your system and match the data to your application

    0 讨论(0)
提交回复
热议问题