Hi all,
this isn’t really Juce specific but maybe someone can help.
I’m building an installer which also might wan’t to install something into /Library or /Applications. To do this I use the following code to obtain admin privileges :
AuthorizationRef authRef;
char rightName[] = "system.install.root.user";
AuthorizationItem kActionRight = { rightName, 0, 0, 0 };
AuthorizationRights rights = {1, &kActionRight};
AuthorizationFlags flags = kAuthorizationFlagExtendRights | kAuthorizationFlagInteractionAllowed;
OSStatus err = AuthorizationCreate(&rights, 0, flags, &authRef);
This works fine if the installing user is an admin. If run from a standard user it doesn’t work although no error is given (err == noErr). It does reques the user/pw from an admin account and won’t accept the standard users’ account. Installers made with PackageMaker request the same right but also do work when run from a standard user.
The installer is a web-based installer, so Packagemaker isn’t an option.
Does anyone know what I might do wrong or how this could be accomplished?
The installer should also work on 10.5.
Thanks for any help,
Chris