Getting List Of Installed Products c#

后端 未结 1 1450
暗喜
暗喜 2020-12-12 02:13

To Install/Uninstall/Update our software, our custom installer uses WindowsInstaller.Installer.Products to get the list of installed products from windows regis

相关标签:
1条回答
  • 2020-12-12 02:58

    I'd take a look at the Microsoft.Deployment.WindowsInstaller namespace found in Windows Installer XML (WiX) Deployment Tools Foundation (DTF). It has:

    public static IEnumerable<ProductInstallation> GetProducts(
        string productCode,
        string userSid,
        UserContexts context
    )
    

    productCode (String)

    ProductCode (GUID) of the product instances to be enumerated. Only instances of products within the scope of the context specified by the userSid and context parameters will be enumerated. This parameter may be set to null to enumerate all products in the specified context.

    userSid (String)

    Specifies a security identifier (SID) that restricts the context of enumeration. A SID value other than s-1-1-0 is considered a user SID and restricts enumeration to the current user or any user in the system. The special SID string s-1-1-0 (Everyone) specifies enumeration across all users in the system. This parameter can be set to null to restrict the enumeration scope to the current user. When context is set to the machine context only, userSid must be null.

    context (UserContexts)

    Specifies the user context.

    that wraps the Win32 MSI API MsiEnumProductsEx function. This brings back a collection of ProductInstallation that you can do Linq queries against to find out anything you need to know about installed MSI's.

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