Search code examples
visual-studiowindows-installerinstallationsetup-project

How to check custom system requirements before installation


Visual Studio Setup project:

I have to check certain system requirements before my setup runs. (Read some stuff from a file and then continue or cancel the setup depending on the content)

I tried adding a custom action with BeforeInstall but it gets executed too late. The old setup has already been uninstalled when my custom actions BeforeInstall gets executed.

How can I tell the setup to check certain system requirements before anything else gets executed/installed/changed? Is a custom action the wrong way to do it?

Thanks


Solution

  • Visual Studio Setup Projects abstracts the scheduling of custom actions as Install, Rollback, Commit, Uninstall and doesn't expose the ability to schedule a custom action in the way you'd need it to run.

    The only way to do this would be to use a WiX Merge Module to get the control you need and then merge it into your VDPROJ installer.

    Also you should know that VDPROJ is so horrible that Microsoft has removed it from Visual Studio 11 and told customers to use InstallShield Limited Edition (Free) instead.