Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if asp.net mvc 3 is installed?

Tags:

powershell

I'm trying to write a powershell script that would install asp.net mvc 3 if it is not already installed. How do i check if a specific version of asp.net mvc 3 is installed?

like image 507
burnt1ce Avatar asked Jan 20 '11 17:01

burnt1ce


People also ask

How do I know if ASP.NET MVC is installed?

During design time go to “Solution Explorer." Right click on it and expand the “References” folder. Right click on “Web. MVC” Assembly. Then select “Properties” and you can find the versions.

Where is MVC installed?

C:\Program Files (x86)\Microsoft ASP.NET Inside this folder will be all versions of MVC that you have installed.

What is the current version of ASP.NET MVC?

ASP.NET Core MVC 3.1. 1 released on 14 January 2020 is the latest ASP.NET MVC version.


2 Answers

I think you can't change the location of the install folder, so you could probably just:

test-path "${Env:ProgramFiles(x86)}\Microsoft ASP.NET\ASP.NET MVC 3"
like image 102
Jaykul Avatar answered Oct 02 '22 21:10

Jaykul


Another way (unfortunately quite a bit slower) is to query WMI:

$res = Get-WmiObject Win32_Product | Where {$_.Name -match 'ASP\.NET MVC 3'}
if ($res -ne $null) { ... }
like image 30
Keith Hill Avatar answered Oct 02 '22 23:10

Keith Hill