문제

Is there a way to skip one of package in chain? I have looked at "InstallCondition" and have code like this.

                      <ExePackage Id="RoboMongo"
                        DisplayName="RoboMongo"
                        Cache="no"
                        Compressed="no"
                        PerMachine="yes"
                        Permanent="no"
                        Vital="no"
                        Name="redist\Robomongo-0.8.4-RC2-i386.exe"
                        DownloadUrl="$(var.RoboMongoUrl)"
                        InstallCondition="ComponentSelect_5"
                        InstallCommand='/Action=Install'
                        UninstallCommand="/Action=Uninstall"
                        RepairCommand ="/Action=Repair"
                        DetectCondition="RoboMongoInstalled">

            <RemotePayload Description="Программа администрирования MongoDB"
            Version ="0.8.4.2"
                ProductName="RoboMongo"
                Hash="71C17E48BC32304FA8724FFA7CA1C4C08891BC97" Size="7141182" />

But i don't want to uninstall it on InstallCondition=false. I just want to skip it.

Thank you in advance.

도움이 되었습니까?

해결책

If you are using managed bootstrapper application, required behavior can be achieved by handling PlanPackageBegin event. Code would look approximately like this:

    public MainViewModel(BootstrapperApplication bootstrapper)
    {
        bootstrapper.PlanPackageBegin += (sender, args) =>
        {
            if (bootstrapper.Engine.StringVariables["ShouldSkipPackage"] == "1")
                if (args.PackageId == "RoboMongo")
                    args.State = RequestState.None;
        };
    }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top