User Tools

Site Tools


powershell_check_for_updates

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
powershell_check_for_updates [2013/11/18 08:14] – created stephenpowershell_check_for_updates [2017/02/07 21:27] (current) – external edit 127.0.0.1
Line 5: Line 5:
  
 #### Check for updates #### Check for updates
-#### Version 1.1 +#### Version 1.36 
-#### Last updated 2013-11-18 +#### Last updated 2017-02-07 
-#### The cononical version of this script is at http://tallguyracing.com/wiki/doku.php?id=powershell_check_for_updates+#### The canonical version of this script is at http://tallguyracing.com/wiki/doku.php?id=powershell_check_for_updates 
 +  
 +$appsToCheck = @{ 
 +          'Dummy'            = 'Dummy' 
 +        ; 'ThisScript'       = '1.31' 
 +        ; 'Anki'             = '2.0.36' 
 +        ; 'ConEmu'           = '160619' 
 +        ; 'Paint.NET'        = '4.0.9' 
 +#       ; 'Rockbox'          = '3.13' 
 +#       ; 'DokuWiki'         = '2013-05-10' 
 +        ; 'Notepad++'        = '6.9.2'         # Hopefully, this can be reverted to a fully automatic check in the future. 
 +#        ; 'Notepad++'        = 'Notepad++\notepad++.exe' 
 +        ; 'GIMP'             = 'GIMP 2\bin\gimp-2.8.exe' 
 +        ; '7zip'             = '7-Zip\7z.exe' 
 +        ; 'WinMerge'         = 'WinMerge\WinMergeU.exe' 
 +#       ; 'Foobar2000'       = 'foobar2000\foobar2000.exe' 
 +        ; 'Fiddler'          = 'Fiddler2\fiddler.exe' 
 +        ; 'Process Explorer' = 'C:\tools\sysinternals\procexp.exe' 
 +        ; 'Process Monitor'  = 'C:\tools\sysinternals\procmon.exe' 
 +#        ; 'VLC'              = 'VideoLAN\VLC\vlc.exe' 
 +        ; 'FileZilla'        = 'FileZilla FTP Client\filezilla.exe' 
 +#        ; 'ImageMagick'      = 'ImageMagick\magick.exe' 
 +#        ; 'TortoiseSVN'      = 'TortoiseSVN\bin\TortoiseSVN.dll' 
 +        ; 'WinDirStat'       = 'WinDirStat\windirstat.exe' 
 +#        ; 'LibreOffice'      = 'LibreOffice 5\program\soffice.exe' 
 +#        ; 'VirtualBox'       = 'Oracle\VirtualBox\VBoxSVC.exe' 
 +#        ; 'Tixati'           = 'tixati\tixati.exe' 
 +#        ; 'VeraCrypt'        = 'VeraCrypt\VeraCrypt.exe' 
 +#        ; 'IrfanView'        = 'IrfanView\i_view32.exe' 
 +}
  
