views:

2658

answers:

2

I am creating an .msi package for the application which has a prerequisite for installation. I am using the Visual Studio 2005 Bootstrapper for this task. To this end, I did the following: Located the folder C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\ and created a folder for my prerequisite (made it same structure as 'dotnetfx'); created the 'product.xml' and 'package.xml' and placed them appropriately. I kept the xml files very simple so far to test the installation:

product.xml

<?xml version="1.0" encoding="utf-8"?>
<Product ProductCode="MyPrereq" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"&gt;
  <PackageFiles CopyAllPackageFiles="false">
    <PackageFile Name="MyPrereq.exe" />
  </PackageFiles>
  <InstallChecks>
  </InstallChecks>
  <Commands Reboot="None">
    <Command PackageFile="MyPrereq.exe" EstimatedInstallSeconds="90">
      <InstallConditions>
      </InstallConditions>
      <ExitCodes>
    <ExitCode Value="0" Result="Success"/>
        <DefaultExitCode Result="Fail" String="GeneralFailure" FormatMessageFromSystem="true" />
      </ExitCodes>
    </Command>
  </Commands>
</Product>

package.xml

<?xml version="1.0" encoding="utf-8"?>
<Package Name="MyPrereq" Culture="Culture" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"&gt;
  <Strings>
    <String Name="Culture">en</String>
    <String Name="DisplayName">MyPrereq</String>
    <String Name="GeneralFailure">A fatal error occurred. The installation failed.</String>
  </Strings>
</Package>

Now I can add the prerequisite from the list and build my setup project.

The problem:

The build output is the 'setup.exe', the 'MyApp.msi' package, plus the subfolder called 'MyPrereq' which contains 'MyPrereq.exe'.

I would like the build to create a 'setup.exe' and a single 'MyApp.msi', which would contain the 'MyPrereq' inside, with no additional files/directories.

I know that the .NET framework is another prereq for my app, and it is included in the same .msi, so that should be possible somehow.

How can I achieve this?

+3  A: 

You can create a self-extracting installer with tools such as IExpress (coming with Windows) containing all files in a single executable (see this SO posting).

You cannot have an MSI file installing its own pre-requisites. First, because Windows Installer itself is a pre-requisite (and must be installed by a non MSI exe) and second because Windows Installer installations are transactional and don't support the chained execution of MSI files. This basically means that one MSI installation cannot start another MSI installation. As a consequence, any pre-requisites must be installed by a separate bootstrapper (by the way, the installation is no longer transactional - the pre-requisites won't get uninstalled if your MSI installation fails).

There seems to be a basic mis-understanding about the bootstrapper mechanism though. The bootstrapper can currently only be generated by Visual Studio or MSBuild. Afaik it is not possible with WiX. Look for the GenerateBootstrapper task in MSBuild (see this SO posting).

0xA3
+2  A: 
Evgeny
Thanks for posting your further solution here, hope it is useful for other people, too. I'm not exactly sure about your specific scenario, but in general, IExpress should recognize subfolders. They must be declared in the config file, see the link that i posted above.
0xA3
I don't see in that link where subfolder support is mentioned. IExpress doesn't support them I think as the generated cab is flat
tjmoore

related questions