Results 1 to 2 of 2

Thread: MsiGetComponentPath - How to use?

  1. #1
    Join Date
    Oct 2001
    Posts
    44,727

    MsiGetComponentPath - How to use?



    Hallo together,

    has anybody used the MsiGetComponentPathA function?

    I allways get -2 as returnvalue.
    My question is, in which way the function wants the ProductCode and the
    ComponentID e.g. in CA?
    in STRING= [ProductCode],
    in STRING="{n-n-n-n-n}" GUID from the component?
    Or do I have to use an MSI function to change the GUID to the ID?

    In any way: Is there a function to change the GUID to the ID, which is used
    in the registry?

    Thanks in advance!
    Johannes


  2. #2
    Join Date
    Oct 2001
    Posts
    44,727

    Re: MsiGetComponentPath - How to use?



    I believe MsiGetComponentPath wants the "{xxxx-etc.}" form of the product
    and component codes.

    As far as changing the GUID to the registry ID goes, Adrian Accinelli and I
    figured out this formula in April; since it's undocumented it's probably
    subject to change, but here you go:

    [paste]

    > first group of eight hex digits reversed;
    > following group of four digits reversed;
    > following group of four digits reversed;
    > each following pair of digits transposed.
    >
    >Of course, that only raises more questions...
    Sometimes its the simple changes that are the hardest to spot.

    I you take the above instructions as FUNCTIONOF(x) then
    converting and arbitrary guid such as
    {ABCDEFGH-1234-5678-WXYZ-123456789ABC}
    will give
    {HGFEDCBA-4321-8765-XWZY-21436587A9CB}.

    Findings:
    Under HKCR\Installer key
    1) Each key under "Products" is FUNCTIONOF(Product Code).
    The "PackageCode" value found in this same key is
    FUNCTIONOF(PackageCode).

    2) Each key under "UpgradeCodes" is FUNCTIONOF(UpgradeCode)
    for some UpgradeCode. Each value found under
    FUNCTIONOF(UpgradeCode) is really FUNCTIONOF(ProductCode)
    for some ProductCode.

    3) Each key under "Features" is FUNCTIONOF(ProductCode)
    which reveals the Windows Installer states for all the features of the
    product whose ProductCode it is.



    "Johannes John" <jn@rib.de> wrote in message news:3a422065@12.41.20.38...
    > Hallo together,
    >
    > has anybody used the MsiGetComponentPathA function?
    >
    > I allways get -2 as returnvalue.
    > My question is, in which way the function wants the ProductCode and the
    > ComponentID e.g. in CA?
    > in STRING= [ProductCode],
    > in STRING="{n-n-n-n-n}" GUID from the component?
    > Or do I have to use an MSI function to change the GUID to the ID?
    >
    > In any way: Is there a function to change the GUID to the ID, which is
    used
    > in the registry?
    >
    > Thanks in advance!
    > Johannes

    --
    Robert M. Dickau
    Senior Technical Trainer
    InstallShield Software Corp.
    www.installshield.com/training


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •