pitoloko
pitoloko

Reputation: 95

Automatically suggest to install the needed framework version if is not installed?

Suppose that I will target my Winforms application to Framework 4.5, but the user machine only has the Framework 3.X, and the user attempts to run the application, then the application will not run because the needed framework version is not installed on the machine...

...but there is a way to perform from my app an smart preventive operation in that case? (instead of let windows OS to display a non-friendly error msgbox)

What I want to do is for example show a msgbox to recommend the user to download X framework package in X url to be able to run the app, only if the required framework is not installed on the machine.

Upvotes: 1

Views: 190

Answers (2)

Kurubaran
Kurubaran

Reputation: 8892

You can simply do this by changing the setting under prerequisite of the Setup project.

  1. Right click the setup project and go to properties
  2. Select Prerequisite button
  3. It will open up another pop up window at the button of the window you will see three radio button options.
  4. Select Download the prerequisite from the component vendor's web site

When the target machine doesn't have the .net frame work instead of error message it will display download link to download .net framework.

enter image description here

Upvotes: 1

tucaz
tucaz

Reputation: 6684

If you distribute your application using ClickOnce you will get exactly this (among really other cool features as automatic updates).

Upvotes: 4

Related Questions