Sunday, May 31, 2009

Building the BleachBit installer for Windows

Building BleachBit 0.5.0 for Windows is relatively easy. The biggest challenge is installing the many dependencies. The end result is a single-file, redistributable installer which contains all dependencies: GTK+, PyGTK, etc. Some other projects with the same dependencies install the dependencies with a sub-installer, but BleachBit's approach is seamless.


Install these dependencies:

  • Python 2.5.4. Do not use Python 2.6.2 because it causes the error
    "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem"
    related to a MSVCR90.DLL issue.)
  • NSIS 2.44
  • py2exe 0.6.9
  • PyCairo 1.4
  • PyGObject 2.14
  • PyGTK 2.12
  • GTK+ 2.12

This GTK+ runtime is old. Newer versions may work but haven't been tested yet.

Build process

After installing the dependencies, build and package BleachBit like this:

  1. Extract BleachBit source tarball or retrieve the source by SVN.
  2. Change to the directory with
  3. Optionally, unzip upx.exe from UPX 3.03 to this directory. UPX compresses the executables and DLLs. While UPX may increase the size of the installer slightly (because of the double compression), it saves disk space by reducing the final installation footprint.
  4. If you repeat the installer build process often, run this command to save time:
    upx --best c:\gtk\bin\*.*
  5. Compile the gettext localization files from .po to .mo format with this command:
    make -C po local 
    Microsoft Windows doesn't have make, so you may need a Cygwin environment; I use a Linux machine with file sharing setup between Windows and Linux.
  6. If you are using BleachBit version 0.5.0 exactly, replace setup_py2exe.bat with revision 426. (This revision will be included in BleachBit 0.5.1.)
  7. Run setup_py2exe.bat to clean any old builds, invoke and py2exe, copy remaining files from the GTK+ runtime (py2exe misses some necessary GTK+ files), compress executables with UPX, purge several megabytes of unnecessary GTK+ locales, and invoke NSIS to build the installer.

You're done. Now test the installer on a fresh machine (without any of these dependencies installed.)

Other uses

Installing these dependencies has other uses than building a redistributable package. The environment is useful for developing BleachBit. Also, you can run new versions of BleachBit without having to re-download and re-install the large GTK+ runtime for each BleachBit release: this saves about 98% of the download size—not that it matters so much these days with high-speed Internet.

Friday, May 29, 2009

BleachBit 0.5.0 released

Version 0.5.0 is a major release of BleachBit, the free and open source file and privacy cleaner for Linux and Windows. BleachBit aims to be an easy, advanced, and smart way to clean junk including cache, cookies, Internet history, localizations, logs, and temporary files.

This is an unstable release intended only for testing.


The following changes are included since 0.4.2:

  • Add support for Microsoft Windows XP, Vista, and 7.
  • Add convenient Windows installer (with all the dependencies included) and uninstaller .
  • Add cleaners for Google Chrome, Microsoft Internet Explorer, and Safari.
  • Clean more cookies created by Macromedia/Adobe Flash.
  • Enhance CleanerML to hide cleaners on unsupported operating systems (such as hiding WINE and Rhythmbox on Windows).
  • Fixed bug "Bookmarks in Firefox can't be saved.".
  • Change the cleaning and preview system from a thread to an idle function to support Windows. One nice side effect is closing BleachBit (with the X in the corner) during a cleaning operation immediately closes BleachBit and stops further cleaning. Another side effect is this change facilitates command line invocation of BleachBit (to be added later).
  • Add Brazilian Portuguese translation thanks to A. Gabriel.
  • Add Czech and Slovak translations thanks to Roman Horník.
  • Add Serbian translation thanks to turncoat.
  • Update Arabic translation thanks to MaXer.
  • Update Danish translation thanks to Jimmy Frydkær Jensen.
  • Update French translation thanks to Mathieu Pasquet.
BleachBit 0.5.0, the free and open source file and privacy cleaner, cleaning Firefox 3 cache on Windows 7

Known issues

  • Installation may fail on Vista and Windows 7 with the error 'Error opening file for writing.' Make sure you right click on the installer .exe and choose 'Run as Administrator.'
  • Internet Explorer index.dat files cannot be cleaned because they are in use (locked) by a running process. You will see a red error. (Other cleaner programs clean the MSIE index.dat files during the user login process before MSIE starts.)
  • When running a preview in Windows 7 (and probably Vista) some files are listed twice. (This is harmless, but it inflates the preview size.)
  • A few cleaners don't clean anything on Windows because they aren't yet updated for Windows.
  • Localizations may not work on Windows, so BleachBit may appear in English even for languages with translations (over 10 languages). Would you please let me know?
  • The Windows installer is a bit too large (because the GTK+ runtime is large).
  • On Windows when there is an exception (such as when a file can't be deleted), py2exe throws up an error dialog about a log file when exiting BleachBit.
  • On Windows shredding doesn't work.
  • Windows virus scanners may not like that BleachBit uses UPX executable compression to reduce its disk space footprint. Please report any issues.
  • BleachBit may delete TrueCrypt containers on Linux.
  • Some unit tests may fail on Windows.
  • The taskbar button on Windows 7 has the wrong icon.
  • Installing BleachBit in the non-default location may cause it to lose some cleaners.


Download BleachBit now. Installation packages are ready for 18 platforms including CentOS, Debian, Fedora, Mandriva, openSUSE, Red Hat, Ubuntu, and Windows.

Sunday, May 17, 2009

Bookmarks can't be saved in Firefox 3

Thank you to Rob from Holland who (not only donated to BleachBit but) reported this bug. When deleting the Places database in Firefox version 3 using BleachBit 0.4.2, it's not possible to save new bookmarks. The bookmarks disappear when Firefox is restarted.

A Mozilla knowledge base article gives the solution. If you suffer this bug in BleachBit 0.4.2, close Firefox and run this command:

rm ~/.mozilla/firefox/*/bookmarkbackups/*json

The explanation: Firefox tries to reconstruct the missing places.sqlite file from the JSON backups.

The fix is applied for BleachBit 0.5.0. For older versions, you may apply this patch.

Monday, May 11, 2009

BleachBit on Windows Vista

With a change to replace threading with use of PyGTK's idle event loop, BleachBit starts on Microsoft Windows.

BleachBit doesn't do anything useful yet on Windows because the file paths it currently knows are specific to Linux: that's easy to fix. The part I am not looking forward to is trying to bundle GTK+, Python, PyGTK, PyCairo, and PyGObject into a simple installer, and then I have convince users to download 24MB of runtime to run a 100KB program. Today's modern system have plenty of bandwidth and disk space, but still that's ironic situation for a system cleaner.

Previous post: BleachBit on Windows (February 2009).

Update: BleachBit 0.5.0 released with support for Microsoft Windows.

The new thread-free code also paves the way to implement a command-line interface (CLI) one day.

Sunday, May 10, 2009

BleachBit 0.4.2 released

Version 0.4.2 is a maintenance release of BleachBit, the file and privacy cleaner for Linux. BleachBit aims to be an easy, advanced, and smart way to clean junk including cache, cookies, Internet history, localizations, logs, and temporary files.


The following changes are included since 0.4.1:

  • Clean Adobe Reader 9.0's cache (in addition to previous versions of Reader).
  • Whitelist paths in /var/log/ to prevent deleting important files on Slackware.
  • Add Danish translation.
  • Update French, German, and Finnish translations.

All reported bugs are fixed. BleachBit packages for Slackware can now be downloaded from


Download BleachBit now. Installation packages are ready for 18 Linux distributions-versions including CentOS, Debian, Fedora, Mandriva, openSUSE, Red Hat, and Ubuntu.