2

How do I find out when a new version of FogBugz is available (and see release notes for it)?

flag

3 Answers

3

FogBugz user, Berounský Václav, offered up this PowerShell script which validates your currently installed version of FogBugz against the latest available version (as published on shop.fogcreek.com).

Note: This script was contributed by a third party, not Fog Creek Software, and it has not been tested for functionality or security.

# Check-FogBugzVersion.ps1
# 2010 Rebex CR # www.rebex.net<http://www.rebex.net> # support@rebex.cz<mailto:support@rebex.cz>
# Windows PowerShell Script # Output ready for PolyMon

# FogBugz URL
  [string]$FogBugzUrl = "http://fogbugz.domain.com"
  [string]$FogBugzPattern = '<a href="http://www.fogcreek.com/FogBugz">FogBugz</a> Version&nbsp.*'
# FogCreek URL
  [string]$FogCreekUrl = "https://shop.fogcreek.com/FogBugz/download.asp?cmd=fbupgrade"
  [string]$FogCreekPattern = '<p>The current version is.*'

# Counter definition
  [string]$CounterDescriptionDB = "FogBugzVersion"

# PowerShell Debug variables
# Clear-Host
$Status = @{}
$Status.StatusID = $null
$Status.StatusText = $null
$Counters = @{}

# Main()

# Default status
$Status.StatusText = "Fail. Unknown reason"
$Status.StatusID = 3
$CounterValue = $null

function Get-UrlContent (
    $url = $(throw "Empty value for the URL parameter.")
    ) {
    $request = [System.Net.HttpWebRequest]::Create($url);
    $response = $request.GetResponse();
    $encoding = [System.Text.Encoding]::GetEncoding( $response.CharacterSet )
    [string]$output = ""

    if ($response.StatusCode -ne 200) {
        return $null
    } else {

                # Get WEB
                [int]$goal = $response.ContentLength
                $reader = $response.GetResponseStream()
                    [byte[]]$buffer = new-object byte[] 4096
                    [int]$count = 0
                    do {
                                              $count = $reader.Read($buffer, 0, $buffer.Length);
                                  $output += $encoding.GetString($buffer,0,$count)
                    } while ($count -gt 0)
        $reader.Close()
        return $output
    }
}

# FogBugz URL
    if ( $(Get-UrlContent($FogBugzUrl)) -match $FogBugzPattern) {
        $FogBugzVersion = $Matches[0].Split('&')[1] -replace "nbsp;"
    } else {
        $FogBugzVersion = $null
    }

# FogCreek URL
    if ( $(Get-UrlContent($FogCreekUrl)) -match $FogCreekPattern) {
        $FogCreekVersion = $Matches[0].Split(' ')[4] -replace "\.$"
    } else {
                $FogCreekVersion = $null
    }

# Results of FogCreekVersion Vs FogBugzVersion
    if (($FogCreekVersion -gt $FogBugzVersion) -or ($FogCreekVersion -eq $null) -or ($FogBugzVersion -eq $null)) {
                $Status.StatusText = "Fail. Unable to get version or You have version " + $FogBugzVersion + " and the new version " + $FogCreekVersion + " is available"
                $Status.StatusID = 3
                $CounterValue = 1
    } else {
                $Status.StatusText = "You have the latest version " + $FogBugzVersion
                $Status.StatusID = 1
                $CounterValue = 0
    }
# PolyMon.Counter.Add
  $Counters.Add($CounterDescriptionDB, $CounterValue)

# PowerShell Debug variables
$Status.StatusText
$Status.StatusID
$error
link|flag
1

  1. If you are an administrator in FogBugz, you will see a message at the top of the page when a new version is available.

  2. You can find the latest version of FogBugz and release notes on our website. Here it is for Windows, Mac and Unix. While there isn't currently an RSS feed for this page, Google Reader will create a feed of it for you. Just click Add a Subscription and paste in the KB page URL. Reader will ask you if you want it to create a feed. Tell it yes. When the page changes, you will see it in Reader! If you want an email notification, I recommend putting the feed URL (view the feed in Reader, click show details and copy the feed URL) into notify.me (a free service that will IM, SMS or email you updates from RSS feeds)

Then you can download FogBugz from your account status page.

link|flag
1

I'm programatically (telnet or wget+findstr) testing http://fogbugz.domain.cz/default.asp?pg=pgOldMainMenu for content "New Version Available"

why there is no any "New Version Available" flag/status in DB, it's the question ?!?

link|flag
This message is only shown to admins. Provided your telnet or WGET is passing your "logged on" admin cookies, this will work. If it doesn't, this won't work. – Michael Pryor Feb 25 2010 at 18:33
1 
aaah... Now I understand why it sometimes does not work ;o) Depend on if I had open IE logged to FogBugz website or not. For wget there is option --load-cookies=file. Do you plan to add this status to DB ? – VasekB Feb 26 2010 at 10:37

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.