I can't even get the MsiGetProductCode function working; the lpProductBuf
string remains unchanged, but the function itselfs returns ERROR_SUCCESS.
I've verified that the component is correctly installed using MsiSpy.
Does anyone has a working example of the Windows Installer API in C#, or a
link to further reading???
--
MichKa [MS]
This posting is provided "AS IS" with
no warranties, and confers no rights.
"Michel van Heijster" <michel....@quicknet.nl> wrote in message
news:1044821200.51259@cache1...
"Michael (michka) Kaplan [MS]" <mic...@online.microsoft.com> wrote in
message news:epMJYoK0CHA.2600@TK2MSFTNGP11...
Thanks,
Mike Ballou
"Michael (michka) Kaplan [MS]" <mic...@online.microsoft.com> wrote in
message news:epMJYoK0CHA.2600@TK2MSFTNGP11...
But in truth nothing in MSI is all that complicated in terms of coming
up with the pinvokes.
And since no one project would ever need every function, including
*all* of them would be a huge mistake since it would bloat up your
project. Even if there was a big .cs file, you would want to
copy/paste stuff from it.
--
MichKa [MS]
This posting is provided "AS IS" with
no warranties, and confers no rights.
"Michael Ballou" <michael.ball...@wonderware.com> wrote in
message news:ePudzbj0CHA.2596@TK2MSFTNGP12...
<<WindowsInstaller.cs>>
[DllImport("msi")]
public extern static USERINFOSTATE MsiGetUserInfo(string szProduct,
StringBuilder lpUserNameBuf, uint pcchUserNameBuf, StringBuilder
lpOrgNameBuf, uint pcchOrgNameBuf, StringBuilder lpSerialBuf, uint
pcchSerialBuf);
<<frmSplashscreen.cs>>
System.Text.StringBuilder MsiProductCode = new System.Text.StringBuilder(39,
39);
DpcNederland.Win32.WindowsInstaller.MsiGetProductCode("{D0DB11A0-055B-42AE-B
427-C86ECB279F99}", MsiProductCode);
System.Text.StringBuilder MsiUsername = new System.Text.StringBuilder(0, 1);
System.Text.StringBuilder MsiOrganisation = new System.Text.StringBuilder(0,
1);
System.Text.StringBuilder MsiSerial = new System.Text.StringBuilder(0, 1);
uint pcchUserNameBuf = 0;
uint pcchOrgNameBuf = 0;
uint pcchSerialBuf = 0;
MessageBox.Show(DpcNederland.Win32.WindowsInstaller.MsiGetUserInfo(MsiProduc
tCode.ToString(), MsiUsername, pcchUserNameBuf, MsiOrganisation,
pcchOrgNameBuf, MsiSerial, pcchSerialBuf).ToString());
The MsiGetProductCode returns the correct ProductCode, so I don't think
that's the problem. Please help me!
"Michel van Heijster" <michel....@quicknet.nl> wrote in message
news:1044859811.644174@cache2...
--
MichKa [MS]
This posting is provided "AS IS" with
no warranties, and confers no rights.
"Michel van Heijster" <michel....@quicknet.nl> wrote in message
news:1045078673.649312@cache2...
Thanks for the insights so far!
You mentioned there are a few problems, but enumerated only one...
what are the others? I am having a difficult time (where is all the
good documentation on pinvoking?) getting functions that use pointers
to dwords which specify the size of string buffers to work...
I would be interested in the other issues you might have seen with the
listed code in this thread as well as more insight into the pcch...
type issues.
kindly,
-rory 8)
"Michael \(michka\) Kaplan [MS]" <mic...@online.microsoft.com> wrote in message news:<#4vUjJv0CHA.2308@TK2MSFTNGP09>...
--
MichKa [MS]
This posting is provided "AS IS" with
no warranties, and confers no rights.
"Rory Plaire" <rory....@co.benton.or.us> wrote in message
news:28e92646.03021...@posting.google.com...