Menu

NwnUpdater Project Definition

Jim Dovey
2003-11-24
2003-12-23
  • Jim Dovey

    Jim Dovey - 2003-11-24

    Well, the day of the unveiling of the 'NWN Auto-updater and SoU Installer' of legend has at last come to pass, and so it falls to muggins 'ere to put down in words exactly What It Is...

    Project/Module name: NwnUpdater
    Current Revision: 0.9
    Operating System: Mac OS X/Cocoa
    Development System: ***XCode Native***
    Principal Author: Me (Quatermain)
    Purpose: To provide a simple UI which will enable users to automatically download/apply updates to their NWN installations on a Mac. It will also install/update SoU, from the linux resources on the released CD.

    Details:
    NwnUpdater has two main functions. The first one (in its initial incarnation) is to enable users to painlessly install SoU from their PC CD. This works, and has done since the weekend after NWN Mac hit the shops :o)
    Its second function - the main one as far as the title is concerned - is to work out which version of NWN you have installed, work out if you've installed SoU, and then go to the Bioware FTP servers to see if there are any updates to a later version available. upon finding any updates, it will automatically download and install the latest one it finds, for both the Mac product, and the SoU expansion pack.

    This latter part is what takes up most of the code. The software has an FTP client built in, abd this handles all the work of talking to Bioware's servers. When told to update, the application will work out what revision of NWN you currently have installed - see (1) below - and will go and look via FTP for a newer version. If it finds a newer version, it will download the appropriate update file (ie, 130to132, 131to132, etc) to a temporary folder, install it - see (2) below - and remove the temporary file. If you have SoU installed, it will also look for updates for that at the same time, thus keeping version parity between your Mac-based NWN install and your SoU game resources.
    When installing SoU for the first time, it will also check which revision of the NWN software you have installed. If you have a version later than 1.30, it will download and apply the latest SoU update automatically - BUT see (3) below.
    It technically allows you to uninstall SoU, but there seems to be a problem there somewhere (in that it doesn't actually appear to do anything) - however, since I've seen more people complaining about not bing able to *install* SoU than *uninstall* it, I'm leaving that for a later release (v1.0).

    There are various preferences that are used by the application. First of all, it remembers where you installed NWN - you tell it the first time you load the application.
    Secondly, you can override its default download behaviour, by telling it to use a specific 'persistent' folder for storing downloaded updates. If this is set, the application will download updates to that folder, and will NOT remove them when it's done installing their contents. It will also (for free) check this folder BEFORE going online, to see if there are any updates already (manually) downloaded - NB see (4) below.
    A second option tied to the persistent folder is the option to not go online at all - then it will ONLY look in the specified folder. This is probably good for people on dialup connections who don't want the app running up their phone bill or interrupting their girlfriend's phone conversation...
    The final option, not tied to the prior two, allows the user to specify that the software should NOT back up any files it would replace during an update operation - note that installing SoU will *always* back up the only replaced file, dialog.tlk, as dialog_vanilla.tlk. The default is to back up these files into a new folder off the root NWN folder. By deselecting the 'backup' preference option, the software will just delete any existing files before writing a new version. This will help conserve disk space.

    Notes & caveats:

    (1) Detecting the installed NWN version
    Bioware didn't put the version number into the NWN app's info.plist until version 1.32. Therefore, I have adopted the following policy: If there's no version (or rather, if version < 1.3) I take an MD5 checksum of the NWN application binary (in Contents/MacOS), and compare it against my own precomputed checksum of the 1.31 binary. If they match, the user is running 1.31, if they don't, I assume they're running 1.30.

    (2) Archive expansion/installation
    I support three archive types - Stuffit, Zip, and Tarred Gzips. The last of these also support Tar files which aren't gzipped (since Safari will automatically decompress the tarfile, leaving <filename>.tar). Zip and Tar/Gzip are handled internally, using some code from BSD zlib-contrib for zip files, the tar header from BSD pax (for the structure declarations, all the tar handling code is my own), and gzopen(), gzread(), etc from zlib. zlib is installed by default on Jaguar, so I don't expect it will cause any problems. Stuffit, however, is a different story: the Stuffit Engine (which is installed by default on OS X) is nicely programmable by anyone with a copy of Stuffit Deluxe - *if* they pass their license code as a const char * into OpenStuffitEngine(). This isn't really acceptable to me or to Aladdin (they don't want a valid SDK license code distributed all about, after all), so I have to use an AppleScript to decompress any Stuffit files. This means that .sit files will be completely decompressed to a temporary folder on disk before being 'installed', which can result in a large chunk of the disk being used - the 1.30 to 1.32 update expands to a almost 169Mb... This *is* removed after installation, however.

    (3) Updating SoU when installing
    There is one caveat to the auto-updating of SoU if you install SoU onto an already-updated NWN app. This is that the update code only deals with finding the *latest* updates, and therefore this auto-update will download the *latest* SoU update. This normally won't be a problem, unless someone has NWN 1.31 installed, and the installer download SoU 1.32. This could cause problems, so the user should update their NWN install before installing SoU, unless they've got a clean 1.30 install of NWN.

    (4) Getting updates from local folder
    If the application finds a newer update in the local folder, it'll install it. It will not go online at all. It won't check if there's a still newer update online before installing, and it won't go online after installing the one it found locally. If you want it to go online as a double-check, you'll have to click 'update' again once this update has finished.

    There is a reasonable amount of information in the online help for the application, including a full (I think) list of known issues, bugs, and 'features' (as in "that's not a bug, it's a feature").

    All the source code is up on the SF CVS server (module 'NwnUpdater'), and I'll be doing a file release just as soon as I find out how.

    Enjoy :o)
    -Q

     
    • Anonymous

      Anonymous - 2003-12-23

      I have A problem with the NWNUdater being OS X only.  You see, I'm handicapped and use a special keybaord that will not function in OS X,  I can use a trackball to navigate, it is cumbersome and time consumung. 
      Please make a OS 9.2.2 VERSION.  I've installed SoU by dragging and dropping ( with the mousekeys on my special keybaord ) the files in OS 9.2.2. 

       
      • Rick Shafer

        Rick Shafer - 2003-12-23

        I'll answer for Quatermain...
        NWNUpdater uses Cocoa (not Carbon) technology, and is hency OS X only.  (Even if we moved it to the OpenStep technology someday it would still not be able to run on OS 9 so far as I know.)  So this, alas, is unlikely to happen.  Since NWN/Mac is an OS X app the thinking is generally this should be enough.

        What *might* be possible is that Q might think about UI changes in NWNU, if you could explain what about the current interface that is unfriendly for "trackball" execution/navigation.

        Of course, even better for you, would be for your special keyboard to become OS X compatable.  But I suppose you've already taken that up with the manufacturer/Apple.

        Sorry this is not more helpful.

         

Log in to post a comment.