Re: Metapackage that can install depending on architecture
Re: Metapackage that can install depending on architecture
- Subject: Re: Metapackage that can install depending on architecture
- From: Ted Brown <email@hidden>
- Date: Wed, 26 Mar 2008 09:47:23 -0400
On Mar 25, 2008, at 8:19 PM, Andy Mroczkowski wrote:
If you are using the PackageMaker 3 GUI, this is fairly easy. You
can add Requirements for package choices (subpackages of a
metapackage). Requirements can check results of Gestalt directly,
which can be used to detect the current architecture. The
applicable Gestalt key is 'sysa' and the result codes for Intel and
PPC are 10 and 2 respectively.
To restrict the package to Intel only do the following:
- Select the Choice you want to set an architecture requirement for
- Click the 'Requirements' Tab
- Add a new Requirement with the '+' button
- Set the following values:
If: Result of Gestalt
value: sysa
is: == 10
Selected: NO
Enabled: NO
Then do the same for the PPC choice, replacing the 10 with 2.
There are probably other solutions, but this works for me. I would
suggest just using a Universal binary if it makes sense though.
---
Andy Mroczkowski
Mac Developer, NeatReceipts
On Mar 25, 2008, at 5:11 PM, Roy Marquez wrote:
Hi there:
I'm fairly new to using PackageMaker as I have used it to package
smaller applications and such, but haven't used it extensively.
I have a project and would appreciate any guidance that the more
experienced folks (you) can provide.
I have application "A". This application comes in two version: PPC
and Intel. I have built 2 separate packages. What I would ideally
like to build is a metapackage installer that can detect the
machine architecture type and install the correct package for the
architecture. But I have no clue as to where to start as to how to
get that working. From my reading, it looks like I will be needing
a script that would do this. But other than this, I have no clue
where to start looking for literature that documents this. This
would be the only need I have as far as this is concerned.
Any pointers are appreciated.
Cheers
Roy
Some people re-package other companies installers so that they can
easily deploy them. Making a universal binary isn't an option. One
would think Adobe would be able to figure out how to make a universal
binary. But there are still separate installers for the Flash Player
(even though one is called "UB".)
I'm using sysctl 'hw.cputype'. Intel = '7' and PPC = '18'. I think I
settled on using sysctl as I'm a unix geek, and it's something that I
can implement from the command line using tools that I'd already used
(sysctl).
Follow the above step, only use "Result of Sysctl". Use "hw.cputye"
as the value.
I really like how the values differ from the Gestalt call.
I call PackageMaker from the command line, and I generate my own
distribution.dist file. Having done that, It's much easier to do this
from the GUI. If someone cares, I can post an example
distribution.dist CPU detection example, but it's easy to have
Packagemaker make you one and read what it generates.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden