wix: running external msi before installation begins - wix

my application requires the microsoft visual c++ redisributable package (vcredist_x86.exe).
i have a custom action to run the vcredist_x86.exe
i want it to run only if it's not already installed. i created a registry search to check it.
the question: how do i run this action with the check? when using the InstallExecuteSequence element, as shown below, the vcredist_x86.exe crashes because you cannot run an msi while running a different msi
thanks,
Uzi

what you need is a bootstrapper that would install the VC++ redistributable before your MSI starts.
i'm using open source dotNetInstaller and it works pretty well.

Don't use the exe at all. To distribute the VC++ runtime in an msi-based install, use a merge module. No custom actions, no conditions to add, it just works.
Aaron Stebner's blog specifically talks about doing this with WiX.
http://blogs.msdn.com/astebner/archive/2007/02/13/building-an-msi-using-wix-v3-0-that-includes-the-vc-8-0-runtime-merge-modules.aspx

Related

Wix Installer execute Bootstrapper

I created already a SQL Installation with my sqlinstalltionCommand using Wix Bootstrapper and I want to pass this exe to my WIX installer as a Prerequisite.
if I opened the SQL Installation it works very fine, but when I call it from WIX Installer it does not work. I know this is not ideal but i need it with my files. Any IDEA??
Running one installer from inside another is not supported. The bootstrapper project can run your prerequisites and your package in one. Do that instead.

Running a Windows Installer inside another Windows Installer

I'm looking to create a Windows Installer package that will run an exe that runs another Windows Installer.
I'm putting a package together that has to install three files, an EXE, a CONFIG and an empty TXT. In addition, we also need to run the Access Database Engine 2007 as part of this process. However, when setting custom actions to just run it (with the flag /quiet) it fails because it's attempting to run an MSI inside of an MSI.
Is there any way I could somehow have it launch right after/right before or something? I've looked into WIX but honestly I'm clueless on how it would solve the problem.
Thanks.
You should look at the WiX Burn functionality and prerequisites. Some examples are:
WiX - Install Prerequisites and 3rd party applications
http://www.c-sharpcorner.com/UploadFile/cb88b2/installing-prerequisites-using-wix-bootstrapper-project-and/
You could probably just run the setup from the Burn bootstrapper - it will do its own detection if it's already installed.

Wix Toolset install C++ 2010 Redistributable

Can I integrate installation of Microsoft Visual C ++ 2010 redistributable together with my installation package through the Wix Toolset?
I tried this with a custom action, but it does not install if another installation is in progress. Would someone have any suggestions on how to do this?
Also, another question: can I call an MSI installer within this MSI installer that I am creating?
You can't do recursive MSI installs - at the risk of stating the obvious, when you get that error "another install is in progress" that other install is you.
If you use merge modules to install VC Runtimes AND you have a C++ service that is dependent on them that you start with StartServices (WiX ServiceControl) then you may find that the service won't start. This is because the SxS versions of the C++ Runtimes are not available until InstallFinalize, which is after the StartServices action. Possible solutions to this are:
Have the service built with static links to the C++ runtimes, but then updates to the VC++ runtime Dlls won't be applied to your built binary, in case that's an issue.
Use a bootstrapper like Burn to run the VC++ redist exe before you install your own MSI file.
Copy the runtime Dlls to your app folder as private copies that will be used only by your app. This kind of thing, old but still applicable I believe:
http://blogs.msdn.com/b/vcblog/archive/2007/10/12/how-to-redistribute-the-visual-c-libraries-with-your-application.aspx
Another issue you may run into with using the merge modules is that they require a per machine install. If you include them in a per User install then the install will fail.
You can install the C++ runtime files using the C++ runtime merge module:
How To: Install the Visual C++ Redistributable with your installer
And to your second question: No - this is not possible.

Launch MSI in REINSTALL mode

I need to launch an MSI depending on the version installed on the target machine.
To elaborate:
MSI shouldnt install if its version is less than the currently installed version.
Otherwise it should do REINSTALL using REINSTALLMODE=omus.
I know that this can be done by wrapping the MSI within a bootstrapper application or using cmd to launch MSI.
But could this intelligence be implemented within the MSI itself, so that it appropriately launches itself when I double-click it?
Will LaunchCondition or CustomAction help to achieve this?
I am using Visual Studio Setup Project to build my MSI. Will using WIX help to achieve this?
Thanks,
-Kunal
The first can be done inside the MSI but the second cannot. The MajorUpgrade Element has the AllowDowngrades and DowngradeErrorMessage attributes that implements a detect and block pattern.
The second isn't possible because it's immutable once the MSI starts. You need to invoke from bootstrapper such as burn to achieve this.

Initiate / call bootstrapper in WiX

I have created a bootstrpper using the dotNetInstaller tool. The created bootstrapper internally has these installers:
.NET Framework 4.0
SQL Server Express
Now through WiX, what are the steps that I need to follow to invoke the above Bootstrapper from WiX?
You should not invoke a bootstrapper from WiX - that has no sense. The idea behind the bootstrapper is to "bootstrap" the prerequisites of the installation (.NET and SQL Express in your case) and the main installation package. The main package you generate with WiX should be launched from inside the bootstrapper when the prerequisites are checked and optionally installed.
See this article for better understanding how to start with bootstrapper authoring with WiX.
If you are using WiX to create installers, I would suggest using WiX to create your bootstrapper as well.
http://wix.sourceforge.net/manual-wix3/authoring_bundle_intro.htm
You can only invoke packages from using bootstrapper, you can't invoke it from WiX. By the use of dotNetInstaller you can easily invoke one after another. One of the process as #Yan introduced. By the help of prerequisites folder. It is a very efficient and popular process. But what can I suggest for you, invoke link instead of folder. So your installation full package wouldn't not so bulky. Whatever the msi need it can directly download from internet and install it one after another. Follow the link.
http://www.codeproject.com/Articles/5116/dotNetInstaller-Setup-Bootstrapper-for-NET-Applica