Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Installer defers to existing copies of apps

#8

If the installer finds a copy of an MWorks application (e.g. MWClient.app) already installed on the system, it will defer to that copy and not install a new one (even if the copy is located somewhere other than /Applications). This will happen as long as the already-installed app has the same CFBundleIdentifier as the new one (e.g. org.mworks-project.MWClient).

I believe this happens because, currently, none of the MWorks applications specify CFBundleVersion, meaning the installer can't tell that the new version is actually newer than the existing one. Keeping CFBundleVersion up to date can be a little tricky, though. For details of one way to do it, see Xcode: Build numbers and versioning with agvtool.

Reported by Christopher Stawarz · April 20th, 2010 @ 04:54 PM

State: resolved
Milestone: 0.4.4
Assigned to: Christopher Stawarz Christopher Stawarz

Activity

  1. Christopher Stawarz
  2. Christopher Stawarz
    Christopher Stawarz
    • Assigned user set to Christopher Stawarz

    May 11th, 2010 @ 03:20 PM

  3. David Cox
    David Cox

    I think that this is a property of your new installer, not the "standard" one. The regular one has been happily installing over old installs for years. Just tested installing an old version over top of a new one on my system, and it works as expected. Unless I'm not understanding what the symptom is.

    May 11th, 2010 @ 03:50 PM

  4. Christopher Stawarz
    Christopher Stawarz

    If I run the MWorks installer, drag MWServer.app from /Applications to my desktop, and then run the installer again, I see the following in /var/log/install.log:

    Applications/MWServer.app relocated to Users/cstawarz/Desktop/MWServer.app
    PackageKit: Registered bundle file://localhost/Users/cstawarz/Desktop/MWServer.app/
    

    I just tried this with both my installer and yours and got the same result.

    However, I was partly wrong in my initial report, as it turns out that the installer does in fact overwrite the contents of Desktop/MWServer.app with the new files. Maybe it's trying to respect the user's decision to move the app bundle to a non-standard location?

    Here's the problem I see: If a user archives their current installation of MWorks, say by moving the apps and frameworks to ~/Documents/Old MWorks, before installing a new version, the installer will overwrite the backed-up apps with the new ones, thereby both destroying the backup and confusing the user by not installing the new apps in /Applications. Unfortunately, I'm no longer sure that changing CFBundleVersion will solve the problem.

    May 11th, 2010 @ 05:00 PM

  5. David Cox
    David Cox

    Maybe we could just zip the archive?

    May 11th, 2010 @ 06:08 PM

  6. David Cox
    David Cox

    Actually, what if you copy instead of move? I've seen OS X watch the filesystem node instead of the file path in other contexts. If you copy, it will create a new node, so it is possible at this could help.

    May 11th, 2010 @ 06:12 PM

  7. Christopher Stawarz
    Christopher Stawarz

    Zipping the archive is probably the most robust solution. But I'll try copying, too, just to see what happens.

    May 12th, 2010 @ 11:25 AM

  8. Christopher Stawarz
    Christopher Stawarz
    • Milestone cleared.
    • State changed from new to invalid

    I've now tried copying the application instead of moving it, as well as incrementing CFBundleVersion between installations. In both cases, the installer still overwrites the existing copy of the app (in this case, ~/Desktop/MWServer.app).

    Since the installer does actually install the new version, I'm going to mark this ticket invalid. However, I'll add a note to this ticket about zipping the archive.

    May 13th, 2010 @ 01:39 PM

  9. Christopher Stawarz
    Christopher Stawarz

    It looks like you can prevent this behavior by passing the option --no-relocate to PackageMaker. I've added this to new_installer/build_installer, and the generated installer now ignores the existing MWServer and installs the new one in /Applications. Nice!

    May 20th, 2010 @ 06:45 PM

  10. Christopher Stawarz
    Christopher Stawarz
    • State changed from invalid to resolved
    • Milestone set to 0.4.4
    • Milestone order changed from 0 to 0

    April 17th, 2012 @ 01:50 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.