- #Current flash player version check install#
- #Current flash player version check 64 Bit#
- #Current flash player version check code#
Why do I not get a "file not found" error? The closest file I have is "C:\Windows\System32\Macromed\Flash\Flash64_11_1_102.ocx"
The above works fine in my computer, however, I do not have a file "C:\Windows\System32\Macromed\Flash\Flash11f.ocx" Public Sub FlashInfo(ByVal FileName As String) Dim myFileVersionInfo As FileVersionInfo = FileVersionInfo.GetVersionInfo(FileName) Console.WriteLine("File: " & myFileVersionInfo.FileDescription & vbCrLf & _ "Version number : " + myFileVersionInfo.FileVersion & vbCrLf & _ "Major Version : " & & vbCrLf & _ "Minor Version : " & & vbCrLf & _ "Private Version: " & & vbCrLf & _ "Build : " & & vbCrLf & _ "Major Part : " & & vbCrLf & _ "Minor Part : " & & vbCrLf & _ "Private Part : " & )End Sub
#Current flash player version check code#
In regards to obtaining the version the best idea is to get the path and file for Flash from the registry and alter your excellent code to the following. Good points Devon in regards to not installing a program for a user.
Imports System.IOModule Module1 Sub Main(ByVal args() As String) Dim myFileVersionInfo As FileVersionInfo = FileVersionInfo.GetVersionInfo("C:\Windows\System32\Macromed\Flash\Flash11f.ocx") Console.WriteLine("File: " & myFileVersionInfo.FileDescription & vbCrLf & _ "Version number : " + myFileVersionInfo.FileVersion & vbCrLf & _ "Major Version : " & & vbCrLf & _ "Minor Version : " & & vbCrLf & _ "Private Version: " & & vbCrLf & _ "Build : " & & vbCrLf & _ "Major Part : " & & vbCrLf & _ "Minor Part : " & & vbCrLf & _ "Private Part : " & ) Console.ReadLine() End SubEnd Module
#Current flash player version check install#
I would never install a program for a user, I'd tell them that the program cannot continue with the current version of flash player and let them decide if they want to visit the official download site themselves. "Version number : " + myFileVersionInfo.FileVersion & vbCrLf & _ Shanks Changed for Option Strict Dim Rk As RegistryKey = ("SOFTWARE\Macromedia\FlashPlayer")If Rk Is Nothing Then MessageBox.Show("HKLM\SOFTWARE\Macromedia\FlashPlayer does not exists")Else Dim Version As String = Rk.GetValue("CurrentVersion").ToString 'get the Major version Dim MaVersion As String = Version.Split(","c)(0) If (CInt(MaVersion) < 10) Then 'install the latest version, use -install after the path if you need silent install MessageBox.Show("Less than 10") Else MessageBox.Show(String.Format("Major version: ", MaVersion)) End IfEnd Ifĭim myFileVersionInfo As FileVersionInfo = FileVersionInfo.GetVersionInfo("C:\Windows\System32\Macromed\Flash\Flash11f.ocx")Ĭonsole.WriteLine("File: " & myFileVersionInfo.FileDescription & vbCrLf & _
Going back to Flash11f.ocx, as mentioned before that is for my system, using the same code on my work computer brings back a different file name.
#Current flash player version check 64 Bit#
Since I do not have access to 64 bit I do not know if Shanks or my solutions are okay or not for 64 bit, perhaps someone reading this post with 64 bit OS can try both suggestions out and report back. In regards to Armin who brings up a valid point in regards to 32 and 64 bit issues. Shanks solution is good but if you have Option Strict On I would tweak the code a bit and would say it would be a simplier solution than mine (even thou mine does work).