Jump to content

Flash Player check for updates / versions


Kyan
 Share

Recommended Posts

Hi, made this, may come handy to someone ^^

#Code with comments

#NoTrayIcon
Global $b = "http://fpdownload.macromedia.com/pub/flashplayer/latest/help/install_flash_player", $url[3] = [$b & "_ax.exe", $b & ".exe", $b & "_ppapi.exe"]
HttpSetUserAgent("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36") ;Just trying to fit in
Global $expectSameTableOrder = 0 ;WebSite table order may change, so use this as time concious setting
$cur = _CurVer() ;Grabs the lastest versions available from adobe's website
$ver = _GetFlashVersions() ;Grabs installed versions from the registry

;compare the versions
For $x = 0 To 2 ;UBound($ver)-1
    Local $idx = 0, $_match = 0
    If $expectSameTableOrder Then
        $_match = 1
        $idx = $x + 1
    Else
        Do
            $_match = StringInStr($cur[$idx][1], $ver[$x][1])
            $idx += 1
        Until ($idx > (UBound($cur) - 1)) Or ($_match > 0)
    EndIf
        If $ver[$x][0] = "" Then $_match=0
    If $_match > 0 Then
        If _VersionCompare($cur[$idx - 1][0], $ver[$x][0]) = 1 Then
            ;// outdated download url is $url[$x]
            ConsoleWrite("[Lastest:" & $cur[$x][0] & "|Installed:" & $ver[$x][0] & "]" & @TAB & $cur[$x][1] & " its outdated!" & @LF)
        EndIf
    EndIf
Next
Exit


Func _CurVer() ;[0]ActiveX (IE) [1]NPAPI (firefox) [2]PPAPI (chrome/opera)
    Local $__page = BinaryToString(InetRead("https://www.adobe.com/software/flash/about/", 3), 4)
    Local $__rex = StringRegExp($__page, '(?s)(?:<td[^>]*>(.*?)(?:\\|</td>))', 3)
    ;_ArrayDisplay($__rex)
    Local $__ret[1][2], $_skip = 0
    If @OSBuild >= 9200 Then $_skip = 1
    For $x = 1 To 8 Step 2
        If Not (($x = 1 And $_skip) Or ($x = 3 And Not $_skip)) Then
            $p = UBound($__ret)
            If $x < 6 Then ReDim $__ret[$p + 1][2]
            $__ret[$p - 1][1] = $__rex[$x]
            $__ret[$p - 1][0] = $__rex[$x + 1]
        EndIf
    Next
    Return $__ret
EndFunc   ;==>_CurVer

Func _GetFlashVersions()
    Local $__fpver[3][2] = [['', "ActiveX"], ['', "PPAPI"], ['', "NPAPI"]]
    $__fpver[0][0] = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\FlashPlayerActiveX", "Version") ;IE
    $__fpver[1][0] = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\FlashPlayerPlugin", "Version") ;Firefox
    $__fpver[2][0] = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\FlashPlayerPepper", "Version") ;Chrome/opera
    Return $__fpver
EndFunc   ;==>_GetFlashVersions

