It might help to explain exactly what you're trying to achieve here. Your 
custom action is in the execute sequence and (assuming you've shown UI) 
decisions about what features are going to be installed have already been made. 
In addition, the costing actions have already been done in the UI, so 
CostInitialize/Finalize etc have been called in the UI sequence. 

So if you want to set a property based on the feature state of a particular 
feature I don't think you need any code anyway. You'd use a type 51 custom 
action that sets your XXXXX property to 1, sequence it in the right place, and 
condition it on &FeatureA=3 (meaning it's going to be installed). 

Again, it would be useful to know what you're trying to achieve because you may 
be taking a long convoluted path when there is a shorter way to get there. 


Phil Wilson 

-----Original Message-----
From: akihiro.shib...@jp.yokogawa.com [mailto:akihiro.shib...@jp.yokogawa.com] 
Sent: Thursday, February 03, 2011 8:18 PM
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] How to Get Feature State In the Custom Action


I am trying  MsiGetFeatureState is called after MsiDoAction in CustomAction.


 MsiDoAction( hInstall, "CostInitialize" ); 
 MsiDoAction( hInstall, "FileCost" );
 MsiDoAction( hInstall, "CostFinalize" );
    :
 MsiGetFeatureState( hInstall, "FEATUREA",  ... );


Is the problem in this method?


> -----Original Message-----
> From: Rob Mensching [mailto:r...@robmensching.com] 
> Sent: Friday, February 04, 2011 1:50 AM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] How to Get Feature State In the Custom Action
> 
> The Feature state isn't set before CostInitialize.
> 
> On Thu, Feb 3, 2011 at 3:48 AM, 
> <akihiro.shib...@jp.yokogawa.com> wrote:
> 
> > Hi!
> >
> >  I want use MsiGetFeatureState in CustomAction, and the 
> CustomAction 
> > is scheduled before "CostInitialize".
> >
> >
> > in Wix:
> > <CustomAction Id="SetPropertyByFeatureState"
> > DllEntry="SetPropertyByFeatureState" BinaryKey="XDLL" /> 
> > <InstallExecuteSequence>
> >   <Custom Action="SetPropertyByFeatureState" /> 
> > </InstallExecuteSequence>
> > --------------------------------
> >
> > in C++ CustomAction:
> > --------------------------------
> > UINT _stdcall SetPropertyByFeatureState( MSIHANDLE hInstall ) {
> >      INSTALLSTATE installed;
> >      INSTALLSTATE action;
> >
> >
> >     // Get Feature State
> >     ::MsiGetFeatureState( hInstall, "FEATUREA",  
> &installed, &action );
> >
> >
> >        :
> >      // Set Property by installed.
> >      if( installed ==  ::INSTALLSTATE_LOCAL ) {
> >        MsiSetProperty( hInstall, "XXXXX", "1" );
> >      }
> >
> >     :
> > }
> >
> > How to get Feature state in the CustomAction and before 
> CostInitialize ?
> >
> >
> >
> > 
> --------------------------------------------------------------
> ----------------
> > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
> > Finally, a world-class log management solution at an even better
> > price-free!
> > Download using promo code Free_Logger_4_Dev2Dev. Offer expires
> > February 28th, so secure your free ArcSight Logger TODAY!
> > http://p.sf.net/sfu/arcsight-sfd2d
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> >
> 
> 
> -- 
> virtually, Rob Mensching - http://RobMensching.com LLC
> --------------------------------------------------------------
> ----------------
> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
> Finally, a world-class log management solution at an even 
> better price-free!
> Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
> February 28th, so secure your free ArcSight Logger TODAY! 
> http://p.sf.net/sfu/arcsight-sfd2d
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
> 
------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


*** Confidentiality Notice: This e-mail, including any associated or attached 
files, is intended solely for the individual or entity to which it is 
addressed. This e-mail is confidential and may well also be legally privileged. 
If you have received it in error, you are on notice of its status. Please 
notify the sender immediately by reply e-mail and then delete this message from 
your system. Please do not copy it or use it for any purposes, or disclose its 
contents to any other person. This email comes from a division of the Invensys 
Group, owned by Invensys plc, which is a company registered in England and 
Wales with its registered office at 3rd Floor, 40 Grosvenor Place, London, SW1X 
7AW (Registered number 166023). For a list of European legal entities within 
the Invensys Group, please go to 
http://www.invensys.com/legal/default.asp?top_nav_id=77&nav_id=80&prev_id=77.

You may contact Invensys plc on +44 (0)20 3155 1200 or e-mail 
recept...@invensys.com. This e-mail and any attachments thereto may be subject 
to the terms of any agreements between Invensys (and/or its subsidiaries and 
affiliates) and the recipient (and/or its subsidiaries and affiliates).



------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to