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

Feature Property and Custom Action


5 replies to this topic

shane

shane
  • Members
  • 4 posts

Posted 17 June 2005 - 03:17

Hello,

I am trying to run a custom action based on if a feature is installed. So I set the condition to
&featurename=3

But this isn't working. If I debug it, the debugger says that it equals 0 (holding mouse over &featurename )

This is in the InstallExecSequence and its after costfinalize.

I'm sure I've got things spelled correctly and stuff and checked the tables. I'm not sure why its not working.

Thanks
shane

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 17 June 2005 - 11:00

Is this a first-time install? The feature is selected to be installed (but is not installed previously)?

shane

shane
  • Members
  • 4 posts

Posted 17 June 2005 - 13:50

Yes.
Hmm, I guessing your going to tell me this makes a difference. The install shield doc I read made it sound this would work if was selected. Maybe I didn't understand it correctly.

I wamt the custom action to run when ever the feature is going to be installed - new install, upgrade what ever.

thanks
shane


shane

shane
  • Members
  • 4 posts

Posted 17 June 2005 - 14:09

Here is where I am getting my information:
http://www.installsh...iconditions.asp
Right below the table it says
"For example, to detect if the feature called "FeatureA" is selected to be installed locally, and that it wasn't already installed locally, you can use the condition &FeatureA=3."

But this isn't working.

If I read more carefully, the next paragraph says
"Feature-action conditions enable you to determine if a feature's installation state is changing (in the example above, from "not installed" to "installed locally"). If you want to determine a feature's state, regardless of whether the feature's state is changing, you can use "feature state" conditions. Feature-state conditions use the form !FeatureName=n, where n is one of the values from the table above."

which sounds like the same thing.
So maybe I want
&featurename=3 OR !featurename=3

I'll test this out.
Shane

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 17 June 2005 - 14:11

&featurename (feature action) will be 3 if the feature is going to be installed (is selected) but has not been installed previously. In the latter case:
!featurename=3
means the feature is currently installed (feature state)
To make it work in repair and upgrade:
!featurename=3 And Not &featurename=2
because feature action 2 means remove.
So what you really want is probably:
&featurename=3 Or (!featurename=3 And Not &featurename=2)
However 3 is the number for local install. There are different numbers for install to run from source or for advertise. This is all documented in Topic Conditional Statement Syntax at http://msdn.microsof...ment_syntax.asp

shane

shane
  • Members
  • 4 posts

Posted 22 June 2005 - 23:34

Thanks Stephan,

I got this working, but I had to change it to
&featurename=3 Or (!featurename=3 And Not &featurename=2 AND NOT REMOVE="ALL" )

to get it not to run during uninstall. I also had to move it below below CostFinalize.

I am having a similar problem where I want to open a new dialog after CustomSetup if a different feature is set to be installed.
I think it should work if I have &feature2=3 for the condition. But this isn't working.

shane