Re: PackageMaker Requirement
Re: PackageMaker Requirement
- Subject: Re: PackageMaker Requirement
- From: Stéphane Sudre <email@hidden>
- Date: Sun, 31 Aug 2008 16:54:11 +0200
On Aug 30, 2008, at 11:44 PM, Steven J. Vogt wrote:
Greetings!
I am currently trying to distribute a package that adds printers to
student computers. So far I have it accommodating for Tiger and
Leopard differences in where the PPD's live. This is in one
installer and it's is working great. What I'm trying to do now is
check if a certain PPD file exists and if it doesn't I want to not
allow the installer to run.
I looked at setting a requirement for the package "If file exists"
I could then specify the file.
What I really need to do is check if one or the other file exists.
(PPD on Tiger or PPD on Leopard). I can't figure out a way to
check multiple files and continue if one or the other is found.
Any ideas would be greatly appreciated. I know I could split the
package into to, but I'm hoping to be able to keep in one package.
If you're targeting Tiger or Leopard, I would assume you're using a
distribution script.
If this is really the case, there is nothing preventing you from
writing your own javascript function for the requirements.
/* This version will check only the system volume */
function myRequirementFunction()
{
var tResult = false;
try
{
tResult = system.files.fileExistsAtPath('/The/Path/To/My/File') ==
true ||
system.files.fileExistsAtPath('/The/Path/To/My/File') == true;
}
catch (tException)
{
}
return tResult;
}
AFAIK, it could be improved with something like this since you're
saying the PPD is not at the same location depending on the OS version.
/* This version will check the different volumes */
function myRequirementFunction()
{
var tResult = false;
try
{
var tMountPoint;
tMountPoint=my.target.mountpoint;
/* If the path has again changed in Snow Leopard, you would need to
add another test */
if (my.target.systemVersion.ProductVersion >= '10.5.0')
{
tResult = system.files.fileExistsAtPath(tMountPoint + "/The/Path/
To/My/File/For/Leopard");
}
else if (my.target.systemVersion.ProductVersion >= '10.4.0')
{
tResult = system.files.fileExistsAtPath(tMountPoint + "/The/Path/
To/My/File/For/Tiger");
}
}
catch (tException)
{
}
return tResult;
}
This has been typed in Apple Mail and I'm not a Javascript expert so
this may not work.
--
STephane
_______________________________________________
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