Thursday, July 30, 2009

Program Updating (r72)

Now that we're out of our 0.9.1 "stabilization mode" coding, it's time to start working on some more interesting things.

First up is the resurrection of the "Program Update" code. Updated the URLs to point to a PeerBlock-specific website, uploaded my own latest-update-checking script, and BOOM . . . nothing. Well, that's not entirely accurate - the program's updating the "Updating" UI to change the status to say "Update available, see (url)". The thing is, the program's supposed to pop up a window and tell you to download a new version, loading up the website in your browser for you if you choose to do so. Doesn't look like this code was working even in the PeerGuardian base code, but then again since the PeerGuardian update URL says the latest official version was built in 2005, I suppose nobody would really remember all that well whether it worked or didn't.

Either way, it's working now! PeerBlock will now check for updates, and will actually let you know if a new version is available. And it will pop up that window asking you if you'd like to be taken there. And it will take you there if you so choose.

Not as slick as an automatic update routine that does everything under the covers for you, but it should suffice for now. Speaking of which, I need to add an Enhancement Request to our issue-tracker to track that idea for future implementation...

Technical Details

The diffs are actually relatively straightforward, and the tracelog routines sprinkled throughout should help let you know what's going on in each section.

That said, there are a few hairy bits...

The way it works is the program stores a date-string for when it was compiled, sticks a number on the front of it to identify build-type, and calls this the BUILDSTR. We then open the URL for a PHP-based update-script, and pass it this BUILDSTR. The update-script then returns a string (in the same format), identifying the latest release for that build-type. PeerBlock then checks to see if the returned latest-version is greater than its BUILDSTR number, and if so gets ready to perform the update operation.

I updated this a bit to add a build-version to the end of it, and ended up needing to update a few key variables to type "unsigned long long" as a result - those numbers are getting awfully big! Also note that we should probably reduce the build-type #defines by a factor of 10 once 2010 rolls around; they're only so high because otherwise STRINGIFY ends up stripping the leading 0.

And for what it's worth, we never seem to real the else clause that starts on line 638 in updatelists.cpp. This is why the updatepg was never being set, which caused the "Update available, would you like to go there?" window to never be displayed.

Tuesday, July 28, 2009

PeerBlock r70 Interim Release

Okay guys, ONE MORE TIME... Here's what will hopefully be the final Interim Release before releasing PeerBlock 0.9.1.

What's Changed

