Taming Vortex

Last week I have found somewhere on the forums trick how to instantly grab a part of the screen on Mac OS X. It left in my memory, and I had no idea at that time how handy would this be. Just press Cmd-Shift-4, and  there appears a new cursor which allows you to select part of your screen, and saves that screenshot to png file on your desktop.

The second trick allows you to magnify part of the screen under your cursor. It is a new feature of 10.4.8. This was also very handy during the development of the new Vortex database editor. Just press ctrl, and scroll you mouse wheel. Screen smoothly zooms in and out.



In WNC we prefer to have Mac OS X as our platform of choice. Not only because of almost zero administration, and also because of no problems at all. We would like everybody who has Mac OS X to to have better experience from our products by better integration Vortex with Mac OS X. For really good user experience you cannot provide the same installer as for other platforms, but you should use dmg image for installation. This is actually what I really like on Mac - to have no installation. You just copy application to /Applications folder, and that's it. No messing up the system. Also uninstaling means simply drag icon to trash.

 Opened Vortex Dmg in Finder

However it is not obvious how to make really nice disk image which opens Finder window of certain size, and with certain background. I have seached internet, but all tutorials tell only partially or not mention how to include creation of dmg image to your build system. So there is sumary how do we did it.

There are two basic steps - the first one you create only once, and then with every build you repeat the second in your build script. So the strategy is to create and setup dmg image, and then you copy files to image, and pack image with every build.

Create and setup empty dmg image

I created a new sparse disk image in disk utility application. This disk image is read/write, and sparse images can grow their size when needed (up to the limit from disk utility). So I saved the newly created image as "Puakma Vortex.sparseimage". I set size to 100MB, but it doesn't matter since we shrink dmg file at the end.

So the next step is to setup this sparseimage file. Open sparseimage in Finder. The image will mount to the /Volume directory under name of sparseimage (or dmg) file. Resize the window as you want. Copy the background file to some directory in the image. Now set the window background. Press cmd+J to open view settings dialog, and set background there.

Now we will hide this directory from finder. You can use two ways - the first one is to rename directory name to start with dot, so this will be UNIX hidden file, or use SetFile utility from Apple's developer tools. I used SetFile utility from terminal which hided directory on the mounted disk image. Also note quotes around the file.

/Developer/Tools/SetFile -a V "/Volumes/Puakma Vortex/background"

At the end you will need to create link to the /Application directory. You also might want to setup position of icons in the folder. Just drag icon at some place, and that's it.

Copy your application to image 

For this part you might want to use some script because this will be repeated task mostly included in your build system. So there is what I have to setup Vortex:

# mount image
hdiutil attach "Puakma Vortex.sparseimage"
# remove all directorues and files from Puakma Vortex directory from that image
rm -Rf "/Volumes/Puakma Vortex/Puakma Vortex/*"
# copy all needed files - you can use rsync instead of this command,
# and the previous one, but Vortex has setup consisting from more parts
cp -R what "/Volumes/Puakma Vortex/Puakma Vortex/"
# and unmount image at the end
hdiutil detach "/Volumes/Puakma Vortex"

Shrink the image

The last step which should be done also in your build script is to shrink the file to the size which is necessary, and create dmg file.

hdiutil compact  "Puakma Vortex.sparseimage"
rm -f "Puakma Vortex.dmg"
hdiutil convert -format UDZO -o "Puakma Vortex.dmg" "Puakma Vortex.sparseimage"

So that's all, hope you enjoy new installation procedure for Mac.



About me...
Hello, I'm Martin Novák, and I talk here about Puakma Technology, Java, Eclipse, and Mac OS X.

I work on Puakma Vortex at webWise Network Consultants Pty Ltd based in Sydney in Australia, but I live now in Madrid in Spain.

Contact: Martin Novák

I'm talking about

Recommended reads

Calendar
01020304050607
08091011121314
15161718192021
22232425262728

(c) 2006, Martin Novák, contact me at my email