• Mounting ISO files from the command-line

    With some recent birthdays, we've acquired some computer games for the kids to play.

    The titles include:

    • Arthur's Wilderness Rescue
    • Arthur's Sand Castle Content
    • Arthur's Pet Chase
    • Discovering Dinosaurs
    • Phonics 1 for beginners

    Even though these games are quite engaging and the kids really seem to like them, it's amazing at how clumsy some of these applications are to get installed in a 'safe' way.

    I install them myself, and then set up shortcuts so that the kids can log in using their username. I am an admin on our home pc, but the other accounts are just regular users.

    The games expect to run as Administrator (eg. the "Arthur" titles try and write the saved games back to the Program File installed directory (instead of in the user's profile). As a consequence, I had to fire up cacls.exe to grant Everyone permission to write to this folder.

    They also seem to assume you have a VGA monitor - when they try and change the resolution it doesn't always look that good on a LCD display.

    They also often require the CD to be in the CD-ROM drive. I find this particularly annoying. The installation should allow me to install everything from the drive onto the hard disk so you don't need to be swapping CD's.

    I'm trying to work around this by generating an ISO image of the CD using ISO Recorder, and then mounting and unmounting the image when you want to run the game.

    I found FileDisk - a Windows driver and command-line tool to mount and unmount ISO files. I then created a small batch file that I thought should do the job:

    `

    @echo off

    REM mount cd "C:\bin\filedisk.exe" /mount 1 "c:\Install\ISO\ArthurWildernessRescue.iso" /cd e:

    cd "C:\Program Files\The Learning Company\Arthur's Wilderness Rescue\Launcher"

    REM run "C:\Program Files\The Learning Company\Arthur's Wilderness Rescue\Launcher\TLCLauncher.exe"

    `

    REM unmount "C:\bin\filedisk.exe" /umount e:

    I then tried this out with one of the non-admin logins, but sadly it fails with an "access denied" error. It appears that filedisk is using one of the Win32 API calls assuming the current user is an Administrator too.

    Filedisk does include source code, so it might be possible to fix this, but I'm guessing it might take a bit of time to figure it out.

    Taking "Arthur's Wilderness Rescue" as an example, I looked closer at what files it had left on the CD, and it didn't appear to be many at all!

    I located a file "salstartup.xml" and noticed that it was pointing to a file on the CD, so I copied this file onto the hard disk and updated the XML file and it appears that it all works now without the CD being in the drive.

  • DisplayFusion

    If you like the multi-monitor desktop wallpaper support provided by UltraMon but can't afford USD39.95, you could either write your own, or you could check out Binary Fortress Software's DisplayFusion.

    I trialled UltraMon for 30 days, and I really like the extended task bar that they provide too.

  • Marking deleted rows in a database table

    In one of our applications, there is a requirement that data not be permanently deleted (or at least not initially).

    The original way I implemented this was to add a DELETED bit column to each table, and if that column was set to 1 (true), then I would treat that row as if it didn't exist.

    This is achieved through ensuring access is via a View that excluded those rows, stored procedures, and also adding an INSTEAD OF DELETE trigger that intercepted regular DELETEs and converted them into UPDATEs to flip the column bit.

    That works pretty well, but I'm trying to weigh it up against the other approach I can think of, which is to have a separate table that only holds the deleted rows.

    eg. if the original table was FRED, then the other table could be named DELETED_FRED (just to be clear what it was for!).

    I'd guess you could still use a trigger to catch any deletes to table FRED, and use them to copy the deleted row over to DELETED_FRED.

    I suspect that the latter approach probably makes it easier to use some kind of ORM framework, as you don't have to be careful about avoiding the deleted rows.

    The advantage of the former though is that you maintain your referential integrity for all of your data. Because of the relationships of other tables besides FRED, I don't think I could do this with the DELETED_* tables.

    I'm curious as to what other pros and cons are of these approaches, and whether there is a formal name for this kind of thing?

    There are some resources I have found: