Re: PackageMaker Requirements always returning true
Re: PackageMaker Requirements always returning true
- Subject: Re: PackageMaker Requirements always returning true
- From: Iceberg-Dev <email@hidden>
- Date: Mon, 26 Jul 2010 23:10:25 +0200
On Jul 26, 2010, at 9:55 PM, Kari McNair wrote:
I want my package to run only if a certain file does NOT exist. If
the file does exist, I'd like the installer to fail and show a
message. I've trying to use PackageMaker's requirements tab but
when I try to run the package on a system that I know meets the
requirements, it fails. Can anyone lend some wisdom?? Here are the
lines from the distribution.dist that PackageMaker created.
<?xml version="1.0" encoding="utf-8"?>
<installer-script minSpecVersion="1.000000"
authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.4"
authoringToolBuild="179">
<title>Lingraphica 7.0 Upgrade</title>
<options customize="never" allow-external-scripts="no"
rootVolumeOnly="true"/>
<installation-check script="pm_install_check();"/>
<script>function pm_install_check() {
if(!(system.files.fileExistsAtPath('/Users/client/PreviousJune10/
Startup.lca') == true)) {
my.result.title = 'You have already installed this upgrade.';
my.result.message = 'It looks like you have already attempted
to install this upgrade. Please call Technical Support at
888-123-4567.';
my.result.type = 'Fatal';
return false;
}
return true;
}
</script>
<background file="background" alignment="topleft" scaling="none"/>
<choices-outline>
<line choice="choice6"/>
<line choice="choice7"/>
<line choice="choice8"/>
</choices-outline>
<choice id="choice6" title="Version 7.0">
<pkg-ref id="com.Company.version70upgrade.client.pkg"/>
</choice>
<choice id="choice7" title="C2C Network">
<pkg-ref id="com.Company.version70upgrade.c2cnet.pkg"/>
</choice>
<pkg-ref id="com.Company.version70upgrade.client.pkg"
installKBytes="3087504" version="1.0" auth="Root"
onConclusion="RequireRestart">file:./Contents/Packages/client.pkg</
pkg-ref>
<pkg-ref id="com.Company.version70upgrade.c2cnet.pkg"
installKBytes="60" version="1.0" auth="Root">file:./Contents/
Packages/c2cnet.pkg</pkg-ref>
</installer-script>
If the file does not exist:
system.files.fileExistsAtPath('/Users/client/PreviousJune10/
Startup.lca')
returns false.
(system.files.fileExistsAtPath('/Users/client/PreviousJune10/
Startup.lca') == true)
returns false
(!(system.files.fileExistsAtPath('/Users/client/PreviousJune10/
Startup.lca') == true))
returns true
=> pm_install_check returns false and my.result.type is set to 'Fatal'.
The installation is stopped.
------
If the files exists:
system.files.fileExistsAtPath('/Users/client/PreviousJune10/
Startup.lca')
returns true.
(system.files.fileExistsAtPath('/Users/client/PreviousJune10/
Startup.lca') == true)
returns true
(!(system.files.fileExistsAtPath('/Users/client/PreviousJune10/
Startup.lca') == true))
returns false
=> pm_install_check returns true.
The installation can be performed.
_______________________________________________
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