Thank you Rob, that works. 

In case anyone has the same issue.  

Here is my code to get it work

        private void ExecuteOnPlanMsiFeature(object sender, 
PlanMsiFeatureEventArgs args)
        {
            if (this.action == LaunchAction.Install)
            {
                   If (user selected the feature, and we want to install it)    
             // ba request state will be set to local
                  {
                          args.State = FeatureState.Local;
                  }
                 else
                 {
                          args.State = FeatureState.Absent;
                   }
            }
        }

Thanks, 
Nan
-----Original Message-----
From: Rob Mensching [mailto:r...@robmensching.com] 
Sent: Monday, April 01, 2013 2:22 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] BA has problem adding a feature

Don't try to control feature states using the properties. Instead, turn on 
EnableFeatureSelection and handle the PlanFeature callback from the engine.
The ADDLOCAL property and friends won't give you the control necessary to 
succeed.


On Mon, Apr 1, 2013 at 2:10 PM, Nan Zang <naz...@microsoft.com> wrote:

> Hi,
>
>   I am building a bootstrapper based on the managed BA (I am using a 
> customized WPF UI), but met with the following issue.
>
> My BA.exe refers to an MsiPackage, which contains two features 
> (WebService and AdminTool).
>
> If everything is not installed, if user selects AdminTool, the BA will 
> call msi using ADDLOCAL=AdminTool and AdminTool is installed as expected.
> But, there is a problem, if AdminTool has been installed, and user 
> selects to Add "WebService" Feature,  the BA will call msi using 
> ADDLCAL=WebSerivce (I also tried ADDLOCAL=ALL ) WebServiceFeature 
> didn't get installed at all, and also there is no error reported.
>
> Can anyone provide any hint on troubleshooting this one?
>
> Here is the log:
>
> [18BC:1C48][2013-04-01T13:41:39]i001: Burn v3.7.1224.0, Windows v6.1 
> (Build 7601: Service Pack 1), path:
> E:\rmsonline\bins\debug\amd64\Setup\AadrmConnectorSetup\AadrmConnector
> Setup.exe,
> cmdline: ''
> [18BC:1C48][2013-04-01T13:41:39]i000: Setting string variable 
> 'WixBundleLog' to value 'C:\Users\nazang\AppData\Local\Temp\Azure AD 
> Rights Management Connector_20130401134139.log'
> [18BC:1C48][2013-04-01T13:41:39]i000: Setting string variable 
> 'WixBundleOriginalSource' to value 
> 'E:\rmsonline\bins\debug\amd64\Setup\AadrmConnectorSetup\AadrmConnectorSetup.exe'
> [18BC:1C48][2013-04-01T13:41:49]i000: Loading managed bootstrapper 
> application.
> [18BC:1C48][2013-04-01T13:42:21]i000: Creating BA thread to run 
> asynchronously.
> [18BC:1DD8][2013-04-01T13:42:38]i000: Full
> [18BC:1DD8][2013-04-01T13:42:38]i000: Launching the AADRM Connector 
> Setup UI.
> [18BC:1C48][2013-04-01T13:42:55]i100: Detect begin, 2 packages
> [18BC:1C48][2013-04-01T13:42:56]i000: Setting string variable 
> 'Netfx4x64FullVersion' to value '4.5.50709'
> [18BC:1C48][2013-04-01T13:42:56]i000: Setting string variable 
> 'Netfx4FullVersion' to value '4.5.50709'
> [18BC:1C48][2013-04-01T13:42:56]i052: Condition 'Netfx4FullVersion AND 
> (NOT VersionNT64 OR Netfx4x64FullVersion)' evaluates to true.
> [18BC:1C48][2013-04-01T13:43:04]i101: Detected package: NetFx40Web, state:
> Present, cached: None
> [18BC:1C48][2013-04-01T13:43:04]i101: Detected package:
> AADRMConnectorPackage, state: Present, cached: None
> [18BC:1C48][2013-04-01T13:43:04]i104: Detected package:
> AADRMConnectorPackage, feature: AADRMConnectorWebService, state: 
> Absent
> [18BC:1C48][2013-04-01T13:43:04]i104: Detected package:
> AADRMConnectorPackage, feature: AADRMConnectorAdminTool, state: Local
> [18BC:1C48][2013-04-01T13:43:04]i199: Detect complete, result: 0x0
> [18BC:1C48][2013-04-01T13:44:24]i200: Plan begin, 2 packages, action:
> Install
> [18BC:1C48][2013-04-01T13:44:25]w321: Skipping dependency registration 
> on package with no dependency providers: NetFx40Web
> [18BC:1C48][2013-04-01T13:44:25]i204: Plan 2 msi features for package:
> AADRMConnectorPackage
> [18BC:1C48][2013-04-01T13:44:25]i203: Planned feature:
> AADRMConnectorWebService, state: Absent, default requested: Unknown, 
> ba
> requested: Unknown, execute action: None, rollback action: None
> [18BC:1C48][2013-04-01T13:44:25]i203: Planned feature:
> AADRMConnectorAdminTool, state: Local, default requested: Unknown, ba
> requested: Unknown, execute action: None, rollback action: None
> [18BC:1C48][2013-04-01T13:44:25]i201: Planned package: NetFx40Web, state:
> Present, default requested: Present, ba requested: Present, execute: 
> None,
> rollback: None, cache: No, uncache: No, dependency: None
> [18BC:1C48][2013-04-01T13:44:25]i201: Planned package:
> AADRMConnectorPackage, state: Present, default requested: Present, ba
> requested: Present, execute: None, rollback: None, cache: No, uncache: 
> No,
> dependency: Register
> [18BC:1C48][2013-04-01T13:44:25]i000: Setting string variable 'ADDLOCAL'
> to value 'AADRMConnectorWebService'
> [18BC:1C48][2013-04-01T13:44:25]i299: Plan complete, result: 0x0
> [18BC:1C48][2013-04-01T13:44:25]i300: Apply begin
> [0DB8:1D50][2013-04-01T13:44:34]i360: Creating a system restore point.
> [0DB8:1D50][2013-04-01T13:44:34]i362: System restore disabled, system 
> restore point not created.
> [0DB8:1D50][2013-04-01T13:44:34]i323: Registering package dependency
> provider: {1EE6FAA1-542C-4450-BFC9-223FC2E50C69}, version: 1.0.962.0,
> package: AADRMConnectorPackage
> [0DB8:1D50][2013-04-01T13:44:34]i325: Registering dependency:
> {2f499eb8-d97c-46c0-8528-4146414b608d} on package provider:
> {1EE6FAA1-542C-4450-BFC9-223FC2E50C69}, package: AADRMConnectorPackage
> [18BC:1C48][2013-04-01T13:44:34]i399: Apply complete, result: 0x0,
> restart: None, ba requested restart:  No
> [18BC:1C48][2013-04-01T13:44:38]i500: Shutting down, exit code: 0x0
> [18BC:1C48][2013-04-01T13:44:38]i410: Variable: ADDLOCAL = 
> AADRMConnectorWebService
> [18BC:1C48][2013-04-01T13:44:38]i410: Variable: Netfx4FullVersion =
> 4.5.50709
> [18BC:1C48][2013-04-01T13:44:38]i410: Variable: Netfx4x64FullVersion =
> 4.5.50709
> [18BC:1C48][2013-04-01T13:44:38]i410: Variable: VersionNT64 = 6.1.0.0
> [18BC:1C48][2013-04-01T13:44:38]i410: Variable: WixBundleAction = 4
> [18BC:1C48][2013-04-01T13:44:38]i410: Variable: WixBundleElevated = 1
> [18BC:1C48][2013-04-01T13:44:38]i410: Variable: WixBundleInstalled = 1
> [18BC:1C48][2013-04-01T13:44:38]i410: Variable: WixBundleLog = 
> C:\Users\nazang\AppData\Local\Temp\Azure AD Rights Management 
> Connector_20130401134139.log
> [18BC:1C48][2013-04-01T13:44:38]i410: Variable: WixBundleManufacturer 
> = Microsoft Corporation
> [18BC:1C48][2013-04-01T13:44:38]i410: Variable: WixBundleName = Azure 
> AD Rights Management Connector
> [18BC:1C48][2013-04-01T13:44:38]i410: Variable: 
> WixBundleOriginalSource = 
> E:\rmsonline\bins\debug\amd64\Setup\AadrmConnectorSetup\AadrmConnector
> Setup.exe
> [18BC:1C48][2013-04-01T13:44:38]i410: Variable: WixBundleProviderKey = 
> {2f499eb8-d97c-46c0-8528-4146414b608d}
> [18BC:1C48][2013-04-01T13:44:38]i410: Variable: WixBundleTag =
> [18BC:1C48][2013-04-01T13:44:38]i410: Variable: WixBundleVersion = 
> 1.0.0.0
> [18BC:1C48][2013-04-01T13:44:38]i007: Exit code: 0x0, restarting: No
>
> ----------------------------------------------------------------------
> -------- Own the Future-Intel&reg; Level Up Game Demo Contest 2013 
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game on 
> Steam. $5K grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013 Rise to greatness in 
Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game on Steam. $5K 
grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users




------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to