Jump to content

[Solved] How to check if "Shockwave Flash Player" installed?


 Share

Recommended Posts

according to adobe kb this clsid is presistent through versions:

D27CDB6E-AE6D-11cf-96B8-444553540000

so if you read the progid out of the registry

HKEY_CLASSES_ROOT\CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}\ProgID

check if you can create an object from it

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

Thanks piccaso, i think thats the needed solution, in a few days i will check it, because i need to be sure that this will work on the system where Flash Player was never installed, and that kind of system i have only on the work of my friend (it's a school :P ).

Here is the function to check:

MsgBox(0, "", ShockWavePlayer_Installed())

Func ShockWavePlayer_Installed()
    Local $sObjRead = RegRead("HKCR\CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}\ProgID", "")
    Local $sFlashObj = ObjCreate($sObjRead)
    If Not IsObj($sFlashObj) Then Return False
    Return True
EndFunc

If someone have an option to check this on computer where the Flash Player not installed, please do so, i very appreciate it.

P.S

I have checked yesterday the two functions that i post before, and they do not work properly, it seems that object ShockwaveFlash.ShockwaveFlash and ocx files exists natively on the system (Win XP).

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Nope, this solution not work either :)

I get True, but when i go to the Internet Explorer, and try to watch some flash video, i get the notifycation that i need to install Flash Player.

Is it really so hard to check this? ;):P

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

what does this spit out on the system without flash player?

MsgBox(0, "", ShockWavePlayer_Installed())

Func ShockWavePlayer_Installed()
    Local $sObjRead = RegRead("HKCR\CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}\ProgID", "")
    ConsoleWrite("$sObjRead: " & $sObjRead & @CRLF)
    if @error Then Return False
    Local $oFlashObj = ObjCreate($sObjRead)
    If Not IsObj($oFlashObj) Then Return False
    ConsoleWrite("$oFlashObj.FlashVersion(): " & $oFlashObj.FlashVersion() & @CRLF)
    Return True
EndFunc
CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

what does this spit out on the system without flash player?

I will have an opportunity to check this only in the next Saturday :P...

Thanks.

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

it would be nice if there was a official reference on that object somewhere.

didnt find anything on adobe.com...

$oFlashObj.FlashVersion() returns some number (589824 for flash 9), dont know how to use this...

$oFlashObj.GetVariable("$version") looks better (WIN 9,0,16,0) but need to be parsed.

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

Just found some stuff that I think are interesting. Does this work for you guys?

$Version=IniRead(@WindowsDir & "\Downloaded Program Files\SWFLASH.inf","strings","VersionNumber","Not found")
MsgBox(0,"","Your SWF version is: " & $Version)

Also, does this file exist on your system?

ShellExecute(@WindowsDir & "\Downloaded Program Files\SWFLASH.inf")

It has all the information needed, including registry keys.

-edit-

I didn't know you could just put this about:plugins in Firefox and you get all that info too!

Edited by Nahuel
Link to comment
Share on other sites

i came up with this after reading adobes flash detection kit (the client side javascipt version)

Global $oErr = ObjEvent("AutoIt.Error","_ComError")
ConsoleWrite(_FlashMajorVersion()  & @CRLF)


Func _FlashMajorVersion()
    Local $oSwf,$sVersion
    $oSwf = ObjCreate("ShockwaveFlash.ShockwaveFlash")
    if @error Then Return 0 ; No flash at all
    $oSwf.AllowScriptAccess = "always"
    $sVersion = $oSwf.GetVariable("$version")
    if @error Then
       $oSwf = ObjCreate("ShockwaveFlash.ShockwaveFlash.3")
       if @error Then
         $oSwf = ObjCreate("ShockwaveFlash.ShockwaveFlash.2")
         if @error then return 0
         Return 2
       EndIf
       Return 3
    EndIf
    $sVersion = StringTrimLeft($sVersion,3)
    $sVersion = StringLeft($sVersion,StringInStr($sVersion,",")-1)
    Return Number($sVersion)
EndFunc
 
