 |
 |
Fun with packages
|
 |
|
 |
|
Ambrosia - el Presidente
Join Date: Sep 2000
Location: Rochester, NY
Status:
Offline
|
|
I'm working on an Installer.app package (yes, I've read the various warnings and caveats, and have followed the file ownership/permission guidelines). What I want to install consists of an application (which will install into /Applications) and a kernel extension (which will install into /System/Library/Extensions).
The application can be installed by any user, but the kext needs root permission to install. In order to avoid ownership/permissions issues, I've created a separate installer package for the application and kernel extension.
Both of these packages work fine separately, but to make things easy for the user, I want to have just one installer package, or meta package. If I put both the "normal" and the "needs root" packages together in this one meta package, the resulting install all seems to take place as root.
The problem with this is that the ownership/permissions of application are not set to the current user, but rather because the installer has authenticated, the ownership/permissions of the application on my machine are preserved during the install.
Since each package works properly when installed separately (the kext is authenticated and installed as root, the application is installed as the current user), I can only assume that the installer looks at all of the packages in the meta package, and installs them all as root, thus preserving the ownership/permissions of the application.
This is what I *don't* want -- I want the 'kext' to have the ownership/permissions I set for it (root/wheel), but I want the application to be installed as whomever the current user is.
Is there any way to do this?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
How about a postinstall script in the application package, which changes the ownership of the application to the current user? id -ru might do what you want, and
Code:
ps -axOuser | grep Installer | perl -e '$_=<STDIN>;s/ [0-9]* ([^ ]+) .*/\1/;print "$_";'
almost certainly will - it'll give you the username of the person who ran Installer.app, and from there you can use chmod -R.
|
|
[vash:~] banana% killall killall
Terminated
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
Why not just let the user drag-install the app, and use a package only for the kext?
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Uhm... Why don't you just install the application as root:staff with g+w?
|
|
|
| |
|
|
|
 |
|
 |
|
Ambrosia - el Presidente
Join Date: Sep 2000
Location: Rochester, NY
Status:
Offline
|
|
In the end, I wrote a post-install script that grabbed the current user, and chown'd the installed application (using a Perl script and $ENV{'USER'} ).
Seems like this would be a fairly common thing to do, I don't know why it requires such work to accomplish it. Ah well.
As for the other ideas presented here:
Uhm... Why don't you just install the application as root:staff with g+w?
Because it is possible the user will not be in the 'staff' group.
Why not just let the user drag-install the app, and use a package only for the kext?
Because if we're going to have an installer anyway, it seems silly to make the user jump through more hoops to get everything installed. Many people probably would also mess up the installation, either by:
1) Using only the installer, thinking it installed everything for them.
2) Only dragging the application out, and not running the installer at all.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|