BDeveloper
BDeveloper

Reputation: 1287

How to get application version from registry while installation using C#

i want to check for Pc suite version (which is in the user machine ) while installing the application.

what i want is :

1) when the user press on setup.exe i want to check for the pc suite version and if its older than a spicific version i want to inform him that the application will download the new version then continue installation( continue installing my application).

2) also i wan't to check if the user has .net framework 2 and it doesn't as previous i want to download it from a website.

What i did :

1) i added setup project to my sulotion and when i built it i had 2 files setup.exe and myApplication.msi. Now setup.exe checks for the pre-requisites i want but it install it normally as when the user intall it, Can i make this step work without making the user goes through the default installation process(not to ask him to choose accept, .. etc)

2) can i add option after installation "do you want to start myApplication "

Upvotes: 2

Views: 1582

Answers (1)

Daniel Richardson
Daniel Richardson

Reputation: 5284

If you are using a Visual Studio setup project you can check if the user has a particular version of the .NET Framework installed using a .NET Framework Launch Condition. If that version is not installed then the user will be prompted to download it and the install will be stopped.

Depending on how you check a system for an earlier version of your software you might be able use a combination of different launch conditions to stop the installation. However, if you want your setup executable to display a custom prompt to the user and then automatically download a new version you could create a standard Windows Forms application that:

  • Checks the version of the software currently installed
  • Downloads a newer installer if required
  • Executes the MSI installer

The MSI installer that your Windows Forms app runs can be created using a standard Visual Studio setup project.

Upvotes: 1

Related Questions