Wix 中的进度条在卸载时表现不同
Progress bar in wix behaves differently while uninstalling
我已经为我的引导程序安装程序创建了一个进度条。安装时它正确地达到 100%。但是在卸载时它只会达到 50% 并停在那里。下面是我的代码。
在我的 ViewModel 的构造函数中 class。
this.Bootstrapper.CacheAcquireProgress += (sender, args) =>
{
this.cacheProgress = args.OverallPercentage;
this.Progress = (this.cacheProgress + this.executeProgress) / 2;
};
this.Bootstrapper.ExecuteProgress += (sender, args) =>
{
this.executeProgress = args.OverallPercentage;
this.Progress = (this.cacheProgress + this.executeProgress) / 2;
};
然后getter和setter如下。
private int progress;
public int Progress
{
get { return progress; }
set
{
this.progress = value;
RaisePropertyChanged("Progress");
}
}
private int cacheProgress;
private int executeProgress;
我在这里做错了什么?为什么卸载时进度条停留在 50%,虽然卸载已完成?请指教
并非每个 Apply 操作都会有缓存阶段,使用 OnApplyPhaseCount
(在 v4 中它在 OnApplyBegin
中)回调来了解分母应该是什么。
我已经为我的引导程序安装程序创建了一个进度条。安装时它正确地达到 100%。但是在卸载时它只会达到 50% 并停在那里。下面是我的代码。
在我的 ViewModel 的构造函数中 class。
this.Bootstrapper.CacheAcquireProgress += (sender, args) =>
{
this.cacheProgress = args.OverallPercentage;
this.Progress = (this.cacheProgress + this.executeProgress) / 2;
};
this.Bootstrapper.ExecuteProgress += (sender, args) =>
{
this.executeProgress = args.OverallPercentage;
this.Progress = (this.cacheProgress + this.executeProgress) / 2;
};
然后getter和setter如下。
private int progress;
public int Progress
{
get { return progress; }
set
{
this.progress = value;
RaisePropertyChanged("Progress");
}
}
private int cacheProgress;
private int executeProgress;
我在这里做错了什么?为什么卸载时进度条停留在 50%,虽然卸载已完成?请指教
并非每个 Apply 操作都会有缓存阶段,使用 OnApplyPhaseCount
(在 v4 中它在 OnApplyBegin
中)回调来了解分母应该是什么。