Func _ComError()
   ; Just set @error, the script will handle it...
   Local $iErr = $oErr.number
   if $iErr = 0 Then $iErr = -1
   SetError($iErr)
EndFunc
CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

Thanks piccaso.

I checked this out on the system where is never was installed Flash Player, this function return 6!

And then i thought - what if we will check the compatible between the current flash player (from the website) and the installed one?

Here is what i came up with eventualy:

Global $oErr = ObjEvent("AutoIt.Error", "_ComError")

$FlashCurrentVersion = _GetFlashVersion()
$FlashIsCompatible = IsCompatible_Flash_Version($FlashCurrentVersion)

If Not @error Then
    MsgBox(64, "", "Flash Player is compatible (installed last version)? = " & _
        $FlashIsCompatible & @LF & _
        "Current Installed Version: " & @extended)
Else
    MsgBox(48, "Error", "Please check your connection to the Internet.")
EndIf

Func IsCompatible_Flash_Version($Version=9)
    If Number($Version) <= 0 Then Return SetExtended($Version, False)
    
    Local $sSource = _HTTPGetSource("www.adobe.com", "/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash")
    If @error Then Return SetError(1, 0, -1)
    
    Local $InetFlashVersion = StringRegExpReplace($sSource, '(?i)(?s).*?<strong>Version</strong>:(.*?)</li>.*', '\1')
    $InetFlashVersion = StringStripWS($InetFlashVersion, 3)
    $InetFlashVersion = StringLeft($InetFlashVersion, 1)
    If Number($InetFlashVersion) > Number($Version) Then Return SetExtended($Version, False)
    Return SetExtended($Version, True)
EndFunc

Func _GetFlashVersion()
    Local $oSwf, $sVersion
    $oSwf = ObjCreate("ShockwaveFlash.ShockwaveFlash")
    If @error Then Return 0 ; No flash at all
    $oSwf.AllowScriptAccess = "always"
    $sVersion = $oSwf.GetVariable("$Version")
    If @error Then
        $oSwf = ObjCreate("ShockwaveFlash.ShockwaveFlash.3")
        If @error Then
            $oSwf = ObjCreate("ShockwaveFlash.ShockwaveFlash.2")
            If @error Then Return 0
            Return 2
        EndIf
        Return 3
    EndIf
    Return Number(StringRegExpReplace($sVersion, "(?i).*\s(.*?),.*", "\1"))
EndFunc

Func _HTTPGetSource($sHost, $sPage)
    TCPStartup()
    
    Local $sRetSource = ""
    Local $nCurrentLine, $sRcvBytes = 1024
    Local $Name_To_IP = TCPNameToIP($sHost)
    Local $iSocket = TCPConnect($Name_To_IP, 80)
    
    If $iSocket = -1 Then
        TCPCloseSocket($iSocket)
        Return SetError(1, 0, 0)
    EndIf
    
    Local $sCommand = "GET " & $sPage & " HTTP/1.1" & @CRLF
    $sCommand &= "Host: " & $sHost & @CRLF
    $sCommand &= "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" & @CRLF
    $sCommand &= "Connection: close" & @CRLF & @CRLF
    
    Local $iBytesSent = TCPSend($iSocket, $sCommand)
    If $iBytesSent = 0 Or @error Then Return SetError(2, @error, 0)
    
    While 1
        $nCurrentLine = TCPRecv($iSocket, $sRcvBytes)
        If @error <> 0 Then ExitLoop
        If $nCurrentLine <> '' Then $sRetSource &= $nCurrentLine
    WEnd
    
    TCPCloseSocket($iSocket)
    TCPShutdown()
    
    Return $sRetSource
EndFunc

Func _ComError()
    ; Just set @error, the script will handle it...
    Local $iErr = $oErr.number
    If $iErr = 0 Then $iErr = -1
    SetError($iErr)
EndFunc

But i am not sure here about the «User Agent» line, i need to request info for Internet Explorer, and i searched on the Wikipedia, and iv'e took from there one simple line.. but i am not sure :) ...

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...