Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Return value from CustomAction


4 replies to this topic

eelisdotnet

eelisdotnet
  • Members
  • 24 posts

Posted 18 July 2005 - 15:08

Hi

I have a TextBoxes Dialog where the user insert the product key during installation.
Once the user click Next, an immediate CA is called to validate the key. I want the CA to return a value so that in case the key is not valid, the user will not be able to continue to the next UI Dialog. (When I have this property returned from the CA, I can add it to the condition of the Next button on the ControlEvent table.)

Note: I don't want the installation to terminate if the key is not valid. Only to halt the UI dialogs.


So, just to make it more clear -
The only question here is how to return a value (or pre-configured property) from immedate CA to the msi tables ?

Thanks for any assistance.

Edited by eelisdotnet, 18 July 2005 - 15:08.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 18 July 2005 - 20:58

MsiSetProperty()

eelisdotnet

eelisdotnet
  • Members
  • 24 posts

Posted 19 July 2005 - 08:12

Sorry, but I couldn't find any examples of how to use the MsiSetProperty() function with VB.NET.
QUOTE

"You cannot use an EXE custom action because this custom action sets a property and that can only be accomplished by using a DLL, which has a handle to the installation."


I created a new DLL project and added reference to the WindowsInstaller (msi.dll)
How can I obtain the installation handle in a VB.NET DLL ?

I appreciate if someone can post a simple VB.NET sample of how to use this function.

Thanks!

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 19 July 2005 - 11:45

You can't. VB doesn't create "real" DLLs but ActiveX. You should use C to build the DLL, or use VBScript.

eelisdotnet

eelisdotnet
  • Members
  • 24 posts

Posted 19 July 2005 - 12:13

ohmy.gif Oooops.

Thanks Stefan. smile.gif

In that case I'll leave this issue for the future when I have more time...

The validate key deferred CA runs now during the Install phase. It's probably better to validate after the key is entered, so that the installation doesn't even start in case the key is not valid.