This is a two part question. I need both parts addressed for a complete answer.

Part I

I have a .NET 4.5 desktop app and I'm wondering if I can deploy it to Windows XP if, within "Requirements" in the app's Installshield project, I tick the ".NET 4.0 Full Package is Installed" checkbox instead of the ".NET 4.5 Full Package is Installed" one.

You can compile an application for .NET 4.5 and run it on the 4.0 runtime – that is until you hit a new feature that doesn’t exist on 4.0. At which point the app bombs at runtime. Say you write some code that is mostly .NET 4.0, but only has a few of the new features of .NET 4.5 like aync/await buried deep in the bowels of the application where it only fires occasionally. .NET will happily start your application and run everything 4.0 fine, until it hits that 4.5 code – and then crash unceremoniously at runtime.

So I know what the ability of my app to run on Windows XP with .NET 4.0 depends on. Let's assume for this question that my app won't crash as described in the above quote.

Part II

I also need to know what effect choosing ".NET 4.0 Full Package is Installed" instead of ".NET 4.5 Full Package is Installed" will have when installing the app onto a machine with .NET 4.5, but not .NET 4.0, installed. Will the Installshield installer see the installed .NET 4.5 package as .NET 4.0 and thus not complain? Or will it be picky and block the app's installation since specifically .NET 4.0 is not installed?

1 Answer
1

First thing you need to do is change the Target Framework version of your projects from 4.5 to 4.0 and rebuild. If you used any 4.5 specific feature then you'll now find out. You'll need to fix errors.

Part 2 is a non-issue, .NET 4.5 is a replacement for .NET 4.0. The installer is not going to uninstall 4.5 first so it can install 4.0, that would break all existing .NET apps on that machine.

Regarding part 1, is there any disadvantage to targeting 4.0 other than missing access to new 4.5 features? Regarding part 2, I already know 4.5 replaces 4.0. But my question is: does Installshield know this?
–
HappyNomadNov 7 '12 at 19:15

2

1:No. 2:Installshield is in the business of having to know this.
–
Hans PassantNov 7 '12 at 19:45