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

MsiGetFeatureState


5 replies to this topic

Heike

Heike
  • Members
  • 20 posts

Posted 13 May 2002 - 14:29

Hi!
In Installscript im using
retFeature = MsiGetFeatureState ( ISMSI_HANDLE, "FeatureName", sFeatureState, sActionState );
to determine in which feature and in which mode I am. But I'm really confused about the values of sFeatureState an sActionState.
During Custom-Installation
- selected feature sFeatureState = 2 and sActionState = 3
- unselected feature sFeatureState = 2 and sActionState = 3

During Modify:
- selected feature sFeatureState = -1 and sActionState = 3
- unselected feature sFeatureState = -1 and sActionState = 2

During Uninstall:
- feature sFeatureState = -1 and sActionState = -1
but on at another feature: sFeatureState = 3 and sActionState = 2 or  sFeatureState = 2 and sActionState = -1

Does anyone know how to handle the return values of MsiGetFeatureState, or has a better idea?
The Installscript-code should only be executed when it is an selected feature and is not in uninstallation-mode.

Thanx
     Heike ???[B]

pdriley

pdriley
  • Members
  • 91 posts

Posted 13 May 2002 - 17:29

Is this a standard or a Basic MSI project?

Where in the sequence is this code being run?
Paul Riley (Vector Networks), InstallShield User.

Heike

Heike
  • Members
  • 20 posts

Posted 14 May 2002 - 06:11

Hi!
It's a MSI project and some features rum just before InstallFinalize and some must run after.

Heike ???

pdriley

pdriley
  • Members
  • 91 posts

Posted 14 May 2002 - 14:19

Some "features" run after InstallFinalize?

You mean some CustomActions, surely?

You should be very careful what you do after InstallFinalize because you lose some of the properties and such.  I've had some bizarre results trying to do things at the end of an installation and managed somehow to squeeze them all into the deferred area instead.  Any hope you can do the same?
Paul Riley (Vector Networks), InstallShield User.

Heike

Heike
  • Members
  • 20 posts

Posted 16 May 2002 - 09:27

I' ve managed to move almost all features before InstallFinalize, but the results of MSiGetFeatureState are still confusing. In a InstallScript Function I must now in which mode I run, especially the UnInstall-Mode. Is there any other possiblity to recognize in which mode the setup run?

Heike :0

pdriley

pdriley
  • Members
  • 91 posts

Posted 16 May 2002 - 09:55

Not from within the script.  You can put conditions on a CustomAction based on Feature States and Actions, but I'm not sure it'll be much less confusing.

See the bottom of article "Conditional Statement Syntax" in the MSI Help file for information on that.  It may go some way to explain the feature states you're getting too.

If you still have questions then come back here :)
Paul Riley (Vector Networks), InstallShield User.