Func _VersionCompare($sVersion1, $sVersion2)
    If $sVersion1 = $sVersion2 Then Return 0
    Local $aVersion1 = StringSplit($sVersion1, ".,"), _
            $aVersion2 = StringSplit($sVersion2, ".,")
    If UBound($aVersion1) <> UBound($aVersion2) Or UBound($aVersion1) = 0 Then
        ; Compare as Strings
        If $sVersion1 > $sVersion2 Then
            Return SetExtended(1, 1) ; @extended set to 1 for string comparison.
        ElseIf $sVersion1 < $sVersion2 Then
            Return SetExtended(1, -1) ; @extended set to 1 for string comparison.
        EndIf
    Else
        For $i = 1 To UBound($aVersion1) - 1
            ; Compare this segment as numbers
            If StringIsDigit($aVersion1[$i]) And StringIsDigit($aVersion2[$i]) And _
                    StringLen($aVersion1[$i]) = StringLen($aVersion2[$i]) Then ; <<<<<<<<<<<<<<<<<<<<<<
                If Number($aVersion1[$i]) > Number($aVersion2[$i]) Then
                    Return SetExtended(2, 1) ; @extended set to 2 for number comparison.
                ElseIf Number($aVersion1[$i]) < Number($aVersion2[$i]) Then
                    Return SetExtended(2, -1) ; @extended set to 2 for number comparison.
                EndIf
            Else ; Compare the segment as strings
                If $aVersion1[$i] > $aVersion2[$i] Then
                    Return SetExtended(1, 1) ; @extended set to 1 for string comparison.
                ElseIf $aVersion1[$i] < $aVersion2[$i] Then
                    Return SetExtended(1, -1) ; @extended set to 1 for string comparison.
                EndIf
            EndIf
        Next
    EndIf
    ; This point should never be reached
    Return SetError(2, 0, 0)
EndFunc   ;==>_VersionCompare

Thanks to @jguinch for helping me with the regex

EDIT1: Code updated, now skips inexistent installations, added $expectSameTableOrder for timewise routines, _VersionCompare fixed (didn't add "= 1" in the if statement,now seems to be working fine 

For someone looking for a GUI http://pxc-coding.com/portfolio/alternative-flash-player-auto-updater/ [Not mine]

Edited by Kyan

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Link to comment
Share on other sites

Great idea! Unfortunately it crashes here. Windows 7 SP1 64 bit, German.

>Running:(3.3.12.0):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Temp\Test.au3"    
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
"C:\Temp\Test.au3" (33) : ==> Subscript used on non-accessible variable.:
$__ret[$p - 1][1] = $__rex[$x]
$__ret[$p - 1][1] = $__rex^ ERROR
->11:47:08 AutoIt3.exe ended.rc:1
+>11:47:08 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 8.268

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

No error my end, though I do wonder if that is a bugfix version of _VersionCompare()?

UDF List:

 
_AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Seems to be a problem with HTTPS. INetRead sets @error to 13.

But it works when I use HTTP.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Another question.

I have IE and FF installed on my machine.

The array returned by _GetFlashversions returns this:

Row|Col 0|Col 1
[0]|16.0.0.287|ActiveX
[1]||PPAPI
[2]|16.0.0.287|NPAPI

I only get

"Firefox, Mozilla - NPAPI its outdated!"

Shouldn't I get a "outdated" message for IE as well?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

No error my end, though I do wonder if that is a bugfix version of _VersionCompare()?

uh, not sure, I took it from the UDF present on autoit 3.3.10.2 since it worked I didn't give it much attention :)

Seems to be a problem with HTTPS. INetRead sets @error to 13.

But it works when I use HTTP.

maybe you have a antivirus certificate installed for port 443 analyses, try replace the inetred option with a 3 (in stead of a 1)

InetRead #options:
$INET_FORCERELOAD (1) = Forces a reload from the remote site.
$INET_IGNORESSL (2) = Ignore all SSL errors (with HTTPS connections).

Another question.

I have IE and FF installed on my machine.

The array returned by _GetFlashversions returns this:

Row|Col 0|Col 1
[0]|16.0.0.287|ActiveX
[1]||PPAPI
[2]|16.0.0.287|NPAPI

I only get

"Firefox, Mozilla - NPAPI its outdated!"

Shouldn't I get a "outdated" message for IE as well?

No, you shouldn't got any output since both are updated, latest FlashPlayer version is: 16.0.0.287,

Need to find where I mess up  :sweating: 

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Link to comment
Share on other sites

I would advise just to use the include i.e. #include <Misc.au3>, as you might be shipping a buggy version with your application.

UDF List:

 
_AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I just added the function to make it lightweight, thanks for the advice guinness :)

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Link to comment
Share on other sites

  • 1 year later...

This one is mine, made with AutoIT; about 750 lines of code. Have not decided if I want to release the code on this project.

