Tuesday 16 February 2010

Windows 7 on my Mac

I finally took the plunge a few weeks back, and upgraded my Mac Book Pro hard drive (requiring a week with the Apple repair center to do the upgrade!), in preparation for replacing the Windows XP Boot Camp partition with a Windows 7 installation (with Windows XP moved from Boot Camp to a Parallels VM).

The transition was fiddly; I used Parallels Transporter to copy the Boot Camp XP to a virtual machine image on an external USB drive (which I then copied to the Mac Hard Drive). I had to use a USB drive, as I couldn't get Parallels Transporter to work over my LAN. Once I'd proved that the VM started OK (and was backed up to my RAID drive!), I then got rid of the boot camp partition, and tried to install Windows 7 in a larger Boot Camp partition. However... I found was that the Mac drive was too fragmented to resize the Boot Camp partition (!).

I did some reading around the subject, and was surprised to find that Macs don't have a defragmenter option...! My solution was not much fun, but was easier than it sounds: I cloned-off the hard drive using the incredible Super Duper! to another spare USB drive, double-checked that I could boot off that drive; then cloned-back the Super-Dupered drive back to replace the contents of my Mac Book drive. That fixed the fragmentation, so I could finally configure the Boot Camp partition as I wanted and proceed with installing Windows 7.

I chose a 64-bit install of Windows 7 so that I could use Mixtikl and Noatikl VST plug-ins in 64-bit mode under Windows.

Using 64-bit so far hasn't caused me too many problems; Beyond Compare (which is still isn't available in a 64-bit version) did't integrate at first with Windows Explorer. However, thanks to a comment from Aaron from Scooter Soft (see below), I found the configuration option that let me re-configuration as a shell extension, which now works perfectly!

There is also a 64-bit version of Tortise SVN which integrates with Windows Explorer OK. There is also a new version of Cygwin that works fine with Windows 7, and I found a 64-bit copy of GVim that integrates with Windows Explorer.

All in all, Windows 7 is quite a bit faster than XP (though still not as fast as Mac OS!), and is in general easier to use now that I've customised Windows Explorer to work more like that in Windows XP. After a week of use, XP already seems dated and I have no intention of going back to it other than for occasional software testing! I also love the way that out-of-the-box, Windows 7 gave me a read-only view of the HFS partition on my Mac.

So, what about a Windows 7 virtual desktop manager (Mac has the wonderful spaces built-in)? Well, simply install VirtuaWin - it works beautifully, and is open source!

Finally, you'll need Cygwin to get a greate scripting environment, which lets you share scripts between Windows and Mac.

That said, there are far more tools for Windows than for Mac... so I am happy to use both Windows and Mac, mixing-and-matching where required. Where would I be without Beyond Compare and Tortoise SVN on the Windows side, for example? :) The combined Mac OS X/Windows/Parallels/Bootcamp system really is a good one for code development...

64-bit Noatikl and Mixtikl...

I'm currently working on creating 64-bit versions of Noatikl and Mixtikl...

This is made easier for us on the Mac, which supports the use of Universal Binaries; there is quite a lot more fiddling around to do on Windows, where I have to build both separate binaries and a dual-configuration install that includes both 32-bit and 64-bit components.

Incidentally, using Inno Setup makes building a mixed-mode install very easy; what a great tool.

Of course, having both 32-bit and 64-bit binaries makes testing even more time-consuming than usual...!

Tuesday 9 February 2010

cygwin - alternative shells

While I love cygwin, I've never been totally happy with the standard Cygwin Shell Console, mainly in the way that it handles copy/paste, fonts and colour setting. But mainly copy/paste. :)

Well, I've finally got around to reseaching some replacements, and like what I've found!

Basically, I found a couple of good alternatives: mintty and rxvt. Neither of these require use of X, and both are available as optional packages that you can select from the standard cygwin installation.

Note: neither of these work right with non-cygwin utilities that require piping. You need to keep the normal Cygwin Shell Console for that.

mintty (http://code.google.com/p/mintty/)

When you install this as a cygwin component, you'll find a shortcut created for you automatically under the Start menu.

Next, I modified the shortcut to look like this:

C:\cygwin\bin\mintty.exe bash -li

However, when I started cygwin using this shortcut, my normal .profile scripts weren't picked-up properly. To fix this, I had to modify /etc/profile and add a line like this...

export HOME=/cygdrive/c/home

mintty then launches.

What I love about this is that it gives a fully UTF-8 enabled shell, where it is really easy to cut/copy/paste text, and very easy to change colour schemes.

Just right-click on a mintty window to see the copy/paste etc. options; dead easy.

If you want to spawn-off a new console, use an alias like this:

alias mintty='mintty --size=100,70 bash --login -i &'

mintty

rxvt

This is also available under cygwin, but isn't fully Unicode aware, so isn't as good as mintty. You'll see problems for example when you try viewing a manual page; look at the funny text you get when you try this...:

man bash

That said, here is what I did to get it working.

Basically, I took a copy of the cygwin.bat file, and modified part of it like this:

rem bash --login -i
rxvt -sr -sl 2500 -sb -geometry 100x70 -fg black -bg white -tn rxvt -fn "Lucida Console-12" -e /usr/bin/bash --login -i

I also created an alias in my .profile file, that allows me to launch new rxvt windows easily.

alias rxvt='rxvt -sr -sl 2500 -sb -geometry 100x70 -fg black -bg white -tn rxvt -fn "Lucida Console-12" -e /usr/bin/bash --login -i&'

With rxvt, you get a paste operation in one of two ways:
- Ctrl-Shift-LeftButton
- middle (press mouse wheel) - no good for MacBook devices with Track pad!