0

I created a wix bootstrapper app with a user interface that has 2 checkboxes. The user can choose what to install. This is part of my bootstrapper app:

 <MsiPackage 
        InstallCondition="ClientCondition"
        DisplayInternalUI='yes'
        Visible="yes"
        SourceFile="D:\Project\FirstInstaller.msi"
      />
      <MsiPackage
        InstallCondition="ServerCondition"
        DisplayInternalUI='yes'
        Visible="yes"
        SourceFile="D:\Project\SecondInstaller.msi"
      />

Problem : For example, I already have FirstInstaller installed, and I'm trying to install the second one. Due to a false condition, my FirstInstaller will be uninstalled. But this is not what I expected. How do I fix this and have some "ignore" value for the Msi package in the chain ?

1 Answer 1

0

I don't know wich language your bootstrapper is written on, but, as option, you can control your msi installation directly from your code via cmd and msiexec command.

Code example for C#:

        var command = @"/c msiexec /i c:\path\to\package.msi";
        //for silent: /quiet /qn /norestart 
        //for log: /log c:\path\to\install.log 
        //with properties: PROPERTY1=value1 PROPERTY2=value2";
        var output = string.Empty;
        using (var p = new Process())
        {
            p.StartInfo = new ProcessStartInfo()
            {
                FileName = "cmd.exe",
                Arguments = command,
                UseShellExecute = false,
                RedirectStandardError = true,
                RedirectStandardOutput = true,
                CreateNoWindow = true,
            };
            p.Start();
            while (!p.StandardOutput.EndOfStream)
            {
                output += $"{p.StandardOutput.ReadLine()}{Environment.NewLine}";
            }
            p.WaitForExit();
            if (p.ExitCode != 0)
            {
                throw new Exception($"{p.ExitCode}:{ p.StandardError.ReadToEnd()}");
            }
            Console.WriteLine(output);
            Console.ReadKey();
        }
Sign up to request clarification or add additional context in comments.

2 Comments

Hi, ba-a-anton, thank you for your answer. But there is a problem with your solution, in this case I have to deliver to the customer both the installers and another application to manage them.
well, in some cases bootstrapper is already that "another application" - you can write custom bootstrapper that have it's own UI and codebehind. Idea was to add my sample to that codebehind. I assumed that it's your case, but now it seems you use standard one. If you need more information, see this thread. It's a little bit confusing topic, and may be overhead in your case, especcially if you need C# bootstrapper. But, at least, you have an option)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.