It been around for some time and just got more mature as time went on. Fairly solid. Works on 64 bit systems only, and supports windows 10. Creates Widows logs as well when completed. Mean to preform a clean install of flash player, with some additional options if needed.

Enjoy

 

edit:

I decided to include an uninstall and re-install portion of my script of the latest version of flash from Adobe's site snip it. It is Windows 10 friendly. Its a basic uninstall/reinstall - not a clean install.

Also the registry location below for Windows 10 is not accurate:

HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\FlashPlayerActiveX

That location does exist but does not display the correct installed Flash version. Apparently this has been a blunder since the initial release of 10.

I include an alternate method of getting the versions of flash player as well in the snip it. That piece is in there for information purposes and not currently active in the script unless you decide to make it so.

Enjoy

Best Regards

#RequireAdmin
#include <InetConstants.au3>
#include <File.au3>
Global $x
Dim $x[6][2]
Global $AXfilename = "install_flash_player_ax.exe"
Global $PLfilename = "install_flash_player.exe"
Global $PPfilename = "install_flash_player_ppapi.exe"
SplashTextOn("Progress", "", 210, 55, -1, -1, 16, "Tahoma", 10)
Call('remoldfiles')
Call('killpro')
Call('uninstall')
Call('NPAPI')
Call('PPAPI')
If @OSVersion = "WIN_7" Or @OSVersion = "WIN_VISTA" Then
    Call(AX)
EndIf
Sleep(200)
Call('remoldfiles')
SplashOff()
Exit