-$appsToCheck = ('TrueCrypt', 'Anki', 'ConEmu', 'Paint.NET', 'Rockbox', 'DokuWiki', 'GIMP', '7zip', 'WinMerge', 'Foobar2000', 'Fiddler', 'Process Explorer', 'Process Monitor', 'Notepad++', 'VLC', 'FileZilla', 'ImageMagick', 'TortoiseSVN'+function WebRequest ($url) { 
- +    [net.httpwebrequest]$httpwebrequest [net.webrequest]::create($url) 
-$versionNumbers = @{ +    [net.httpWebResponse]$httpwebresponse = $httpwebrequest.getResponse(
-          'TrueCrypt' = '7.1a' +  
-        ; 'Anki'      = '2.0.18' +    if (!$httpwebresponse) 
-        ; 'ConEmu'    = '131117' +        return $null 
-        ; 'Paint.NET' '3.5.11' +    } 
-        ; 'Rockbox'   '3.13' +  
-        ; 'DokuWiki'  = '2013-05-10' +    $reader new-object IO.StreamReader($httpwebresponse.getResponseStream()) 
-        ; 'Notepad++' = '6.5.1'         # Hopefully, this can be reverted to a fully automatic check in the future.+    $WSResponse $reader.ReadToEnd() 
 +    $reader.Close() 
 +  
 +    return $WSResponse
 } }
 +  
 +function WebRequest ($url) { 
 +    [net.httpwebrequest]$httpwebrequest = [net.webrequest]::create($url) 
 +    [net.httpWebResponse]$httpwebresponse = $httpwebrequest.getResponse() 
 +  
 +    if (!$httpwebresponse) { 
 +        return $null 
 +    } 
 +  
 +    $reader = new-object IO.StreamReader($httpwebresponse.getResponseStream()) 
 +    $WSResponse = $reader.ReadToEnd() 
 +    $reader.Close() 
 +  
 +    return $WSResponse 
 +
 + 
 function GetVersionNumberFromWeb ($appName, $url, $regexPattern) function GetVersionNumberFromWeb ($appName, $url, $regexPattern)
 { {
-    $response = Invoke-WebRequest -Uri $url +    $response = WebRequest $url 
- +  
-    if ($response.StatusCode -ne 200) +    if (!$response) {
-    {+
         Write-Host "FAILED: ${appName}: Could not get the web page." -ForegroundColor Red         Write-Host "FAILED: ${appName}: Could not get the web page." -ForegroundColor Red
-        Write-Host "        ${response.StatusCode}: ${response.StatusDescription}" -ForegroundColor Red 
         return         return
     }     }
- +  
-    $versionNumberMatches = ([regex]$regexPattern).matches($response.Content+    Out-File -filepath (Join-path $env:temp "$appName.html") -inputobject $response 
- +  
-    if ($versionNumberMatches.Count -eq 0) +    if ($regexPattern.EndsWith('/s')) { 
-    {+        # Use a bit of a hack to get singleline mode. 
 +        $regexPattern = $regexPattern.Substring(0, $regexPattern.Length - 2) 
 +        $response = $response.Replace("`n", " ") 
 +    } 
 +  
 +    $versionNumberMatches = ([regex]$regexPattern).matches($response) 
 +  
 +    if ($versionNumberMatches.Count -eq 0) {
         Write-Host "FAILED: ${appName}: Could not get version number from the web page. Nothing matched the regex." -ForegroundColor Red         Write-Host "FAILED: ${appName}: Could not get version number from the web page. Nothing matched the regex." -ForegroundColor Red
         return         return
     }     }
-    if ($versionNumberMatches.Count -ne 1) +    if ($versionNumberMatches.Count -ne 1) {
-    {+
         Write-Host "FAILED: ${appName}: Could not get version number from the web page. The regex had more than one match." -ForegroundColor Red         Write-Host "FAILED: ${appName}: Could not get version number from the web page. The regex had more than one match." -ForegroundColor Red
         return         return
     }     }
-    if (! $versionNumberMatches[0].Success) +    if (! $versionNumberMatches[0].Success) {
-    {+
         Write-Host "FAILED: ${appName}: Could not get version number from the web page. The regex match was not successful." -ForegroundColor Red         Write-Host "FAILED: ${appName}: Could not get version number from the web page. The regex match was not successful." -ForegroundColor Red
         return         return
     }     }
-    if (! $versionNumberMatches[0].Groups["versionNumber"].Success) +    if (! $versionNumberMatches[0].Groups["versionNumber"].Success) {
-    {+
         Write-Host "FAILED: ${appName}: Could not get version number from the web page. The regex group was not successful." -ForegroundColor Red         Write-Host "FAILED: ${appName}: Could not get version number from the web page. The regex group was not successful." -ForegroundColor Red
         return         return
     }     }
 + 
     $latestVersionNumber = $versionNumberMatches[0].Groups["versionNumber"].Value     $latestVersionNumber = $versionNumberMatches[0].Groups["versionNumber"].Value
     Write-Host "${appName}: The latest version number is $LatestVersionNumber."     Write-Host "${appName}: The latest version number is $LatestVersionNumber."
 + 
     return $latestVersionNumber     return $latestVersionNumber
 } }
- + 
 function CheckLocalFile ($appName, $url, $regexPattern, $localFilename, $extraFormatting) function CheckLocalFile ($appName, $url, $regexPattern, $localFilename, $extraFormatting)
 { {
-    $appInfo = Get-Command $localFilename+    if (Test-Path $localFilename) { 
 +        $fullLocalFilename = $localFilename 
 +    } elseif (Test-Path "C:\Program Files (x86)\$localFilename") { 
 +        $fullLocalFilename = "C:\Program Files (x86)\$localFilename" 
 +    } elseif (Test-Path "C:\Program Files\$localFilename") { 
 +        $fullLocalFilename = "C:\Program Files\$localFilename" 
 +    } else { 
 +        Write-Host "FAILED: The filename ${localFilename} or any of its variants does not exist." -ForegroundColor Red 
 +        return 
 +    } 
 +  
 +    $appInfo = Get-Command $fullLocalFilename
     $currentVersionNumber = $appInfo.FileVersionInfo.ProductVersion     $currentVersionNumber = $appInfo.FileVersionInfo.ProductVersion
 + 
     if ($extraFormatting.Contains(';CommaToFullStop;'))     if ($extraFormatting.Contains(';CommaToFullStop;'))
     {     {
Line 74: Line 133:
     {     {
         $currentVersionNumber = $currentVersionNumber.Replace(' ', '')         $currentVersionNumber = $currentVersionNumber.Replace(' ', '')
 +    }
 +    if ($extraFormatting.Contains(';TrimTrailingZero;') -and $currentVersionNumber.EndsWith('0'))
 +    {
 +        $currentVersionNumber = $currentVersionNumber.Substring(0, $currentVersionNumber.Length - 1)
     }     }
     if ($extraFormatting.Contains(';TrimTrailingDotZero;') -and $currentVersionNumber.EndsWith('.0'))     if ($extraFormatting.Contains(';TrimTrailingDotZero;') -and $currentVersionNumber.EndsWith('.0'))
 +    {
 +        $currentVersionNumber = $currentVersionNumber.Substring(0, $currentVersionNumber.Length - 2)
 +    }
 +    while ($extraFormatting.Contains(';TrimTrailingDotZeros;') -and $currentVersionNumber.EndsWith('.0'))
     {     {
         $currentVersionNumber = $currentVersionNumber.Substring(0, $currentVersionNumber.Length - 2)         $currentVersionNumber = $currentVersionNumber.Substring(0, $currentVersionNumber.Length - 2)
Line 88: Line 155:
         $currentVersionNumber = $Matches.Values         $currentVersionNumber = $Matches.Values
     }     }
 + 
     CheckCurrentVersionNumber $appName $url $regexPattern $currentVersionNumber     CheckCurrentVersionNumber $appName $url $regexPattern $currentVersionNumber
 } }
 + 
 function CheckCurrentVersionNumber ($appName, $url, $regexPattern, $currentVersionNumber) function CheckCurrentVersionNumber ($appName, $url, $regexPattern, $currentVersionNumber)
 { {
     $latestVersionNumber = GetVersionNumberFromWeb $appName $url $regexPattern     $latestVersionNumber = GetVersionNumberFromWeb $appName $url $regexPattern
-    if (! $latestVersionNumber) +    if (! $latestVersionNumber) {
-    {+
         return         return
-    } +    }  
- + 
     Write-Host "${appName}: The current version number is $currentVersionNumber."     Write-Host "${appName}: The current version number is $currentVersionNumber."
- +  
-    if ($currentVersionNumber -ne $latestVersionNumber) +    if ($currentVersionNumber -ne $latestVersionNumber) {
-    {+
         Write-Host "${appName}: Update required!" -ForegroundColor Green         Write-Host "${appName}: Update required!" -ForegroundColor Green
-    } +    } else {
-    else +
-    {+
         Write-Host "${appName}: No update required."         Write-Host "${appName}: No update required."
     }     }
 } }
 + 
 function CheckAppCurrentVersionNumber ($appName) function CheckAppCurrentVersionNumber ($appName)
 { {
     switch ($appName)     switch ($appName)
     {     {
 +        'Dummy' { }
         #### Semi-automatic checks ####         #### Semi-automatic checks ####
-        'TrueCrypt'+        'ThisScript'
         {         {
-            CheckCurrentVersionNumber 'TrueCrypt' 'http://www.truecrypt.org/downloads' ` +            CheckCurrentVersionNumber 'ThisScript' 'http://tallguyracing.com/wiki/doku.php?id=powershell_check_for_updates' ` 
-                '\>Latest Stable Version (?<versionNumber>\d+\.\d+\w+)\<' ` +                '>#### Version (?<versionNumber>\d+\.\d+)<'
-                $versionNumbers['TrueCrypt']+                $appsToCheck['ThisScript']
         }         }
         'Anki'         'Anki'
         {         {
             CheckCurrentVersionNumber 'Anki' 'http://ankisrs.net/' `             CheckCurrentVersionNumber 'Anki' 'http://ankisrs.net/' `
-                'href="http://ankisrs\.net/download/mirror/anki-(?<versionNumber>\d+(?:\.\d+){2})\.exe"' ` +                '>Download Anki for Windows Vista/7/8/10 \((?<versionNumber>\d+(?:\.\d+){2})\)<' ` 
-                $versionNumbers['Anki']+                $appsToCheck['Anki']
         }         }
         'ConEmu'         'ConEmu'
         {         {
-            CheckCurrentVersionNumber 'ConEmu' 'http://conemu.codeplex.com/' ` +            CheckCurrentVersionNumber 'ConEmu' 'http://conemu.github.io/version.ini' ` 
-                'ConEmu (?<versionNumber>\d+\w+) \[Alpha\]' ` +                '\[ConEmu_Preview_2\]\s*version=(?<versionNumber>\w+)'
-                $versionNumbers['ConEmu']+                $appsToCheck['ConEmu']
         }         }
         'Paint.NET'         'Paint.NET'
         {         {
             CheckCurrentVersionNumber 'Paint.NET' 'http://www.getpaint.net/index.html' `             CheckCurrentVersionNumber 'Paint.NET' 'http://www.getpaint.net/index.html' `
-                '>Paint\.NET\s*v(?<versionNumber>\d+(?:\.\d+){2})<'+                '>paint\.net\s*(?<versionNumber>\d+(?:\.\d+){2})<'
-                $versionNumbers['Paint.NET']+                $appsToCheck['Paint.NET']
         }         }
         'Rockbox'         'Rockbox'
Line 146: Line 209:
             CheckCurrentVersionNumber 'Rockbox' 'http://www.rockbox.org/download/' `             CheckCurrentVersionNumber 'Rockbox' 'http://www.rockbox.org/download/' `
                 '<h1>Rockbox (?<versionNumber>\d+(?:\.\d+){1,2}) Download</h1>' `                 '<h1>Rockbox (?<versionNumber>\d+(?:\.\d+){1,2}) Download</h1>' `
-                $versionNumbers['Rockbox']+                $appsToCheck['Rockbox']
         }         }
         'DokuWiki'         'DokuWiki'
Line 152: Line 215:
             CheckCurrentVersionNumber 'DokuWiki' 'http://download.dokuwiki.org/' `             CheckCurrentVersionNumber 'DokuWiki' 'http://download.dokuwiki.org/' `
                 '<a href="src/dokuwiki/dokuwiki-stable\.tgz">\(direct link\)</a>\s*<span class="hint">(?<versionNumber>\d{4}-\d{2}-\d{2}).+?</span>' `                 '<a href="src/dokuwiki/dokuwiki-stable\.tgz">\(direct link\)</a>\s*<span class="hint">(?<versionNumber>\d{4}-\d{2}-\d{2}).+?</span>' `
-                $versionNumbers['DokuWiki']+                $appsToCheck['DokuWiki']
         }         }
         'Notepad++'         'Notepad++'
         {         {
-            CheckCurrentVersionNumber 'Notepad++' 'http://notepad-plus-plus.org/download/' ` +            CheckCurrentVersionNumber 'Notepad++' 'http://notepad-plus-plus.org/'
-                '<title>Notepad\+\+ v(?<versionNumber>\d+(?:\.\d+){1,2}) - Current Version</title>' ` +                '>Current Version:\s*(?:<\w+>\s*)*(?<versionNumber>\d+(?:\.\d+){1,3})<'
-                $versionNumbers['Notepad++']+                $appsToCheck['Notepad++']
         }         }
 +        'Inkscape'
 +        {
 +            CheckCurrentVersionNumber 'Inkscape' 'http://inkscape.org/en/download/windows' `
 +                '>Latest stable version: Inkscape ?(?<versionNumber>\d+(?:\.\d+){1,2})<' `
 +                $appsToCheck['Inkscape']
 +        }
 +        'Hugin'
 +        {
 +            CheckCurrentVersionNumber 'Hugin' 'http://sourceforge.net/projects/hugin/' `
 +                '>hugin-(?<versionNumber>\d+(?:\.\d+){2})\.tar\.bz2<' `
 +                $appsToCheck['Hugin']
 +        }
 +        'Stellarium'
 +        {
 +            CheckCurrentVersionNumber 'Stellarium' 'http://stellarium.org/' `
 +                '>latest version is (?<versionNumber>\d+(?:\.\d+){2})<' `
 +                $appsToCheck['Stellarium']
 +        }
 +        'Gmvault'
 +        {
 +            CheckCurrentVersionNumber 'Gmvault' 'http://gmvault.org/' `
 +                'Download\s+Gmvault<small>\s*\((?<versionNumber>\d+(?:\.\d+){1,2})\s*\)\s*</small>' `
 +                $appsToCheck['Gmvault']
 +        }
 + 
         #### Fully-automatic checks ####         #### Fully-automatic checks ####
         'GIMP'         'GIMP'
         {         {
             CheckLocalFile 'GIMP' 'http://www.gimp.org/downloads/' `             CheckLocalFile 'GIMP' 'http://www.gimp.org/downloads/' `
-                'href="http://ftp\.gimp\.org/pub/gimp/[^/]+/windows/gimp-(?<versionNumber>\d+(?:\.\d+){2})-setup.exe"' ` +                '>The current stable release of GIMP is <(b|strong)>(?<versionNumber>\d+(?:\.\d+){2})<\/(b|strong)>' ` 
-                'C:\Program Files\GIMP 2\bin\gimp-2.8.exe' ''+                $appsToCheck['GIMP'''
         }         }
         '7zip'         '7zip'
Line 171: Line 259:
             CheckLocalFile '7zip' 'http://www.7-zip.org/' `             CheckLocalFile '7zip' 'http://www.7-zip.org/' `
                 'Download 7-Zip (?<versionNumber>\d+(?:\.\d+){1,2}) \(\d+-\d+-\d+\) for Windows' `                 'Download 7-Zip (?<versionNumber>\d+(?:\.\d+){1,2}) \(\d+-\d+-\d+\) for Windows' `
-                'C:\Program Files (x86)\7-Zip\7z.exe' ''+                $appsToCheck['7zip'''
         }         }
         'WinMerge'         'WinMerge'
Line 177: Line 265:
             CheckLocalFile 'WinMerge' 'http://winmerge.org/' `             CheckLocalFile 'WinMerge' 'http://winmerge.org/' `
                 'href="http://downloads.sourceforge.net/winmerge/WinMerge-(?<versionNumber>\d+(?:\.\d+){2})-Setup.exe"' `                 'href="http://downloads.sourceforge.net/winmerge/WinMerge-(?<versionNumber>\d+(?:\.\d+){2})-Setup.exe"' `
-                'C:\Program Files (x86)\WinMerge\WinMergeU.exe' ''+                $appsToCheck['WinMerge'''
         }         }
         'Foobar2000'         'Foobar2000'
         {         {
             CheckLocalFile 'Foobar2000' 'http://www.foobar2000.org/download' `             CheckLocalFile 'Foobar2000' 'http://www.foobar2000.org/download' `
-                'href="/getfile/[^/]+/foobar2000_v(?<versionNumber>\d+(?:\.\d+){2}).exe">foobar2000 v\d+(?:\.\d+){2}'+                'href="/getfile/[^/]+/foobar2000_v(?<versionNumber>\d+(?:\.\d+){1,2}).exe">foobar2000 v\d+(?:\.\d+){1,2}' ` 
-                'C:\Program Files (x86)\foobar2000\foobar2000.exe' `+                $appsToCheck['Foobar2000'`
                 ';TrimTrailingDotZero;'                 ';TrimTrailingDotZero;'
         }         }
         'Fiddler'         'Fiddler'
         {         {
-            CheckLocalFile 'Fiddler' 'http://fiddler2.com/get-fiddler' ` +            CheckLocalFile 'Fiddler' 'https://chocolatey.org/packages/fiddler4' ` 
-                '\<p id="Content_C014_ctl00_ctl00_BottomContentTag"\>Version (?<versionNumber>\d+(?:\.\d+){2,3})\</p\>' ` +                '<title>\s*Chocolatey\s+Gallery\s*\|\s*Fiddler\s*(?<versionNumber>\d+(?:\.\d+){2})'
-                'C:\Program Files (x86)\Fiddler2\fiddler.exe' ''+                $appsToCheck['Fiddler'] ` 
 +                ';FirstThreeDigitsOnly;'
         }         }
         'Process Explorer'         'Process Explorer'
Line 196: Line 285:
             CheckLocalFile 'Process Explorer' 'http://technet.microsoft.com/en-US/sysinternals/bb896653' `             CheckLocalFile 'Process Explorer' 'http://technet.microsoft.com/en-US/sysinternals/bb896653' `
                 '<h1>Process Explorer v(?<versionNumber>\d+\.\d+)</h1>' `                 '<h1>Process Explorer v(?<versionNumber>\d+\.\d+)</h1>' `
-                'C:\Program Files (x86)\ProcessExplorer\procexp.exe' ''+                $appsToCheck['Process Explorer'''
         }         }
         'Process Monitor'         'Process Monitor'
Line 202: Line 291:
             CheckLocalFile 'Process Monitor' 'http://technet.microsoft.com/en-US/sysinternals/bb896645' `             CheckLocalFile 'Process Monitor' 'http://technet.microsoft.com/en-US/sysinternals/bb896645' `
                 '<h1>Process Monitor v(?<versionNumber>\d+\.\d+)</h1>' `                 '<h1>Process Monitor v(?<versionNumber>\d+\.\d+)</h1>' `
-                'C:\Program Files (x86)\ProcessMonitor\procmon.exe' ''+                $appsToCheck['Process Monitor'';TrimTrailingZero;'
         }         }
 #       Next time the version changes, try using this rather than the Semi-automatic check. #       Next time the version changes, try using this rather than the Semi-automatic check.
Line 209: Line 298:
 #            CheckLocalFile 'Notepad++' 'http://notepad-plus-plus.org/download/' ` #            CheckLocalFile 'Notepad++' 'http://notepad-plus-plus.org/download/' `
 #                '<title>Notepad\+\+ v(?<versionNumber>\d+(?:\.\d+){1,2}) - Current Version</title>' ` #                '<title>Notepad\+\+ v(?<versionNumber>\d+(?:\.\d+){1,2}) - Current Version</title>' `
-#                'C:\Program Files (x86)\Notepad++\notepad++.exe' ''+#                $appsToCheck['Notepad++'''
 #        } #        }
         'VLC'         'VLC'
Line 215: Line 304:
             CheckLocalFile 'VLC' 'http://videolan.org/vlc/' `             CheckLocalFile 'VLC' 'http://videolan.org/vlc/' `
                 'href=''//get.videolan.org/vlc/(?:\d+(?:\.\d+){2})/win32/vlc-(?<versionNumber>\d+(?:\.\d+){2})-win32.exe''>' `                 'href=''//get.videolan.org/vlc/(?:\d+(?:\.\d+){2})/win32/vlc-(?<versionNumber>\d+(?:\.\d+){2})-win32.exe''>' `
-                'C:\Program Files (x86)\VideoLAN\VLC\vlc.exe' `+                $appsToCheck['VLC'`
                 ';CommaToFullStop;TrimTrailingDotZero;'                 ';CommaToFullStop;TrimTrailingDotZero;'
         }         }
Line 221: Line 310:
         {         {
             CheckLocalFile 'FileZilla' 'http://filezilla-project.org/download.php?type=client' `             CheckLocalFile 'FileZilla' 'http://filezilla-project.org/download.php?type=client' `
-                '>The latest stable version of FileZilla Client is (?<versionNumber>\d+(?:\.\d+){2})<'+                '>The latest stable version of FileZilla Client is (?<versionNumber>\d+(?:\.\d+){2,3})<'
-                'C:\Program Files (x86)\FileZilla FTP Client\filezilla.exe' `+                $appsToCheck['FileZilla'`
                 ';CommaToFullStop;RemoveSpaces;TrimTrailingDotZero;'                 ';CommaToFullStop;RemoveSpaces;TrimTrailingDotZero;'
         }         }
Line 229: Line 318:
             CheckLocalFile 'ImageMagick' 'http://www.imagemagick.org/script/binary-releases.php' `             CheckLocalFile 'ImageMagick' 'http://www.imagemagick.org/script/binary-releases.php' `
                 '>ImageMagick-(?<versionNumber>\d+(?:\.\d+){2})(?:-\d+)?-Q16-x64-dll\.exe<' `                 '>ImageMagick-(?<versionNumber>\d+(?:\.\d+){2})(?:-\d+)?-Q16-x64-dll\.exe<' `
-                'C:\Program Files\ImageMagick\mogrify.exe' ''+                $appsToCheck['ImageMagick'''
         }         }
         'TortoiseSVN'         'TortoiseSVN'
Line 235: Line 324:
             CheckLocalFile 'TortoiseSVN' 'http://tortoisesvn.net/downloads.html' `             CheckLocalFile 'TortoiseSVN' 'http://tortoisesvn.net/downloads.html' `
                 '>The current version is (?<versionNumber>\d+(?:\.\d+){2})<' `                 '>The current version is (?<versionNumber>\d+(?:\.\d+){2})<' `
-                'C:\Program Files\TortoiseSVN\bin\TortoiseSVN.dll' `+                $appsToCheck['TortoiseSVN'] ` 
 +                ';FirstThreeDigitsOnly;' 
 +        } 
 +        'WinDirStat' 
 +        { 
 +            CheckLocalFile 'WinDirStat' 'http://windirstat.info/'
 +                '>Latest version: (?<versionNumber>\d+(?:\.\d+){2})<'
 +                $appsToCheck['WinDirStat'] ` 
 +                ';FirstThreeDigitsOnly;' 
 +        } 
 +        'WinDirStat' 
 +        { 
 +            CheckLocalFile 'WinDirStat' 'http://windirstat.info/'
 +                '>Latest version: (?<versionNumber>\d+(?:\.\d+){2})<'
 +                $appsToCheck['WinDirStat'] ` 
 +                ';FirstThreeDigitsOnly;' 
 +        } 
 +        'Expresso' 
 +        { 
 +            CheckLocalFile 'Expresso' 'http://www.ultrapico.com/ExpressoDownload.htm'
 +                '\(Version (?<versionNumber>\d+(?:\.\d+){2}) - ' ` 
 +                $appsToCheck['Expresso'] ` 
 +                ';FirstThreeDigitsOnly;' 
 +        } 
 +        'LibreOffice' 
 +        { 
 +            CheckLocalFile 'LibreOffice' 'http://www.libreoffice.org/download/libreoffice-fresh/'
 +                '>Download Version (?<versionNumber>\d+(?:\.\d+){2})<'
 +                $appsToCheck['LibreOffice'] ` 
 +                ';FirstThreeDigitsOnly;' 
 +        } 
 +        'VirtualBox' 
 +        { 
 +            CheckLocalFile 'VirtualBox' 'http://www.virtualbox.org/wiki/Downloads'
 +                '\>\s*VirtualBox\s*(?<versionNumber>\d+(?:\.\d+){1,2})\s*platform\s*packages\s*\<'
 +                $appsToCheck['VirtualBox'] ` 
 +                ';FirstThreeDigitsOnly;' 
 +        } 
 +        'Tixati' 
 +        { 
 +            CheckLocalFile 'Tixati' 'http://www.tixati.com/download/'
 +                '>Download Tixati v(?<versionNumber>\d+\.\d+)<'
 +                $appsToCheck['Tixati'] '' 
 +        } 
 +        'VeraCrypt' 
 +        { 
 +            CheckLocalFile 'VeraCrypt' 'https://veracrypt.codeplex.com/wikipage?title=Downloads'
 +                '>Latest Stable Release - (?<versionNumber>\d+\.\d+)'
 +                $appsToCheck['VeraCrypt'] '' 
 +        } 
 +        'IrfanView' 
 +        { 
 +            CheckLocalFile 'IfranView' 'http://www.irfanview.com/checkversion.php'
 +                'Current IrfanView version is: <b>(?<versionNumber>\d+\.\d+)'
 +                $appsToCheck['IrfanView'] '' 
 +        } 
 +        'Deluge' 
 +        { 
 +            CheckLocalFile 'Deluge' 'http://deluge-torrent.org/'
 +                '\>\s*(?<versionNumber>\d+(?:\.\d+)+)\s*\<'
 +                $appsToCheck['Deluge'`
                 ';FirstThreeDigitsOnly;'                 ';FirstThreeDigitsOnly;'
         }         }
Line 244: Line 393:
     }     }
 } }
- +  
- +cls 
-foreach ($appName in $AppsToCheck) { CheckAppCurrentVersionNumber ($appName) } +foreach ($appName in $AppsToCheck.Keys) { CheckAppCurrentVersionNumber ($appName) } 
- +#CheckAppCurrentVersionNumber 'Fiddler'
-Write-Host "Press any key to exit." +
-$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")+
 </code> </code>
powershell_check_for_updates.1384762451.txt.gz · Last modified: 2017/01/01 19:51 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki