Determining if the dotnet framework is on a client pc
Encountered the issue of needing to know if a client had the dotnet framework installed on his machine or not. Below is the VB6 code of the utility i wrote in order to determine this...
UI controls:
Control type Name:
Button Command1
Label lblFx1
Label lblFx2
Code:
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Load()
If DoesFileExist(Environ$("windir") & "\Microsoft.NET\Framework\v1.0.3705\mscorlib.dll") Then
lblFx1 = "Framework 1.0 is installed"
Else
lblFx1 = "Framework 1.0 is NOT installed"
End If
If DoesFileExist(Environ$("windir") & "\Microsoft.NET\Framework\v1.1.4322\mscorlib.dll") Then
lblFx2 = "Framework 1.1 is installed"
Else
lblFx2 = "Framework 1.1 is NOT installed"
End If
End Sub
Private Function DoesFileExist(FN As String) As Boolean
On Error GoTo errh
Dim a
DoesFileExist = True
a = GetAttr(FN)
Exit Function
errh:
DoesFileExist = False
End Function