Since the r65 Interim Release we believe we've resolved the "crash during update lists" problem that was occurring in the third-party code we're using to download lists. {Bug#24} We've also fixed some of the code that can lead up to a very rare "CreateService error 122" problem to actually tell us the real error code. {Bug#26} "Update at Startup" is now mandatory, to help workaround Bug#22. - you can set it to whatever you want in the .conf file, but it won't change anything (and is disabled within the settings).

Things to Test

I'm not too worried about specifically testing much for this release. If you can find a way to reproduce the Bug#26 problem and send me peerblock.log and a screenshot of the error-text, that would be great. Other than that I think we're in good shape; if we can get through 24 hours without anybody reporting any severe problems I think I'll call it good enough for Public Release.

Get it Here

PeerBlock r70 Installer


Thank you for continuing to help with this testing. If at all possible please send me some feedback within the next 24 hours or so, even just to say that everything's working like a charm (which it hopefully will!).

        --- Mark ---

Saturday, July 25, 2009

PeerBlock r65 Interim Release

The next Interim Release of PeerBlock - r65 - is now ready. My intent for this one is to give it a quick "sanity test" cycle, and if no serious issues are found to then release this as a Public Release (after bumping up the rev-number to remove the "Internal Testing Release" designation).

What's Changed

Here's the list of what's different since the last Interim Release, r61:

DisCoStu has updated the installer to fix all the reported installer issues. This should resolve the first five items on the "Known Issues" list for r61. Removed the "Uninstall PG2" option, since the PG2 installer will complain if PeerBlock is running at the same time . . . and since we can now successfully run PeerBlock after install, it should be.

The tracelogging functionality was implicated in the majority of the crashes that have been seen recently. I believe I've resolved those issues now.

The one unresolved crash I've seen occurred in the "UpdateProgress" routine called while we're updating lists. I've added some additional tracelogging code in here to help track where in the process it's dying. This can significantly bloat the peerblock.log file (my install grows up to 60-70kb for a single update of just the p2p list!), but even at that it shouldn't grow too large too quickly, and it zips up very well so sending me those logfiles shouldn't be too much of a burden. That said, for this release at least please make sure you're running at TraceLog Level=5 in peerblock.conf, and make sure you zip up those .log and .dmp files prior to sending them to me!

Things to Test

As always, I have a list of some things I'd like for us all to make sure we test with this release. Before testing out the installer-changes, make sure you save aside a copy of your peerblock.conf file and any custom lists you've generated, so you don't lose them!
  1. Installer, Upgrade - Revert to a base r52 install (running the r61/r65 uninstaller, then manually cleaning out the install-directory, then install r52 back on your system. Make a configuration-file change (say, changing the color of logged entries or something). After this, run the r65 installer to upgrade the installation. Verify that the program is working correctly, that your pg2.conf file did NOT get overwritten (e.g. that the color of your logged entries remains how you set it up in your temporary install of r52), and (after exitting PeerBlock) that peerblock.conf contains the TraceLog section with Enabled=yes and Level=5. Again, this is how a large part of our user base will be introduced to r65 - let's make sure it's a pleasant one.
  2. Installer, Fresh - Uninstall PeerBlock via its uninstaller, then manually clean out the install-directory. Run the r65 installer, make sure everything seems to work, that it's correctly-imported your PG2 .conf file (if PG2 is present and installed in the default directory on your system), and after exiting PeerBlock verify that the .conf file has a TraceLog section with Enabled=yes and Level=5.
  3. Uninstall - Run the PeerBlock uninstaller, and make sure it deleted all the files in its install-dir this time.
  4. Update Lists - This is still a bit of a sore spot, though crashes have become increasingly rare. Try closing down PeerBlock, deleting your lists and/or cache.p2b file (don't do this last one while PeerBlock is running!), and restarting PeerBlock. If you experience any crashes here, again, please zip up those peerblock.log and .dmp files and send them to me ASAP!

Get it Here

PeerBlock r65 Installer


Thanks again for helping test out PeerBlock! Without your help, we probably would have "publicly released" r61, with all the bugs it contained. Thanks to the work you're all putting in, our users will (hopefully) be able to trust that what we publicly release are generally in pretty darn good shape.

        --- Mark ---

Monday, July 20, 2009

PeerBlock r61 Interim Release

We've got another build ready for official test. r61, which will hopefully be publicly released as v0.9.1.61 once y'all put it through its paces. Please don't post this release to the forums yet - I want to make sure we've managed to work out all the crashy bits before we "bless" it.

What's Changed

Since the last Interim Release (r52), here's what's new:

First off, we've got DisCoStu's installer work. The installer-package should have some spiffy custom graphics, install the correct variant of PeerBlock (Vista/Win7 vs. XP, x64 vs x86), automagically copy in the pg2.conf file from your original PG2 installation (if you installed it in the default C:\Program Files directory), and ask if you'd like to uninstall PG2 while you're at it.

I believe nearly all the app-crash causing bugs have been fixed. Primarily, these were crashing during list-updating, and crashing while exiting. If you experience any crashes, save aside your peerblock.log and .dmp files and send them to me ASAP!

I also have created new options in the .conf file to allow you to configure your tracelog functionality. In peerblock.conf, under the "TraceLog" heading you will find two new fields: Enabled and Level. Enabled can be either "yes" or "no" (defaults to yes), and Level can be one of the following values: 0 (disabled), 1 (Critical-severity only), 2 (Critical- or Error- severity only), 3 (Critical, Error, or Warning), 4 (Critical, Error, Warning, Success), 5 (Info, and all other higher-severity fields), 6 (Verbose, and all others), 7 (Debug, and all others). Basically, the higher the number, the more messages you'll see logged to peerblock.log; the default is, I believe, 5. For the initial few rounds of testing, please run it at level 5 or 6, as the extra messages will make it that much easier to figure out what's going on in the case of a problem.

Known Issues

Here are the list of issues that have been reported by various peoples in this release:
  1. Typo in Installer - The installer filename is "PeerBock" instead of "PeerBlock"
  2. Problems Installing if PeerBlock Running - If PeerBlock is currently running when you try to run the installer, it can't overwrite the peerblock.exe and peerblock.log files because they're already in use.
  3. Error Running PeerBlock as Last Step of Installer - The Installer asks you if you want to run PeerBlock after it's installed it, but if you try to it displays an error because PeerBlock requires Administrative Rights to run.
  4. Uninstall Leaves Dangling Files - After you Uninstall the program, it leaves some files left on your harddrive. These leftovers include the lists dir with lists inside, cache.p2b, history.db, peerblock.conf, peerblock.log, and peerblock.dmp (if it exists).
  5. PG2 Config Imported During Upgrade - When you're upgrading your PeerBlock install, if you have PG2 installed on your system the installer will copy PG2's pg2.conf file over top of your PeerBlock's peerblock.conf. This will cause any PeerBlock-specific settings you've updated to be overwritten.
  6. Hang While Updating "P2P" List - Only one reported instance of this, but PeerBlock hung while it was updating the "p2p" list. The user clicked Abort, at which point PeerBlock crashed.
  7. PeerBlock Running in Vista Compat Mode on Win7 - One reported instance of this happening; previous versions may have crashed a few times, causing Windows to automatically run the program in Vista Compatibility Mode.
  8. Crash During High Stress - One user has reported frequent crashes while his machine was performing lots of P2P activity. Early indications are that disabling tracelogging may have resolved this.
  9. Dumps - A couple of other app-crashes have been seen, the peerblock.dmp files generated will be undergoing triage soon.
These problems are all being looked into, and will hopefully be resolved within the next few days. After that we will generate another Interim Release, go through a quick 24-hour Sanity Test cycle, and if no new critical bugs are reported in that time we'll upgrade that to an official Public Release.

Things to Test

If we could all try to run through this list of tests, that would be greatly appreciated.
  1. Installer, Upgrade - If you installed the r52 Installer package that DisCoStu posted to the PG2 Forum, please try running this r61 installer and upgrading your installation. Make sure everything seems to be working, and that the main UI says "PeerBlock r61 - INTERNAL TESTING RELEASE". This is the experience that many of our current users will likely go through, I'd like for us to make sure it's working well for them.
  2. Installer, Fresh - Uninstall any previously-installed version of PeerBlock (even/especially if you've run through Test #1 above), and run the installer as if you're a new user. Verify that it installs where/how you tell it to, and again that the program is running correctly. Make sure that peerblock.log is created in the install-directory. Verify that it copied over the pg2.conf file from your previously existing PG2 install (if you have one), and that it uninstalled PG2 (if you selected it to).
  3. List Updating - Since many people have experienced crashes while attempting to update lists, test this out quite a lot. We do have a couple of patches in place that appear to fix the problem, but I'd like to make sure. Click the "Update Lists" button, make sure the app doesn't crash. Close PeerBlock, delete your list(s), restart PeerBlock and let it redownload the lists, make sure it doesn't crash. Close PeerBlock, delete your cache.db file, restart PeerBlock, make sure it "Generates List Cache" . . . and doesn't crash.
  4. Program Exit - Once again I believe I've nailed down that "app-crash while exiting the program" bug, but would like to make sure. Start PeerBlock up, wait a little while, then right-click on the taskbar icon and exit. Make sure it doesn't pop up one of those windows saying it crashed. Do this a whole bunch of times.
  5. Tracelog Options - Close PeerBlock, update the .conf file to have "Enabled" set to "no", restart PeerBlock, open up peerblock.log in notepad, and make sure that only a few messages (up to the point where it's loading the config-file, basically) are logged. Try different "Level" numbers, make sure you see more/less things logged. (I don't think I have too many "Debug" level tracelog messages, and you hopefully won't see anything logged at Critical/Error level.)

Get it Here

PeerBlock r61 Installer


Once again, thanks to all you guys for helping test these pre-release versions out. Without you guys sending in your error reports, the program definitely wouldn't be as far along as I think it is.

So keep on sending me any problem reports, or even any reports that it's running without problems!

        --- Mark ---

[Edited 7/22/09 to add Known Issues list]

Installer, and Versioning (r53-r55)

I've been a bit lax with making regular updates to this blog, will try and cover the stuff that's transpired of late.

First off, DisCoStu (from the PG2 Forums) was kind enough to offer to help out with updating the code for the PG2 Installer, and get it all set up for PeerBlock use.

A couple of minor nits existed with the initial installer-version released to test (on the PG2 Forums) - like not setting the WorkingDir on the shortcuts the installer created - but these issues were quickly fixed and reposted to the forum-thread, so the version that most people have been using of late should be pretty good as far as that stuff is concerned. It will even offer to copy over your old PG2 config-file if you've installed PG2 in the default "Program Files" directory, and offer to uninstall PG2 for you after you've installed PeerBlock if you're so inclined!

He's also made some spiffy custom graphics for the installer package, so it should look a bit nicer and more professional than it (or the original PG2 one) did previously. And the setup-files should have a rational name, so that you can tell which version is sitting there on your harddrive.


As part of the process of working on the installer, we had to come up with a versioning scheme for PeerBlock.

The "r33", "r52", etc., versions you're all used to seeing are currently based on the source-control revision used to generate that build of the program. This number is incremented every time a change is made ("committed") to the source code, and ends up being very similar to the "Build Number" associated with software like Windows.

The new version numbers for PeerBlock will be more standard, and should show how we're rapidly approaching a release worthy of being called 1.0. At this point, I'm calling the r52 version "leaked" to the forums

The first number (the first 0) will mean the Major Version of the program, and is 0 right now since I consider us still in a Beta mode. It will be increased to 1 once we're at what I'd consider a stable release, and then will someday go to 2 only after extensive architectural changes to the tool. For example if we rewrite PeerBlock to run as a Windows Service instead of a basic app, we'd bump this up to version 2.

The second number (the 9) will be the Minor Release number, and will be incremented whenever new functionality is added to the software. So the official stable release of PeerBlock will be 1.0, then if we add new functionality to, say, allow you to right-click on a blocked entry and run a WhoIs query on it, or start displaying we'd bump up the version number to 1.1. I plan to make sure that these minor releases are extensively tested, so you can feel comfortable running new ones as soon as they're released.

The third number (the second 0) will be a Bugfix Release number. If any bugs are discovered in a Minor Release, the next release containing a fix for these bugs will increment this value; for example since we're currently at v0.9.0, the next release - containing a fix for the "app-crash during update" problem, and hopefully the "app-crash on exit" as well - will be v0.9.1. As time goes on, this will allow us to easily release bugfixes while continuing working on new features, without destabilizing publicly released versions with buggy new functionality.

The fourth and final number (the 52 in will remain as the source-code rev; essentially the build-number of the program. This will make it easier to identify the source-code that goes with a particular release, for bugfixing purposes.

Technical Details

Google Code commit r53 contained DisCoStu's initial update of the installer code. Commit r54 was me updating the version-numbers; and r55 was DisCoStu's fix for the "no WorkingDir" issues, and included the new custom graphics for the installer.

For our future reference, when the r53 installer was run, it didn't associate a Working Directory value with the shortcuts it created. This meant that when PeerBlock created its peerblock.log file, or a peerblock.dmp file, the directory in which it was created could not be guaranteed. PeerBlock currently uses the Working Directory to decide this stuff, which since it wasn't set defaulted to the user's Desktop if they ran the shortcut from there, or C:\Windows\System if they ran it from somewhere else.

Commit r54 contains the new PeerBlock version-numbers, and should be referenced as a reminder as to which values need to be changed whenever we release a new version of PeerBlock. Note that we will of course need to pre-increment the build-number values, since as soon as we check-in that source-code change the build-number will change; this should be the last thing done prior to sending out a new release.

In addition to implementing the WorkingDir fix, commit r55 includes the new graphics for our installer: WizModernImage.bmp and WizModernSmallImage.bmp. We may want to update these once we come up with a unified "look and feel" to be shared among the program, the installer, and the website(s); but for now these look great to me.