Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best approach to install prerequisite on client machine using msi

I have msi and wants to check whether vsto run-time is installed on target machine, I have used launch condition through VS2008 in my msi but it only redirect user to vendor's website. I just want to install the prerequisite if it is not installed on machine and want the prerequisite to be installed during the msi is running. It can be summarized as:

When msi is running:

  1. It must check whether the prerequisite is installed if yes then resume the installation
  2. If not then install the prerequisite first and then resume the msi installation

I searched and find many solution like single package executable, vb script in custom action, but requirement is not to ship anything with the installer neither the exe is acceptable :(

I have orca installed but dont have much knowledge to customizing msi using Orca

Your help is appreciated.. Thanks in advance...

like image 320
Smack Avatar asked Sep 09 '11 16:09

Smack


2 Answers

WIX is one of the most powerful (and free) tools for creating Windows installers. There's an end-to-end article I wrote a while ago on Creating a localized Windows Installer & bootstrapper, which may help.

You can enforce prerequisites by defining conditions in the WIX file, for example.

<Condition Message="[ProductName] requires the Microsoft .NET Framework 4 Client Profile">
    Installed Or NETFRAMEWORK40CLIENT
</Condition>

However to install the prerequisite, you will need a boostrapper (EXE).

The article above shows how to use dotNetInstaller to create managed EXEs, which check and install these prerequisites before executing the embedded MSI at the end. You can of course also just chain a load of MSIs together as well, it's really flexible.

I believe WIX also has a tool called Burn which was meant to be released in 3.5, I haven't used it, but it also provides bootstrap functionality.

Orca isn't really used for compling MSIs, it's just useful for debugging and digging around inside.

like image 177
TheCodeKing Avatar answered Sep 21 '22 15:09

TheCodeKing


Since an EXE bootstrapper is not acceptable, there is only one solution:

  • store the prerequisite installers in Binary table of your MSI
  • create some custom actions which extract them from this table and launch them
  • schedule them in InstallUISequence, for example right before Progress dialog
  • use searches to detect if the prerequisites are installed or not
  • condition your custom actions with the search results

Basically, you need to launch them during the installation UI. It may not work if the custom actions run during InstallExecuteSequence.

This is not supported by Visual Studio, but some commercial setup authoring tools have direct support for it. If you want a free solution you can use WiX, but you will need to write the custom actions yourself.

like image 33
rmrrm Avatar answered Sep 21 '22 15:09

rmrrm