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

Call to MsiGetProperty fails without return


6 replies to this topic

bjh

bjh
  • Members
  • 25 posts

Posted 24 May 2001 - 11:58

I am trying to call MsiGetProperty inside an InstallScript function and the call fails without return and the function is exists too.

The function is used inside a CA called just before InstallFinalize.


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 24 May 2001 - 12:30

Deferred custom actions can not use MsiGetProperty to get all properties..  You can only use it to access a few special properties.  The most useful of these is called "CustomActionData"   If you set a property with the same name as your CA this will be used in place of   to CustomActionData when the CA is executed.  This is the only way to pass parameters into a deferred CA.



bjh

bjh
  • Members
  • 25 posts

Posted 24 May 2001 - 13:33

Ian, thank you for your answer.
So what are you saying is that there is no way I can access windows installer properties from a InstallScript function?

My problem was entirely different. What I am trying to do is to execute an action only at install time and not at uninstall time. I tried to set a property I created, when the "Remove" button is pressed and use it later to decide if the sequence is for uninstallation. I'll be happy to do it any other way if it's possible.


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 24 May 2001 - 14:09

>So what are you saying is that there is no way I can access windows installer properties from a InstallScript function?

No I am not saying that.  I was saying direct access to properties in a deferred custom action is not possible.  But you can via the CustomActionData method.

There is no problem setting a condition on a deferred custom action. (I am assuming your action is deferred because you have placed it between InstallInitialize and InstallFInalize).

The property being set on your remove button would need to be all capital letters ie public because private properties set or changed in the user sequence can not be read in the execute sequence.

I would question your use of the Remove button (on the maintenance dialog) this is not the only way to remove a package.  eg.  msiexec /X "product.msi" will do it.  Under Win2K and WinXP there is a remove button on the add remove programs control panel applet.  

You should make your custom action dependent upon the component it is related to. If CompX is being removed the condition $CompX=2 will be true.  If  you have a more global removal you could use the condition REMOVE="ALL"


bjh

bjh
  • Members
  • 25 posts

Posted 24 May 2001 - 14:34

The property has all capital letters.
Anyway, I've got the point and your last suggestion is definitley what I was looking for in the first place. I'll try it.

Thanks again,
Jean


bjh

bjh
  • Members
  • 25 posts

Posted 24 May 2001 - 15:57

It workde all right with REMOVE <> "ALL" (which is what I needed)

Thanks again!