Func remoldfiles()
    FileDelete(@TempDir & "\" & $PLfilename)
    FileDelete(@TempDir & "\" & $PPfilename)
    FileDelete(@TempDir & "\" & $AXfilename)
    FileDelete(@TempDir & "\uninstall_flash_player.exe")
EndFunc   ;==>remoldfiles

Func killpro()
    ControlSetText("Progress", "", "Static1", "Killing Processess", 2)
    $w = ProcessList()
    For $i = 1 To UBound($w) - 1
        If StringRegExp($w[$i][0], "(?i).*" & "flashp" & ".*") Then
            $CMD1 = "taskkill.exe /im " & $w[$i][0] & " /t /f"
            RunWait('"' & @ComSpec & '" /c ' & $CMD1, @SystemDir, @SW_HIDE)
        EndIf
        If StringRegExp($w[$i][0], "(?i).*" & "firef" & ".*") Then
            $CMD1 = "taskkill.exe /im " & $w[$i][0] & " /t /f"
            RunWait('"' & @ComSpec & '" /c ' & $CMD1, @SystemDir, @SW_HIDE)
        EndIf
        If StringRegExp($w[$i][0], "(?i).*" & "iexplore" & ".*") Then
            $CMD1 = "taskkill.exe /im " & $w[$i][0] & " /t /f"
            RunWait('"' & @ComSpec & '" /c ' & $CMD1, @SystemDir, @SW_HIDE)
        EndIf
        If StringRegExp($w[$i][0], "(?i).*" & "opera" & ".*") Then
            $CMD1 = "taskkill.exe /im " & $w[$i][0] & " /t /f"
            RunWait('"' & @ComSpec & '" /c ' & $CMD1, @SystemDir, @SW_HIDE)
        EndIf
        If StringRegExp($w[$i][0], "(?i).*" & "plugin-container" & ".*") Then
            $CMD1 = "taskkill.exe /im " & $w[$i][0] & " /t /f"
            RunWait('"' & @ComSpec & '" /c ' & $CMD1, @SystemDir, @SW_HIDE)
        EndIf
        If StringRegExp($w[$i][0], "(?i).*" & "Battle.net" & ".*") Then
            $CMD1 = "taskkill.exe /im " & $w[$i][0] & " /t /f"
            RunWait('"' & @ComSpec & '" /c ' & $CMD1, @SystemDir, @SW_HIDE)
        EndIf
        If StringRegExp($w[$i][0], "(?i).*" & "steam" & ".*") Then
            $CMD1 = "taskkill.exe /im " & $w[$i][0] & " /t /f"
            RunWait('"' & @ComSpec & '" /c ' & $CMD1, @SystemDir, @SW_HIDE)
        EndIf
        If StringRegExp($w[$i][0], "(?i).*" & "TWC" & ".*") Then
            $CMD1 = "taskkill.exe /im " & $w[$i][0] & " /t /f"
            RunWait('"' & @ComSpec & '" /c ' & $CMD1, @SystemDir, @SW_HIDE)
        EndIf
        If StringRegExp($w[$i][0], "(?i).*" & "palemoon" & ".*") Then
            $CMD1 = "taskkill.exe /im " & $w[$i][0] & " /t /f"
            RunWait('"' & @ComSpec & '" /c ' & $CMD1, @SystemDir, @SW_HIDE)
        EndIf
        If StringRegExp($w[$i][0], "(?i).*" & "iexplorer" & ".*") Then
            $CMD1 = "taskkill.exe /im " & $w[$i][0] & " /t /f"
            RunWait('"' & @ComSpec & '" /c ' & $CMD1, @SystemDir, @SW_HIDE)
        EndIf
        If StringRegExp($w[$i][0], "(?i).*" & "skype" & ".*") Then
            $CMD1 = "taskkill.exe /im " & $w[$i][0] & " /t /f"
            RunWait('"' & @ComSpec & '" /c ' & $CMD1, @SystemDir, @SW_HIDE)
        EndIf
        If StringRegExp($w[$i][0], "(?i).*" & "yahoo" & ".*") Then
            $CMD1 = "taskkill.exe /im " & $w[$i][0] & " /t /f"
            RunWait('"' & @ComSpec & '" /c ' & $CMD1, @SystemDir, @SW_HIDE)
        EndIf
        If StringRegExp($w[$i][0], "(?i).*" & "acro" & ".*") Then
            $CMD1 = "taskkill.exe /im " & $w[$i][0] & " /t /f"
            RunWait('"' & @ComSpec & '" /c ' & $CMD1, @SystemDir, @SW_HIDE)
        EndIf
        If StringRegExp($w[$i][0], "(?i).*" & "waterf" & ".*") Then
            $CMD1 = "taskkill.exe /im " & $w[$i][0] & " /t /f"
            RunWait('"' & @ComSpec & '" /c ' & $CMD1, @SystemDir, @SW_HIDE)
        EndIf
    Next
EndFunc   ;==>killpro


Func uninstall()
    $dul = "http://download.macromedia.com/get/flashplayer/current/support/uninstall_flash_player.exe"
    $hDownload2 = InetGet($dul, @TempDir & "\uninstall_flash_player.exe", $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)
    ControlSetText("Progress", "", "Static1", "Fetching Adobe Flash Uninstaller", 2)
    Do
        Sleep(200)
    Until InetGetInfo($hDownload2, $INET_DOWNLOADCOMPLETE)
    ControlSetText("Progress", "", "Static1", "Uninstalling Adobe Flash player(s)", 2)
    ShellExecuteWait("uninstall_flash_player.exe", " -uninstall", @TempDir)
EndFunc   ;==>uninstall

Func NPAPI()
    $dip = "http://fpdownload.macromedia.com/pub/flashplayer/latest/help/install_flash_player.exe"
    $hDownload = InetGet($dip, @TempDir & "\" & $PLfilename, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)
    ControlSetText("Progress", "", "Static1", "Fetching NPAPI Adobe Flash Player", 2)
    Do
        Sleep(200)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    ControlSetText("Progress", "", "Static1", "Installing Adobe Flash Player NPAPI", 2)
    ShellExecuteWait($PLfilename, " /install", @TempDir)
EndFunc   ;==>NPAPI

;PPAPI Flash Player install
Func PPAPI()
    $did = "http://fpdownload.macromedia.com/pub/flashplayer/latest/help/install_flash_player_ppapi.exe"
    $hDownload4 = InetGet($did, @TempDir & "\" & $PPfilename, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)
    ControlSetText("Progress", "", "Static1", "Fetching PPAPI Adobe Flash Player", 2)
    Do
        Sleep(200)
    Until InetGetInfo($hDownload4, $INET_DOWNLOADCOMPLETE)
    ControlSetText("Progress", "", "Static1", "Installing Adobe Flash Player PPAPI", 2)
    ShellExecuteWait($PPfilename, " /install", @TempDir)
EndFunc   ;==>PPAPI

; ActiveX Flash Player install
Func AX()

    $dia = "http://fpdownload.macromedia.com/pub/flashplayer/latest/help/install_flash_player_ax.exe"
    ControlSetText("Progress", "", "Static1", "Fetching Adobe Flash ActiveX", 2)
    $hDownload1 = InetGet($dia, @TempDir & "\" & $AXfilename, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)
    Do
        Sleep(200)
    Until InetGetInfo($hDownload1, $INET_DOWNLOADCOMPLETE)

    ControlSetText("Progress", "", "Static1", "Installing Adobe Flash Player ActiveX", 2)
    ShellExecuteWait($AXfilename, " /install", @TempDir)

EndFunc   ;==>AX

; note this is not active in this script, but an example of how I determine the flash player version. You will have to make the necessary adjustments

Func Versions()
    $aArray = _FileListToArrayRec("C:\Windows\System32\Macromed\Flash\", "*.ocx;*.exe", $FLTAR_FILES)

    For $i = 1 To UBound($aArray) - 1
        If StringInStr($aArray[$i], ".ocx") > 1 Then
            $y = FileGetVersion("C:\Windows\System32\Macromed\Flash\" & $aArray[$i], $FV_PRODUCTVERSION)
            $y = StringReplace($y, ',', ".")
            $x[0][0] = "32 bit Active X"
            $x[0][1] = $y
        ElseIf StringInStr($aArray[$i], "pep") >= 1 Then
            $y = FileGetVersion("C:\Windows\System32\Macromed\Flash\" & $aArray[$i], "ProductVersion")
            $y = StringReplace($y, ',', ".")
            $x[1][0] = "32 bit Pepper Flash"
            $x[1][1] = $y
        ElseIf StringInStr($aArray[$i], "Plugin") >= 1 Then
            $y = FileGetVersion("C:\Windows\System32\Macromed\Flash\" & $aArray[$i], "ProductVersion")
            $y = StringReplace($y, ',', ".")
            $x[2][0] = "32 bit Firefox Flash"
            $x[2][1] = $y
        EndIf
    Next

    $aArray = _FileListToArrayRec("C:\Windows\SysWOW64\Macromed\Flash\", "*.ocx;*.exe", $FLTAR_FILES)

    For $i = 1 To UBound($aArray) - 1
        If StringInStr($aArray[$i], ".ocx") > 1 Then
            $y = FileGetVersion("C:\Windows\SysWOW64\Macromed\Flash\" & $aArray[$i], $FV_PRODUCTVERSION)
            $y = StringReplace($y, ',', ".")
            $x[3][0] = "64 bit Active X"
            $x[3][1] = $y
        ElseIf StringInStr($aArray[$i], "pep") >= 1 Then
            $y = FileGetVersion("C:\Windows\SysWOW64\Macromed\Flash\" & $aArray[$i], "ProductVersion")
            $y = StringReplace($y, ',', ".")
            $x[4][0] = "64 bit Pepper Flash"
            $x[4][1] = $y
        ElseIf StringInStr($aArray[$i], "Plugin") >= 1 Then
            $y = FileGetVersion("C:\Windows\SysWOW64\Macromed\Flash\" & $aArray[$i], "ProductVersion")
            $y = StringReplace($y, ',', ".")
            $x[5][0] = "64 bit Firefox Flash"
            $x[5][1] = $y
        EndIf
    Next
EndFunc   ;==>Versions

 

Edited by Carm01
adding info
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

×
×
  • Create New...