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
- :
- help in calling MsiSourceListGetInfo
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
Apr 26, 2013
10:30 AM
help in calling MsiSourceListGetInfo
I want to be able to retrieve the msi package name. If there is an easier way to do this other than trying to use MsiSourceListGetInfo,
I would appreciate it.
Here are the pertinent code pieces I have included in setup.rul to try to use MsiSourceListGetInfo
////////////////////////////////////////////////////////////////////////
#include "ifx.h"
#include "iswi.h"
#include "isrt.h"
#define MSICODE_PRODUCT 0x00000000L // product code provided
#define MSIINSTALLCONTEXT_MACHINE 4
prototype NUMBER msi.MsiSourceListGetInfo(BYREF STRING, BYREF STRING, NUMBER, NUMBER, BYREF STRING, BYREF STRING, BYREF NUMBER);
function myfunction()
...
...
begin
szProductCode="{3251536B-F670-4C69-B5E9-36697BE36617}";
szUserID="";
nContext=MSIINSTALLCONTEXT_MACHINE;
nOptions=MSICODE_PRODUCT;
szProperty=INSTALLPROPERTY_PACKAGENAME;
nReturn = MsiSourceListGetInfo(szProductCode, szUserID, nContext, nOptions, szProperty, szValue, nValue);
...
...
end;
Everything compiles ok, but when I run it, I get an error message saying it failed to find the dll function. Do I have to include the MSI.dll and use UseDLL and UnUseDLL?
I would appreciate it.
Here are the pertinent code pieces I have included in setup.rul to try to use MsiSourceListGetInfo
////////////////////////////////////////////////////////////////////////
#include "ifx.h"
#include "iswi.h"
#include "isrt.h"
#define MSICODE_PRODUCT 0x00000000L // product code provided
#define MSIINSTALLCONTEXT_MACHINE 4
prototype NUMBER msi.MsiSourceListGetInfo(BYREF STRING, BYREF STRING, NUMBER, NUMBER, BYREF STRING, BYREF STRING, BYREF NUMBER);
function myfunction()
...
...
begin
szProductCode="{3251536B-F670-4C69-B5E9-36697BE36617}";
szUserID="";
nContext=MSIINSTALLCONTEXT_MACHINE;
nOptions=MSICODE_PRODUCT;
szProperty=INSTALLPROPERTY_PACKAGENAME;
nReturn = MsiSourceListGetInfo(szProductCode, szUserID, nContext, nOptions, szProperty, szValue, nValue);
...
...
end;
Everything compiles ok, but when I run it, I get an error message saying it failed to find the dll function. Do I have to include the MSI.dll and use UseDLL and UnUseDLL?
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Apr 26, 2013
04:48 PM
It depends when you're trying to get this information: if you're getting it from the running first-time installation, you might call MsiGetProperty to get the "OriginalDatabase" property (described in the MSI help file) and then parse it to get the file name.
If you do need to call the DLL function later, maybe check (using Dependency Walker or depends.exe) if the function is split into ANSI (MsiSourceListGetInfoA) and Unicode (-GetInfoW) varieties, where there might not be an undecorated (without -A or -W) version.
If you do need to call the DLL function later, maybe check (using Dependency Walker or depends.exe) if the function is split into ANSI (MsiSourceListGetInfoA) and Unicode (-GetInfoW) varieties, where there might not be an undecorated (without -A or -W) version.
