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

Setting Property in Custom Action


3 replies to this topic

NTucker

NTucker
  • Members
  • 8 posts

Posted 22 February 2002 - 16:17

I have a dialog with a property called 'HardwareID' and I have a custom action that (using a immediate execute to an installscript function) sets this property using MsiSetProperty(hMSI, "HardwareID" , HDID) where HDID is got using a c++ dll function call.  My problem is that I need to call this custom action after the files have been installed because the dll used to get the HDID (and its many dependencies) are in the installed image.  This mean that I have to place the Custom action and the displaying of the dialog after the ExecuteAction(in the UI part of Intsallation).  This is not a problem except for when I come to run the release it gets to the Custom action (but my debugging I know that the custom action is never called) and then skips to the 'installation interupted screen.  I know that my Custom action works since if I place my the custom action and dialog before the ExecuteAction then manually copy the files to where they would be copied to and use the 'Test Release 1' it works fine.  Also if I place the CustomAction after the InstallFinalize part of the Execute then the Action gets called and the property appears to be set but when the dialog is displayed then the edit field is still empty.  
I am using wk2 and iswi2.03.
Thanks for any help,
Nick

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 23 February 2002 - 08:47

I believe the InstalLScript engine is already shut down at that point. If all you need to do is call a dll function to set a property, then you domn't need InstallScript. Instead make a custom action of type "call function in standard dll". If you really need InstalLScript you must re-start the engine. I thinks there's a knowledge base article about this at http://kb.installshield.com

NTucker

NTucker
  • Members
  • 8 posts

Posted 25 February 2002 - 14:14

I have checked the project using Orca.exe and the Clean_up of the engine is coming after my custom action anyway.  Also I can't use the custom action of type "call function in standard dll" because I need to manipulate this data, add registry keys etc. at the same time.  
I have also done a small test where by the custom action just displays a message box and this also fails.  Could any one else confirm this??
Thanks again

Leigh Ravenhall

Leigh Ravenhall
  • Members
  • 269 posts

Posted 25 February 2002 - 23:16

Have you tried rewriting your custom action to VBScript?  The scripting engine for VBScript should still be available.