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

Install Script doesn't run from Control Event


5 replies to this topic

Victorz

Victorz
  • Members
  • 32 posts

Posted 23 July 2001 - 10:00

Correct me if I'm wrong but there is no way to use Install Scripting language that run as a custom action in an event of a certain control (DoAction myCustomAction).
vbScript here works like a charm.

Leigh Ravenhall

Leigh Ravenhall
  • Members
  • 269 posts

Posted 24 July 2001 - 00:29

This works fine for me.  To use an InstallScript custom action, you must prototype your function with the line:
export prototype myFunction(HWND);

The HWND is a handle to the current installation session.  It may or may not be necessary within your script, but it is required as the only parameter of the function.

Once you've written your function, you should be able to create an InstallScript based custom action, that can then be called from a DoAction.


Victorz

Victorz
  • Members
  • 32 posts

Posted 24 July 2001 - 12:38

I'm talking about properties manipulation - MsiSetProperty and MsiGetProperty - and it is a well documented Install shield warning : Script which handles properties may not work when launched as custom action in a control event.

Kate

Kate
  • Members
  • 61 posts

Posted 24 July 2001 - 20:01

I've written script using MsiSetProperty and MsiGetProperty functions, called them from a CA and haven't had any problems. (knock on wood)
I've done this in a few installs and it's worked every time. Are you having troubles getting these functions to work?

Kelly Lawson

Kelly Lawson
  • Members
  • 12 posts

Posted 24 July 2001 - 22:20

Make sure that you aren't violating any sequence table restrictions... even though you are launching your action from a control, you are still subject to restrictions.  Also make sure that the IKernel process has started successfully before trying to launch InstallScript actions.  Other than that, InstallScript actions should work fine.

Leigh Ravenhall

Leigh Ravenhall
  • Members
  • 269 posts

Posted 25 July 2001 - 00:40

Sorry, I misunderstood your original post.  The warning about using InstallScript custom action in the UI sequence can generally be ignored.

The warning is given because some of the path based default properties (SOURCEDIR, TARGETDIR, etc) may not be initialised if you use your custom action to early in the interface sequence.  If you don't use any of these, or you use them late in the sequence, you should be ok.

It would be nice if InstallShield could tell the difference between a potentially illegal custom action or a safe one, but it can't, so it displays the warning for all of them.