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
- :
- MsiGetComponentPath Problem
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
‎May 08, 2009
09:26 AM
MsiGetComponentPath Problem
InstallScript MSI
Older version of my application (5.10.120) is already installed, attempting to upgrade to a newer version (5.10.121). Application includes several components and these are installed to multiple directories.
I want to determine 2 things for a couple of components :
1. Is the compoent installed.
2. What is the installation directory for the component.
MsiGetComponentPath would appear to be the solution. It returns the current INSTALLSTATE_LOCAL but the path is empty. What am I doing wrong?
Here's a snippet of my code. I've incuded the prototype of MSIGetComponentPathA because InstallShield doesn't prototype this function :
[CODE]
prototype NUMBER MSI.MsiGetComponentPathA(BYVAL string, BYVAL string, BYVAL string, BYREF NUMBER);
function OnResumeUIBefore()
NUMBER nBytes;
STRING szTemp[255];
NUMBER nState;
begin
nBytes = 255;
nState = MsiGetComponentPathA("{60E11478-21C9-474B-A7CE-EC1A20721E41}","{940CB901-C496-496D-9BFF-32E46EE628E0}",szTemp,nBytes);
end;
[/CODE]
nBytes IS set to non-zero value after the call but szTemp is empty.
I looked but couldn't find any concrete examples of people using MsiGetComponentPath. I've tried different component IDs but valid ones all yield similar empty strings although different non-zero nBytes.
Perhaps I am using it too early in the process? If so, at what point would this information be available.
Thanks
Older version of my application (5.10.120) is already installed, attempting to upgrade to a newer version (5.10.121). Application includes several components and these are installed to multiple directories.
I want to determine 2 things for a couple of components :
1. Is the compoent installed.
2. What is the installation directory for the component.
MsiGetComponentPath would appear to be the solution. It returns the current INSTALLSTATE_LOCAL but the path is empty. What am I doing wrong?
Here's a snippet of my code. I've incuded the prototype of MSIGetComponentPathA because InstallShield doesn't prototype this function :
[CODE]
prototype NUMBER MSI.MsiGetComponentPathA(BYVAL string, BYVAL string, BYVAL string, BYREF NUMBER);
function OnResumeUIBefore()
NUMBER nBytes;
STRING szTemp[255];
NUMBER nState;
begin
nBytes = 255;
nState = MsiGetComponentPathA("{60E11478-21C9-474B-A7CE-EC1A20721E41}","{940CB901-C496-496D-9BFF-32E46EE628E0}",szTemp,nBytes);
end;
[/CODE]
nBytes IS set to non-zero value after the call but szTemp is empty.
I looked but couldn't find any concrete examples of people using MsiGetComponentPath. I've tried different component IDs but valid ones all yield similar empty strings although different non-zero nBytes.
Perhaps I am using it too early in the process? If so, at what point would this information be available.
Thanks
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 08, 2009
09:40 AM
Before going down this road, the System Search Wizard supports "searches" for components, toward the bottom of the list of search types. Would that work for you?
(If you do want to go down that road, the third argument should probably be BYREF STRING...)
(If you do want to go down that road, the third argument should probably be BYREF STRING...)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 08, 2009
09:52 AM
RobertDickau wrote:
Before going down this road, the System Search Wizard supports "searches" for components, toward the bottom of the list of search types. Would that work for you?
(If you do want to go down that road, the third argument should probably be BYREF STRING...)
I don't think the System Search Wizard is available in InstallScript MSI projects. I couldn't find it.
Fixing the prototype (BYREF STRING) did the trick though. I should have seen that. Unfortunately, I had copied this prototype from someone else example. UGH!
Thanks for your very timely response. You are quick the workhorse around here. I can't count the number of times your previous responses have help me out.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 08, 2009
10:09 AM
Thanks for the kind words, Mark!
If you do want to explore the other avenue, the System Search Wizard is available in Behavior and Logic > System Search.
Robert
If you do want to explore the other avenue, the System Search Wizard is available in Behavior and Logic > System Search.
Robert
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 08, 2009
10:13 AM
I stand corrected. I found System Search. My bad.
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)