Oh, now I see it. Session.GetProductProperty() is not the API you're looking for. That one calls into MsiGetProductProperty (http://msdn.microsoft.com/en-us/library/aa370133.aspx) which is only callable on a Session obtained from MsiOpenProduct.
To get and set ordinary installation properties, use the indexer on the Session class. For example: session["FOO"]
Since this confused even me, I should make sure it's clear in the DTF documentation. Honestly I don't fully understand the purpose of that other API.
-Jason-
-----Original Message-----
From: wix-users-***@lists.sourceforge.net [mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Nathan Hopper
Sent: Wednesday, July 23, 2008 12:07 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] session.GetProdutProperty() always throws InvalidHandleException
The custom action is set to "immediate", I've also tried "commit".
<Binary Id="CustomAction1.CA.dll" SourceFile="..\CustomAction1\bin\debug\CustomAction1.CA.dll" />
<CustomAction Id="MyCustomAction_DATA" Property="MyCustomAction" Value="foobar" ></CustomAction>
<CustomAction Id="MyCustomAction" BinaryKey="CustomAction1.CA.dll" DllEntry="CustomAction1" Execute="immediate" />
<InstallExecuteSequence>
<Custom Action="MyCustomAction_DATA" After="InstallInitialize" />
<Custom Action="MyCustomAction" After="MyCustomAction_DATA" >
</Custom>
</InstallExecuteSequence>
Thanks,
-Nate
-----Original Message-----
From: wix-users-***@lists.sourceforge.net [mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Jason Ginchereau
Sent: Wednesday, July 23, 2008 11:13 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] session.GetProdutProperty() always throws InvalidHandleException
Is your custom action deferred? Deferred CAs cannot access properties other than CustomActionData.
Sources are in the wix3-sources.zip in the release folder of each build. There is a wix3-pdbs.zip that comes out of every build, but it isn't getting published -- I think because SF doesn't give us enough space. You can always build the sources yourself to get symbols.
-Jason-
-----Original Message-----
From: wix-users-***@lists.sourceforge.net [mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Nathan Hopper
Sent: Wednesday, July 23, 2008 10:39 AM
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] session.GetProdutProperty() always throws InvalidHandleException
Wix Build - 3.0.4318.0
I'm using the new "C# Custom Action Project" to build a managed custom action. When invoking session.GetProductProperty("FOO"), an InvalidHandleException is always thrown. Calls to session.Log() are processes normally and messages do appear in the install log indicting that at least in some cases the handle is still valid. Any ideas?
[Microsoft.Deployment.WindowsInstaller.InvalidHandleException] {"The handle is invalid."}
Stack Trace:
at Microsoft.Deployment.WindowsInstaller.Session.GetProductProperty(String property)
at CustomAction1.CustomActions.CustomAction1(Session session)
Where can I find the source/symbols for Microsoft.Deployment.WindowsInstaller.dll?
Thanks,
-Nate