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 Answers1

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();
        }
ba-a-aton
  • 574
  • 1
  • 4
  • 14
  • 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. – Hanna Baryskina Feb 25 '21 at 07:27
  • 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](https://stackoverflow.com/questions/7840380/custom-wix-burn-bootstrapper-user-interface). 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) – ba-a-aton Feb 25 '21 at 11:49