Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Tuesday, June 30, 2009

Download statistics by operating system

Have you wondered which operating system is the most popular? Well, I mean among BleachBit users.

More than idle fancy, the information helps guide important development decisions such as packaging and as platform-specific cleaners. There are specific cleaners for Windows, Ubuntu, Fedora, and maybe others. Slackware required a special tweak to prevent deleting important files. Debian and Ubuntu require .deb packaging which is completely different than the .rpm packaging for CentOS, Fedora, Mandriva, and OpenSUSE, and Red Hat. Of course, Windows users need .exe files with PyGTK included. All these special needs require extra time, which is time taken away from other platforms.

When I started BleachBit seven months ago, I first packaged it for Fedora, which I myself use. Then, I used openSUSE Build Service to build packages for Debian, Mandriva, openSUSE, and Ubuntu. I was surprised by the disparity and quickly realized most downloads were for Ubuntu, many for Debian, and only a few for Mandriva.

The major change is BleachBit now runs on Windows. When Download Squad reviewed BleachBit, the Windows numbers gave Ubuntu some competition. For the last week since 0.5.2 was released, the chart below shows Ubuntu is back in the lead. (Note: SourceForge doesn't update its stats often. These were the same numbers as yesterday, so who knows how old they really are.)

BleachBit 0.5.2 download statistics for about one week

Mark Twain one wrote, "There are three kinds of lies: lies, damned lies, and statistics." Indeed, this chart doesn't tell the whole story. BleachBit is included in the Debian and Ubuntu repositories, so there are more Debian and Ubuntu downloads than shown. However, Ubuntu Janty Jackalope users still download BleachBit from BleachBit because the version 0.3.x in the repository is old. SlackBuilds for Slackware has an old version 0.4.1, but I don't provide a package for Slackware. I don't know which version openSUSE's repository has, but a few weeks ago I was pleasantly surprised to find it in openSUSE. Last time I checked, Fedora's repository had too many rules for me to try to submit a package, and no one has volunteered. Last of all, Windows of course doesn't have a central repository (try to keep up, Microsoft).

Another factor is BleachBit for Windows is new, relatively unknown, and advertised as a "preview." Depending who you ask, there are 10-100 Windows desktop users for each Linux desktop user. As BleachBit matures on Windows, Ubuntu will likely take second place.

Now I'm confused which platform is still the most popular, but I still think Ubuntu wins— for now.

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.

Dependencies

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 [broken was removed]

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 setup.py.
  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 setup.py 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.

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, February 15, 2009

BleachBit on Windows

Who says Linux should get all the open source apps? Successful cross-platform applications such as Firefox and OpenOffice.org reduce the barrier to switch from Windows to Linux, so what would it take to get BleachBit running on Windows?

BleachBit requires Python, PyGTK, and GTK. Though I never worked with GTK, I strategically these dependencies because they are cross platform and standard on most Linux distributions. However, installing this software stack on Windows is non-trivial. For example, GRAMPS requires the same stack, and the installation instructions require six installation packages totaling about 30MB—far too big and complex. Compare that to Linux where BleachBit is one package under 100KB because the dependencies are already there. Gourmet Recipe Manager seems to have fit all of PyGTK and friends in one Windows package of about 12MB: that could be tolerable but is still large.

Another option is writing the front end in native Windows code to eliminate the GTK+ dependency and help Windows users feel at home. (Firefox and OpenOffice.org use native widgets for the same reason.) Though maintaining two GUIs is not generally desirable, only 20% of the code is the PyGTK GUI, which is also modular, so this is feasible. Transmission (the BitTorrent client) maintains native GUIs for Linux, Windows, and Mac, but they probably have more developers. Using Python to access the BleachBit backend and to write the new Windows frontend could be accomplished with IronPython. On a whim, I tried to run a BleachBit unit test, which I was surprised to find passed on Windows 7 beta:

The startup was painfully slow and it looks like the unit test should have actually failed, but it was a pleasant surprise to see it get that far. It seems IronPython can even create .EXE's (with some dependencies).

Another option is wxPython: writing code once in Python creates native GUIs for Linux, Mac, Windows, and other systems. I have experience with wxWidgets (which wxPython uses), but there are still two problems. First, wxPython is not standard on Linux, and the dependencies for Linux and Windows are large (3-10MB). This is better for Windows than GTK, but it's a little worse for Linux.

Originally I considered many options including Python with GTK, C++ with wxWidgets, and C#.NET. There are simply no perfect choices for a high-level, cross-platform language with native GUI that is already installed standard on Linux and Windows. C#.NET is the closest choice, but again there are pros and cons. It's relatively standard on Windows and Linux (coming standard on Fedora, Ubuntu, and others), but some Linux users are allergic to it because of the connection with Novell and Microsoft. Worse of all, the GTK GUI is not standard on Windows, and on Linux it GTK is practically a necessity because Mono WinForms is so ugly.

In conclusion, BleachBit is not coming to Microsoft Windows soon. BleachBit will continue to focus on Linux, and the biggest short-term platform change will be supporting the new Debian 5, released just yesterday.

Future article: BleachBit on Windows Vista (May 2009).