This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- find ms component ID in registry?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jan 31, 2010
09:21 PM
find ms component ID in registry?
Hello,
How do I find a MS componet ID in the registry?
Need to set a condition on a prerequisite. A simple find this key / value eludes me.
I have a MS Component ID like this:
PACKAGE: Visual Studio 2005 Tools for Office Language Pack
PRODUCT CODE: {5DB161C0-7C9C-41D7-8DA1-CB112F60946B}
COMPONENT ID: {2E3A394E-C9BD-40C3-9990-BA7AF7C8B4AF}
>>> Simply, I would like to check the registry to see if COMPONENT ID exists. Seems easy enough, I looked all over and can not finger it.
I need to doo this for a few items like the office 2003 PIA assemblies etc . . .
These codes do not seem to show up in a registry search as text, but the componentcheck.exe file does find them (or not)
In the past I have used componentcheck.exe and passed in the parameters. This is a MS thing used with MSI, found as an example in installing vsto applications examples. Link: http://msdn.microsoft.com/en-us/library/bb332051.aspx
The cpp code for componentcheck.exe is this:
int APIENTRY _tWinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UINT errCode = 0;
HMODULE hMsiLib = LoadLibrary(_T("MSI.DLL"));
if (hMsiLib == NULL)
{
errCode = GetLastError();
if (errCode == 0) // make sure the error code is not 0
errCode = ERROR_MOD_NOT_FOUND;
}
else
{
FMsiLocateComponent pfnMsiLocateComponent = (FMsiLocateComponent)GetProcAddress(hMsiLib, FUNCNAME_MsiLocateComponent);
if (pfnMsiLocateComponent == NULL)
{
errCode = GetLastError();
if (errCode == 0) // make sure the error code is not 0
errCode = ERROR_PROC_NOT_FOUND;
}
else
{
// Loop through the specified components in the arguments.
for (int i = 1; i < __argc; i++)
{
LPCTSTR szComponentCode = __targv;
INSTALLSTATE state = (*pfnMsiLocateComponent)(szComponentCode, NULL, 0);
if (state != INSTALLSTATE_LOCAL)
{
errCode = ERROR_UNKNOWN_COMPONENT;
break;
}
}
}
}
if (hMsiLib != NULL)
{
FreeLibrary(hMsiLib);
}
return errCode;
}
Sour Notes:
Odd such a big forum does not have answers, many have asked about this with no real solutions posted. I noticed there are many valid posts / questions with 0 answers - replies.
So what is it? Possibly paid support is so good that they answer via a ticket submission and the forum never gets the update or ... well . . . if you do not have nothing good to say . . .
How do I find a MS componet ID in the registry?
Need to set a condition on a prerequisite. A simple find this key / value eludes me.
I have a MS Component ID like this:
PACKAGE: Visual Studio 2005 Tools for Office Language Pack
PRODUCT CODE: {5DB161C0-7C9C-41D7-8DA1-CB112F60946B}
COMPONENT ID: {2E3A394E-C9BD-40C3-9990-BA7AF7C8B4AF}
>>> Simply, I would like to check the registry to see if COMPONENT ID exists. Seems easy enough, I looked all over and can not finger it.
I need to doo this for a few items like the office 2003 PIA assemblies etc . . .
These codes do not seem to show up in a registry search as text, but the componentcheck.exe file does find them (or not)
In the past I have used componentcheck.exe and passed in the parameters. This is a MS thing used with MSI, found as an example in installing vsto applications examples. Link: http://msdn.microsoft.com/en-us/library/bb332051.aspx
The cpp code for componentcheck.exe is this:
int APIENTRY _tWinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UINT errCode = 0;
HMODULE hMsiLib = LoadLibrary(_T("MSI.DLL"));
if (hMsiLib == NULL)
{
errCode = GetLastError();
if (errCode == 0) // make sure the error code is not 0
errCode = ERROR_MOD_NOT_FOUND;
}
else
{
FMsiLocateComponent pfnMsiLocateComponent = (FMsiLocateComponent)GetProcAddress(hMsiLib, FUNCNAME_MsiLocateComponent);
if (pfnMsiLocateComponent == NULL)
{
errCode = GetLastError();
if (errCode == 0) // make sure the error code is not 0
errCode = ERROR_PROC_NOT_FOUND;
}
else
{
// Loop through the specified components in the arguments.
for (int i = 1; i < __argc; i++)
{
LPCTSTR szComponentCode = __targv;
INSTALLSTATE state = (*pfnMsiLocateComponent)(szComponentCode, NULL, 0);
if (state != INSTALLSTATE_LOCAL)
{
errCode = ERROR_UNKNOWN_COMPONENT;
break;
}
}
}
}
if (hMsiLib != NULL)
{
FreeLibrary(hMsiLib);
}
return errCode;
}
Sour Notes:
Odd such a big forum does not have answers, many have asked about this with no real solutions posted. I noticed there are many valid posts / questions with 0 answers - replies.
So what is it? Possibly paid support is so good that they answer via a ticket submission and the forum never gets the update or ... well . . . if you do not have nothing good to say . . .
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Feb 03, 2010
01:30 PM
A system search supports searching for a component, but that runs after setup prerequisites, of course. For a prerequisite's condition, perhaps look at KB article Q105971, and check for the existence of the transformed GUID in the registry?