Hi Stephane, Thanks for explanation. But if i include only memory requirement, it does not create any dist file. When I add Disk space requirement and include a preflight script along with the package it fails while installing. If I do not include the script it works fine or vice versa, If i include script and removed disk space requirement it works. I think it's something to do with the dist file. I have pasted just a line from the dist file, I tried changing it though. But i guess you might help me out . options customize="never" allow-external-scripts="no" ( Script fails because of this ? ) Do i need to allow external scripts to run?
rootVolumeOnly="true"/> <installation-check script="pm_install_check();"/> <volume-check script="pm_volume_check();"/>
Thanks, Vishnu On Wed, Jun 27, 2012 at 12:30 AM, <installer-dev-request@lists.apple.com> wrote:
Send Installer-dev mailing list submissions to installer-dev@lists.apple.com
To subscribe or unsubscribe via the World Wide Web, visit https://lists.apple.com/mailman/listinfo/installer-dev or, via email, send a message with subject or body 'help' to installer-dev-request@lists.apple.com
You can reach the person managing the list at installer-dev-owner@lists.apple.com
When replying, please edit your Subject line so it is more specific than "Re: Contents of Installer-dev digest..."
Today's Topics:
1. Getting Installation failure error while using Script along with custom requirements. (vishnu kulkarni) 2. Getting Installation failure error while using Script along with custom requirements. (vishnu kulkarni) 3. Re: Getting Installation failure error while using Script along with custom requirements. (Stephane Sudre) 4. Re: Getting Installation failure error while using Script along with custom requirements. (Don Montalvo)
----------------------------------------------------------------------
Message: 1 Date: Tue, 26 Jun 2012 17:07:30 +0530 From: vishnu kulkarni <vishnu5876@gmail.com> To: installer-dev@lists.apple.com Subject: Getting Installation failure error while using Script along with custom requirements. Message-ID: <CAL-pCuVAmGj1afKcrvve-nDA=Rd3dA3Q9HRFa0GucijQgCcH9w@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1
Hi All,
I'm trying to package firefox app with preflight script to kill the app and trash the app before installing a fresh copy. The script works pretty fine with the package. When I try to add system requirements to the package it gets failed.
I'm pretty new to packaging . Below are my queries. Please address
1) When I include minimum available hard disk bytes on target , It creates a Distribution.dist file inside the package. ( Not sure of the reason.) 2) When I include memory requirement and include the preflight script it works fine. ( For memory it does not create a .dist file)
I have pasted the details of the .dist file below.
<?xml version="1.0" encoding="utf-8" standalone="no"?> <installer-script minSpecVersion="1.000000" authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.4" authoringToolBuild="179"> <title>Firefox</title> <options customize="never" allow-external-scripts="no" rootVolumeOnly="true"/> <installation-check script="pm_install_check();"/> <volume-check script="pm_volume_check();"/> <script>function pm_volume_check() { if(!(my.target.availableKilobytes >= 200 * 1024 * 1024)) { my.result.title = 'Failure'; my.result.message = 'Installation cannot proceed, as not all requirements were met.'; my.result.type = 'Fatal'; return false; } return true; }
function pm_install_check() { if(!(system.sysctl('hw.memsize') >= 512*1024*1024*1024)) { my.result.title = 'Memory Available'; my.result.message = 'Installation cannot proceed, as not all requirements were met.'; my.result.type = 'Fatal'; return false; } return true; } </script> <choices-outline> <line choice="choice3"/> </choices-outline> <choice id="choice3" title="Firefox"> <pkg-ref id="com.wb.firefox.Firefox.pkg"/> </choice> <pkg-ref id="com.wb.firefox.Firefox.pkg" installKBytes="75808" version="1.0" auth="Root">file:./Contents/Packages/firefox.pkg</pkg-ref> <pkg-ref id="com.wb.firefox.Firefox.pkg"> <relocate search-id="pkmktoken81"> <bundle id="org.mozilla.firefox"/> </relocate> </pkg-ref> <locator> <search id="pkmktoken81-1" type="component"> <bundle CFBundleIdentifier="org.mozilla.firefox" path="/Applications/Firefox.app"/> </search> <search id="pkmktoken81-0" type="script" script="pkmktoken81_combined()"> <script> function pkmktoken81_combined() { function pkmk_add_results_to_array(results, array) { for(i = 0; i < results.length; i++) array.push(results[i]); } var result = new Array(); var search; search = my.search.results['pkmktoken81-1']; if(search) pkmk_add_results_to_array(search, result); return result; } </script> </search> <search type="script" id="pkmktoken81" script="pkmktoken81_final()"> <script> function pkmktoken81_final() { var combined = my.search.results['pkmktoken81-0']; return combined; } </script> </search> </locator> </installer-script>
Please do let me know where I'm going wrong. I tried to modify the .dist fie but to no avail.
Thanks,
Vishnu
------------------------------
Message: 2 Date: Tue, 26 Jun 2012 18:31:04 +0530 From: vishnu kulkarni <vishnu5876@gmail.com> To: installer-dev@lists.apple.com Subject: Getting Installation failure error while using Script along with custom requirements. Message-ID: <CAL-pCuVvdyNgiSy+8CAc3j0LHr7NYZB0=f3tTWP30NvUNVjcyQ@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1
Hi All,
I'm trying to package firefox app with preflight script to kill the app and trash the app before installing a fresh copy. The script works pretty fine with the package. When I try to add system requirements to the package it gets failed.
I'm pretty new to packaging . Below are my queries. Please address
1) When I include minimum available hard disk bytes on target , It creates a Distribution.dist file inside the package. ( Not sure of the reason.) 2) When I include memory requirement and include the preflight script it works fine. ( For memory it does not create a .dist file)
I have pasted the details of the .dist file below.
<?xml version="1.0" encoding="utf-8" standalone="no"?> <installer-script minSpecVersion="1.000000" authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.4" authoringToolBuild="179"> <title>Firefox</title> <options customize="never" allow-external-scripts="no" rootVolumeOnly="true"/> <installation-check script="pm_install_check();"/> <volume-check script="pm_volume_check();"/> <script>function pm_volume_check() { if(!(my.target.availableKilobytes >= 200 * 1024 * 1024)) { my.result.title = 'Failure'; my.result.message = 'Installation cannot proceed, as not all requirements were met.'; my.result.type = 'Fatal'; return false; } return true; }
function pm_install_check() { if(!(system.sysctl('hw.memsize') >= 512*1024*1024*1024)) { my.result.title = 'Memory Available'; my.result.message = 'Installation cannot proceed, as not all requirements were met.'; my.result.type = 'Fatal'; return false; } return true; } </script> <choices-outline> <line choice="choice3"/> </choices-outline> <choice id="choice3" title="Firefox"> <pkg-ref id="com.wb.firefox.Firefox.pkg"/> </choice> <pkg-ref id="com.wb.firefox.Firefox.pkg" installKBytes="75808" version="1.0" auth="Root">file:./Contents/Packages/firefox.pkg</pkg-ref> <pkg-ref id="com.wb.firefox.Firefox.pkg"> <relocate search-id="pkmktoken81"> <bundle id="org.mozilla.firefox"/> </relocate> </pkg-ref> <locator> <search id="pkmktoken81-1" type="component"> <bundle CFBundleIdentifier="org.mozilla.firefox" path="/Applications/Firefox.app"/> </search> <search id="pkmktoken81-0" type="script" script="pkmktoken81_combined()"> <script> function pkmktoken81_combined() { function pkmk_add_results_to_array(results, array) { for(i = 0; i < results.length; i++) array.push(results[i]); } var result = new Array(); var search; search = my.search.results['pkmktoken81-1']; if(search) pkmk_add_results_to_array(search, result); return result; } </script> </search> <search type="script" id="pkmktoken81" script="pkmktoken81_final()"> <script> function pkmktoken81_final() { var combined = my.search.results['pkmktoken81-0']; return combined; } </script> </search> </locator> </installer-script>
Please do let me know where I'm going wrong. I tried to modify the .dist fie but to no avail.
Thanks,
Vishnu
-- vishnu
------------------------------
Message: 3 Date: Tue, 26 Jun 2012 15:42:47 +0200 From: Stephane Sudre <dev.iceberg@gmail.com> To: installer-dev@lists.apple.com Subject: Re: Getting Installation failure error while using Script along with custom requirements. Message-ID: <CAMKfz2BSYgtw=4_jNfsXGnkiWHE7RVBxE-SZKoPm+pwF=uC21Q@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1
On Tue, Jun 26, 2012 at 1:37 PM, vishnu kulkarni <vishnu5876@gmail.com> wrote:
Hi All,
I'm trying to package firefox app with preflight script to kill the app and trash the app before installing a fresh copy. The script works pretty fine with the package. When I try to add system requirements to the package it gets failed.
I'm pretty new to packaging . Below are my queries. Please address
1) When I include minimum available hard disk bytes on target , It creates a Distribution.dist file inside the package. ( Not sure of the reason.)
Because requirements can be defined only from within a distribution.
2) When I include memory requirement and include the preflight script it works fine. ( For memory it does not create a .dist file)
For memory, it should create a .dist file too to write the pm_install_check function.
I have pasted the details of the .dist file below.
<?xml version="1.0" encoding="utf-8" standalone="no"?> <installer-script minSpecVersion="1.000000" authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.4" authoringToolBuild="179"> <title>Firefox</title> <options customize="never" allow-external-scripts="no" rootVolumeOnly="true"/> <installation-check script="pm_install_check();"/> <volume-check script="pm_volume_check();"/> <script>function pm_volume_check() { if(!(my.target.availableKilobytes >= 200 * 1024 * 1024)) {
Just for the record, don't worry about this part. It does not require 200GB. It's just a known bug of this attributes (the value is actually in bytes).
my.result.title = 'Failure'; my.result.message = 'Installation cannot proceed, as not all requirements were met.'; my.result.type = 'Fatal'; return false; } return true; }
function pm_install_check() { if(!(system.sysctl('hw.memsize') >= 512*1024*1024*1024)) {
512GB of RAM seems a bit excessive as a requirement.
my.result.title = 'Memory Available'; my.result.message = 'Installation cannot proceed, as not all requirements were met.'; my.result.type = 'Fatal'; return false; } return true; } </script> <choices-outline> <line choice="choice3"/> </choices-outline> <choice id="choice3" title="Firefox"> <pkg-ref id="com.wb.firefox.Firefox.pkg"/> </choice> <pkg-ref id="com.wb.firefox.Firefox.pkg" installKBytes="75808" version="1.0" auth="Root">file:./Contents/Packages/firefox.pkg</pkg-ref> <pkg-ref id="com.wb.firefox.Firefox.pkg"> <relocate search-id="pkmktoken81"> <bundle id="org.mozilla.firefox"/> </relocate> </pkg-ref> <locator> <search id="pkmktoken81-1" type="component"> <bundle CFBundleIdentifier="org.mozilla.firefox" path="/Applications/Firefox.app"/> </search> <search id="pkmktoken81-0" type="script" script="pkmktoken81_combined()"> <script> function pkmktoken81_combined() { function pkmk_add_results_to_array(results, array) { for(i = 0; i < results.length; i++) array.push(results[i]); } var result = new Array(); var search; search = my.search.results['pkmktoken81-1']; if(search) pkmk_add_results_to_array(search, result); return result; } </script> </search> <search type="script" id="pkmktoken81" script="pkmktoken81_final()"> <script> function pkmktoken81_final() { var combined = my.search.results['pkmktoken81-0']; return combined; } </script> </search> </locator> </installer-script>
Please do let me know where I'm going wrong. I tried to modify the .dist fie but to no avail.
------------------------------
Message: 4 Date: Tue, 26 Jun 2012 10:48:04 -0500 From: Don Montalvo <donmontalvo@gmail.com> To: Sudre Stéphane <s.sudre@free.fr>, Kulkarni Vishnu <vishnu5876@hotmail.com> Cc: installer-dev@lists.apple.com Subject: Re: Getting Installation failure error while using Script along with custom requirements. Message-ID: <D94434FC-94F3-421C-979D-7E83F1B1F102@gmail.com> Content-Type: text/plain; charset=us-ascii
Stephane Sudre <email@hidden> wrote:
function pm_install_check() { if(!(system.sysctl('hw.memsize') >= 512*1024*1024*1024)) {
512GB of RAM seems a bit excessive as a requirement.
I think the folks at NASA might disagree. :)
Don
------------------------------
_______________________________________________ Installer-dev mailing list Installer-dev@lists.apple.com https://lists.apple.com/mailman/listinfo/installer-dev
End of Installer-dev Digest, Vol 94, Issue 29 *********************************************
-- vishnu _______________________________________________ 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: https://lists.apple.com/mailman/options/installer-dev/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com