Opened 16 years ago

Closed 15 years ago

#13141 closed enhancement (fixed)

Installer packages should prevent installation on wrong Mac OS X version

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: blb@…
Priority: Normal Milestone: MacPorts 1.7.1
Component: base Version: 1.5.0
Keywords: Cc: ryandesign (Ryan Carsten Schmidt)
Port:

Description

If I am on Mac OS X 10.4 but I (mistakenly) install the MacPorts 1.5.0 disk image designed for Mac OS X 10.5, then I get this error when trying to use the port command:

$ port
Library not loaded: /usr/lib/libcurl.4.dylib
  Referenced from: /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib
  Reason: image not found
    while executing
"load /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib"
    ("package ifneeded" script)
    invoked from within
"package_native require Pextlib 1.0"
    ("eval" body line 1)
    invoked from within
"eval package_native $args"
    (procedure "package" line 14)
    invoked from within
"package require Pextlib 1.0"
    (procedure "mportinit" line 365)
    invoked from within
"mportinit ui_options global_options global_variations"
Error: /opt/local/bin/port: Failed to initialize ports system, Library not loaded: /usr/lib/libcurl.4.dylib
  Referenced from: /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib
  Reason: image not found
$

The installer package on each of the disk images (10.3, 10.4, 10.5) should be changed so that it only permits installation if the OS in question is of the correct version.

Change History (9)

comment:1 Changed 16 years ago by afb@…

This was also mentioned in #12779 (document only, without tweaking the generated installer)

comment:2 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

comment:3 Changed 16 years ago by jmpp@…

For packages created on Panther & Tiger we could mimmic the *.pkg/Contents/Resources/VolumeCheck script that some Apple provided packages have to check system compatibility, but I wouldn't know how to do it in Leopard with what seems to be the new flat package format, by which pkg's are no longer directories with a bunch of files in them but rather just "data". Ideas?

-jmpp

comment:4 Changed 16 years ago by boeyms@…

We could try parsing the output from system_profiler(8) (I'd suggest system_profiler -detailLevel mini SPSoftwareDataType). I discovered this yesterday while looking into something else.

comment:5 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Surely you just want sw_vers -productVersion. But I don't think the problem is "How do I determine the current OS version?" I think the problem is "How do I instruct the Installer to run this custom script before allowing my package to be installed?" I didn't know Leopard changed the way to do this, but I don't think it matters. Surely Leopard must still be able to read older package formats. So we can continue to use the older package format that we understand, with the VolumeCheck script or whatever.

comment:6 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Milestone: MacPorts base enhancementsMacPorts 1.7.0

comment:7 Changed 15 years ago by blb@…

Milestone: MacPorts 1.7.0MacPorts 1.7.1

comment:8 Changed 15 years ago by blb@…

Owner: changed from macports-tickets@… to blb@…
Status: newassigned

comment:9 Changed 15 years ago by blb@…

Resolution: fixed
Status: assignedclosed

InstallationCheck script added in r43954 (trunk) and r43956 (1.7 branch) and what will be needed in the MacPorts port (commented-out) in r43955.

InstallationCheck works fine on 10.3-10.5, but does present the warning sheet about the package needing to run a script to check for requirements. 10.4 packages introduce a distribution file which can be used to do the same thing, but these are more lengthy (usually use PackageMaker to generate them) and are in JavaScript. Hence, for simplicity I went with the InstallationCheck script.

Note: See TracTickets for help on using tickets.