开发者

Install different variant of program depending on condition

I am building an MSI package that should install one of multiple versions of a specific executable, depending on Windows version (i.e. one that uses new functionality in Windows Vista, and one that does the work itself).

The name of the executable should be the sam开发者_JAVA百科e, whichever version is installed (otherwise this would be trivial, no?).

What is the correct way to achieve this using Windows Installer?


The absolute best way to do this is to make the EXE file able to detect its own operating environment and choose a different method depending on what the OS provides so that there is only one binary to deal with.

There are many reasons for this:

  • a separate binary is almost like a dual code base in the sense that it must go through a full, separate QA for each release and it is generally easier to debug and fix a single binary
  • different binaries could lead to patching and upgrade problems and these are notoriously hard to debug and fix
  • your installer won't pass windows installer validation if you use the same installation location for different files with the same name. This is generally not a problem unless you are aiming for certification from Microsoft for your installer
  • MSI is clunky when it comes to deployment of different versions of the same file

If you must deploy two binaries I would create a new component with another copy of the EXE file and install it either with a different file name or with the same file name but in a different installation folder. You then condition the components with the files to be mutually exclusive for installation by using windows installer conditions. This would allow proper patching and upgrade.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