0

I'm new to Enterprise level applications, and I've been used to "Caveman-style" coding.

I have a WPF application that is deployed on multiple clients. I'm tasked with querying the system and checking the installed .NET Frameworks. If v4.0 (and later) isn't installed, I'm wanting to silently install it while the application remains open.

My question is; is there a best practice for this task?

I'm not wanting to chain a forced upgrade to the installation, if it can be helped. Would Configuring Assembly Binding be a better solution, or adjusting the App config xaml?

<Configuration>
    <startup>
       <supportedRuntime version = "v2.0.50727" />
       <supportedRuntime version = "v4.0.3" />
    </startup>
</Configuration>

I've also read about creating Bootstrapper packages, and this looks like it might be useful, but I have never programmed one before.

Many thanks.

Community
  • 1
  • 1
Jake_TheCoder
  • 57
  • 1
  • 9
  • 3
    Installing the framework is not the application's task. Create a setup or contact their system administrators to roll out the appropriate framework. – CodeCaster Sep 16 '14 at 16:04
  • It *could* be the task of an installer, but certainly not the application itself. – BradleyDotNET Sep 16 '14 at 16:08
  • Seems, I misread the specs for my project (greenhorn error). The latest updates of .NET Frameworks are already installed, but the `string Framework = Environment.Version.ToString();` is only returning the first installed version, which is v2.0. Thanks for all the help. – Jake_TheCoder Sep 16 '14 at 20:09

1 Answers1

2

Please take into consideration that corporate users (who launch your app) may be disallowed to do any local administration routines (including installation of new software, especially such system-level things as .NET frameworks). Thus, any attempt to install that framework will be refused by lack of permissions.

So then, create MSI installation package, mark .NET as a dependency to be installed and let admins to do their job. Otherwise, there is a big chance your software would never see even single Enterprise PC.

Yury Schkatula
  • 5,291
  • 2
  • 18
  • 42
  • That's true, I hadn't considered the local users won't have the privileges to update the frameworks. What if I was to update the API call to get any updated frameworks? – Jake_TheCoder Sep 16 '14 at 16:20