• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Requirements Dysfunctional
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Requirements Dysfunctional


  • Subject: Re: Requirements Dysfunctional
  • From: Stéphane Sudre <email@hidden>
  • Date: Thu, 13 Mar 2008 00:39:26 +0100


On Mar 12, 2008, at 7:37 PM, Jim Hoyt wrote:

Yo,

Using PackageMaker 3.01 with Leopard.

In Package Requirements set up a requirement as such:

File Exists on Target: /Applications/foldername/application_name

Required, false, is equal to true, ( i also tried true, is equal to true)

I was hoping the installer would give me a warning that the folder/ file already existed, and do I want to overwrite it.

It just went ahead and overwrote the folder/file without any interruption.

How can I set this up to not overwrite. I thought that was the purpose of the Requirements setup...I am obviously missing something...

any help deeply appreciated.

As far as I can tell (*), it's a bug in PackageMaker 3.

I tried to reproduce it with PM 3.0.1 by checking (in the Project requirements) for the existence of /Applications/Utilities/Disk Utility.app and your parameters.


The script I got when I build the package (10.5 flat format) is the following one (**):


<script>
function pm_volume_check()
{
if(!(system.files.fileExistsAtPath(my.target.mountpoint + '/ Applications/Utilities/Disk Utility.app') == true))
{
my.result.title = 'Failure';
my.result.message = 'Error';
my.result.type = 'Fatal';


			return false;
  		}

		return true;
	}
</script>

Which basically states (unless I'm drunk at the time of this writing):

	if the file does not exist then fail

	if the file exists then succeed


Basically, it's a double negation issue.

The script should look like this:

<script>
function pm_volume_check()
{
if (system.files.fileExistsAtPath(my.target.mountpoint + '/ Applications/Utilities/Disk Utility.app') == true)
{
my.result.title = 'Failure';
my.result.message = 'Error';
my.result.type = 'Fatal';


			return false;
  		}

		return true;
	}
</script>

I filed a bug report against it (Bug ID #5796305). So if I'm writing under influence, I will be the culprit.


(*) Don't trust me, I'm suffering from the did-I-really-close-the- door syndrom on this one.


(**) It's not exactly this script because I reformatted the output for it to be more readable.

_______________________________________________
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


References: 
 >Requirements Dysfunctional (From: Jim Hoyt <email@hidden>)

  • Prev by Date: Requirements Dysfunctional
  • Next by Date: Requirement Check For Initial State
  • Previous by thread: Requirements Dysfunctional
  • Next by thread: Requirement Check For Initial State
  • Index(es):
    • Date
    • Thread