I am trying, in my Managed Bootstrap Application, detect that my bundle is
already installed and that a few optional features are installed as well. I
wrote the code below, but I never get into the PlantMsiFeature code. I have
set the EnableFeatureSelection on my MsiPackage. Basically, the thinking here
is that PlanMsiFeature is called when either (a) the BA is called while the
product is installed or (b) the Change button is selected in Add/Remove
Programs. The OptFeat…Selected functions mark that the Feature name should be
added to the ADDLOCAL string I pass to the MsiPackage as a property and also
set an internal property which corresponds to a checkbox on the RootView (the
xaml code). But, I never see this logging in my log file and I have tried all
the possible options for LogLevel.
privatevoid PlanMsiFeature(object sender, PlanMsiFeatureEventArgs e)
{
/* PROJMGMT = "ProjectEnvironment";
BULKLOAD = "Bulkload";
PIDSERVICE ="PIDService";
IFCSERVICE = "IFCService";
SERVER = "Server";
*/
// Only check feature states if product is already installed
if (this.root.State == InstallationState.DetectedPresent)
{
TestBA.Model.Engine.Log(LogLevel.Debug, "$$$ - Detected
Feature: " + e.FeatureId.ToString() + " State: " +
e.State.ToString());
switch (e.FeatureId.ToString())
{
case PROJMGMT:
if (e.State == FeatureState.Local)
{
this.OptFeatProjMgmtSelected = true;
}
break;
case BULKLOAD:
if (e.State == FeatureState.Local)
{
this.OptFeatBulkloadSelected = true;
}
break;
case PIDSERVICE:
if (e.State == FeatureState.Local)
{
this.OptFeatPIDServiceSelected = true;
}
break;
case IFCSERVICE:
if (e.State == FeatureState.Local)
{
this.OptFeatIFCServiceSelected = true;
}
break;
case SERVER:
if (e.State == FeatureState.Local)
{
this.OptFeatSvrConnSelected = true;
}
break;
}
}
}
Assuming I get the detection of feature states working, what
would I then call to do the modification? I added a ModifyCommand, similar to
the InstallCommand in the WixBA, to “apply” the changes to feature state. Is
this what should be called or would you call Plan(LaunchAction.Install) again?
publicICommand ModifyCommand
{
get
{
if (this.modifyCommand == null)
{
this.modifyCommand = new RelayCommand(param =>
this.Plan(LaunchAction.Modify), param => this.root.State ==
InstallationState.DetectedPresent);
}
return this.modifyCommand;
}
}
Thanks in advance,
Brian
------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users