site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com On Aug 30, 2008, at 11:44 PM, Steven J. Vogt wrote: Greetings! /* This version will check only the system volume */ function myRequirementFunction() { var tResult = false; return tResult; } /* This version will check the different volumes */ function myRequirementFunction() { var tResult = false; try { var tMountPoint; tMountPoint=my.target.mountpoint; return tResult; } -- STephane _______________________________________________ Do not post admin requests to the list. They will be ignored. Installer-dev mailing list (Installer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/installer-dev/site_archiver%40lists.a... 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. try { tResult = system.files.fileExistsAtPath('/The/Path/To/My/File') == true || system.files.fileExistsAtPath('/The/Path/To/My/File') == true; } catch (tException) { } 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. /* 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) { } This has been typed in Apple Mail and I'm not a Javascript expert so this may not work. This email sent to site_archiver@lists.apple.com
participants (1)
-
Stéphane Sudre