سؤال

I have created a MSI which also includes the installer file for crystal report (CRRedist2008_x86.msi). I would like to execute the crystal report MSI along with the main installer. I understand, I have to use some kind of Custom Action, but I am not sure about the exact way to go about this.

Perhaps the steps would be

i) Let the main installation finish ii) Execute the "CRRedist2008_x86.msi" using the command msiexec [I am not sure how to do this]

Could someone provide me guidance on how to achieve this?

هل كانت مفيدة؟

المحلول

There are two approaches for this:

  1. Add the Crystal Reports installer as a prerequisite. Most setup authoring tools support this and it's the recommended method.

  2. Create a custom action which launches the second installer. Windows Installer doesn't have a predefined custom action for launching other MSIs as regular files, but you can try creating a custom EXE which uses ShellExecute to launch the MSI file.

To run another MSI installer at the installation end you need to schedule it after InstallFinalize action and run it with the msidbCustomActionTypeAsync and msidbCustomActionTypeContinue flags: http://msdn.microsoft.com/en-us/library/aa368071(VS.85).aspx

نصائح أخرى

Your best bet is to use a bootstrapper (I've heard good things about the free dotNetInstaller, or there are commercial alternatives available)

Then configure your bootstrapper to do the following:

  • Check for Crystal Reports, install if not present
  • Check for any other dependencies, attempt to install if not present
  • Run your setup file (which should do these checks again, and abort if dependencies are not already installed)

For example, with the bootstrapper I use we check for

  • Windows Installer 3.1
  • .NET 2.0+

If they're not present, they're then downloaded off the net and installed automatically. This all happens before the main install starts.

Hope that helps :)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top