Installing an msi from an msi

Jun 28, 2016 at 9:18 AM
Hi,

I guess its not possible to start msi installation from another msi installation?

Something in stackoverflow http://stackoverflow.com/questions/7645801/creating-basic-msi-that-invokes-another-msi-installation
but I did not understand this.

Secondly I know with Bootstraper can be used in this. But then in my case during runtime I want to download the MSI and then install it. Which is not possible I guess with bootstraper I guess?

please suggest some solution

thanks
Coordinator
Jun 28, 2016 at 10:10 AM
Your guess is right. MSI doesn't allow concurrent installations.

Though you can start the another installation while you are in already active installation which is still hasn't entered yet the actual installation phase. The "Simplified Bootstrapper" sample demonstrates the technique. While it does have significant limitations, its simplicity is appealing for the cases when for whatever reason one doesn't want to deal with true bootstrapper. A variation of this technique can be a custom UI setup and perform the secondary setup from one of the pre-install dialogs (e.g. Welcome dialog)

Bootstrapper on the other hand allows packages that involve downloading the binaries from the Internet. This is why you have that 'DownloadUrl' property.
Jun 28, 2016 at 11:29 AM
Hi, I like the first option so I think you are asking me to do this?
static void Main() {
            var project = new ManagedProject(Constants.NAME, new Dir(INSTALL_VERSION_DIRECTORY),
                new ElevatedManagedAction(CustonActions.DownloadMongodb, Return.check, When.Before, Step.LaunchConditions, Condition.NOT_Installed,Sequence.InstallUISequence) { Name = "Downloading Mongodb" },
                new ElevatedManagedAction(CustonActions.BeforeInstall, Return.check, When.Before, Step.LaunchConditions, Condition.NOT_Installed, Sequence.InstallUISequence) { Name = "Seting up database for you. Just few minutes!", },
                new ManagedAction(CustonActions.BeforeUnInstall, Return.check, When.Before, Step.InstallFinalize, Condition.Installed) { Name = "Uninstalling MongoDb" }
            );
But then I get this compilation error
Image
Jun 28, 2016 at 11:32 AM
Also about the DownloadURI , I mailed you once about the problem:

Thanks I tried that:
  var t = project.BuildMsi();
            var bootstrapper =
                  new Bundle("My Product",
                      //new PackageGroupRef("MongoInstaller"),
                      new MsiPackage(t) { },
                      new MsiPackage(BuildCrtMsi()) { DownloadUrl = @"https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.2.6-signed.msi"});
            bootstrapper.Id = Guid.NewGuid().ToString();
            bootstrapper.Version = Tasks.GetVersionFromFile(t);
            bootstrapper.Build();

 static public string BuildCrtMsi() {
            var crtProj =
                new ManagedProject("CRT",
                    new Dir(@"%ProgramFiles%\My Company\CRT"));

            return crtProj.BuildMsi();
        }
But during compile time I get this message:
"The Payload 'CRT.msi' is embedded but included a @DownloadUrl attribute. Embedded Payloads cannot be downloaded so the download URL is being ignored."

So its not possible then?

_sherry;
Jun 28, 2016 at 11:34 AM
Edited Jun 28, 2016 at 11:35 AM
I changed from ElevatedManagedAction to ManagedAction then it starts compiling something like this
  var project = new ManagedProject(Constants.NAME, new Dir(INSTALL_VERSION_DIRECTORY),
                new ManagedAction(CustonActions.DownloadMongodb, Return.check, When.Before, Step.LaunchConditions, Condition.NOT_Installed,Sequence.InstallUISequence) { Name = "Downloading Mongodb" },
                new ManagedAction(CustonActions.BeforeInstall, Return.check, When.Before, Step.LaunchConditions, Condition.NOT_Installed, Sequence.InstallUISequence) { Name = "Seting up database for you. Just few minutes!", },
                new ManagedAction(CustonActions.BeforeUnInstall, Return.check, When.Before, Step.InstallFinalize, Condition.Installed) { Name = "Uninstalling MongoDb" }
            );
But it does not call my method then and the setup Ends.
Coordinator
Jun 29, 2016 at 4:18 AM
> "The Payload 'CRT.msi' is embedded but included a @DownloadUrl attribute.
This is an ambiguous Burn error message. You will need to initialize some other package members in order to force Burn to treat the package as downloadable.
var msiOnlinePackage = new MsiPackage(crtMsi) 
{
    Vital = true,
    Compressed = false,
    DisplayInternalUI = true,
    DownloadUrl = @"https://dl.dropboxusercontent.com/....../CRT.msi"
};
You will need to consult Burn documentation for any other problems.

What I suggested to you is that if you don't want to invest too much into Bootstrapper you can just take the SimplifiedBpoptstraper sample and modify it to allow running the secondary msi not from the resources as in the sample but downloading it instead.

Though as I mentioned this approach "does have significant limitations". Thus any install/uninstall can only happen from the UI sequence, which will not be available on uninstall so your MongoDB will need to be uninstalled manually. However it might be the compromise you are comfortable with. The choice is yours. But I do not consider this whole approach a preferable. I thing the bootstrapper is your friend.