Install Parallels Desktop.pkg -- postupgrade script

Discussion in 'Parallels Desktop for Mac' started by MarkDouma, Mar 8, 2007.

  1. MarkDouma

    MarkDouma Bit poster

    Messages:
    1
    Just voicing a concern about the "postupgrade" shell script that's part of the "Install Parallels Desktop.pkg" installer package.

    If the install is an upgrade then the following script is run:

    I'm not sure why the last two commands are necessary.

    First of all, that command has nothing to do with "launchd". What it does is rebuild the Launch Services database, which holds document-to-application binding information. I'm not really sure why running that command is necessary.

    Okay, now that I ran the installation and upgraded from 3186.0 to 3188.0 with my modified version of that script which doesn't run those commands, I think I know why you were using it. Even though I upgraded Parallels, in the Finder, the Get Info window still shows 3186.0 instead of 3188.0. I checked the actual contents of the Parallels Desktop.app/Contents/Info.plist file and that indeed shows that the version has been updated to 3188.0.

    So, I'm assuming that you were using that command to force the changes to be recognized by Launch Services. Fortunately, there's a much easier and safer way of doing that than running lsregister: just "touch" the application bundle using the following command:

    As mentioned in Launch Services Concepts > Registering Applications, updating the modification date of an application will force the Finder and Launch Services to re-parse in the information and recognize any changes. I just ran touch in the Terminal, switched back to the Finder, and it now properly shows 3188.0.

    It would be nice if you could update the "postupgrade" script to simply touch the application bundle rather than use lsregister. A friend of mine who a few years back used an Apple Developer Connection Technical Support Incident ($200 a piece) to learn of that command was advised by the Apple engineer that the Finder shouldn't be running while that command is performed and that it's best if you restart afterwards (since there's no telling what other processes have cached the launch services database information). Also, killing the Finder rather than sending it a "quit" Apple Event is rather harsh, as it doesn't give it a chance to properly sync preferences and other unsaved changes to disk before terminating. That includes things like file (Spotlight) comments, which, for performance reasons, aren't always immediately written out to the .DS_Store file when added. In other words, killing the Finder can result in (admittedly a small amount of) data loss.

    Anyway, hope this helps, and thanks...
     
  2. luomat

    luomat Hunter

    Messages:
    100
    WOW that's a bad idea

    kill -9 should NEVER EVER EVER be used by a script author on purpose.

    This is a horribly stupid idea with no real purpose. I certainly hope that it wasn't just to update the version number! I'd prefer that they require a reboot -- at least that way people would get a warning.
     

Share This Page