在主要Bundle之前安排RelatedBundle Action

时间:2014-02-06 19:39:37

标签: wix windows-installer wix3.7

我有一个应用程序需要在安装之前卸载相关的bundle。我可以正确检测它,并在OnPlanRelatedBundle()中将其状态设置为Absent,但在安装新软件包之后才会将其删除。有没有办法将相关的捆绑操作设置为在主捆绑之前发生?

    <RelatedBundle Action="Detect" Id="the-other-id" />

在后面的代码中,我为检测到的相关捆绑包

提供了以下内容
private void OnDetectedRelatedBundle(object sender, DetectRelatedBundleEventArgs e) 
{ 
    if (e.Operation == RelatedOperation.None && e.RelationType == RelationType.Detect) 
    { 
        // If the other app is installed, we want to save the product code,
        // so we can uninstall it like we were upgrading it 
        m_relatedBundleId = e.ProductCode; 
    } 
} 

对于规划相关的捆绑

private void OnPlanRelatedBundle(object sender, PlanRelatedBundleEventArgs args) 
{ 
    // If we've detected the related app, we want to schedule it to be uninstalled (State = Absent) 
    if (args.BundleId == m_relatedBundleId) 
    { 
        args.State = RequestState.Absent; 
    } 
}

1 个答案:

答案 0 :(得分:1)

今天,当前捆绑行动之后的所有相关捆绑行动。如果您有一个令人信服的用例来提供其他调度,请在http://wixtoolset.org/issues/打开功能请求。