Re: Getting Installation failure error while using Script along with custom requirements.
Re: Getting Installation failure error while using Script along with custom requirements.
- Subject: Re: Getting Installation failure error while using Script along with custom requirements.
- From: Stephane Sudre <email@hidden>
- Date: Tue, 26 Jun 2012 15:42:47 +0200
On Tue, Jun 26, 2012 at 1:37 PM, vishnu kulkarni <email@hidden> 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.
_______________________________________________
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