<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Apple Packages</title>
	<atom:link href="http://peelman.us/tech/apple-packages/feed/" rel="self" type="application/rss+xml" />
	<link>http://peelman.us</link>
	<description>if frustration had mass, a blackhole would follow me everywhere...</description>
	<lastBuildDate>Wed, 11 May 2011 22:49:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Numero</title>
		<link>http://peelman.us/tech/apple-packages/comment-page-1/#comment-3047</link>
		<dc:creator>Numero</dc:creator>
		<pubDate>Wed, 11 May 2011 22:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.peelman.us/wordpress/#comment-3047</guid>
		<description>Isn&#039;t this all handled by the &quot;Package Version&quot; in PackageMaker?</description>
		<content:encoded><![CDATA[<p>Isn&#8217;t this all handled by the &#8220;Package Version&#8221; in PackageMaker?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blueruby</title>
		<link>http://peelman.us/tech/apple-packages/comment-page-1/#comment-3046</link>
		<dc:creator>Blueruby</dc:creator>
		<pubDate>Wed, 09 Mar 2011 12:55:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.peelman.us/wordpress/#comment-3046</guid>
		<description>Thanks Peelman for responding :)

My expertise in shellscript/perl can be ranged to Beginner! :( 
Hence, a detailed help would be very much appreciated. 

I&#039;ve written a script to compare versions of the installed and installing software(Package). Could you let me know where am I missing the link..

==============

#!/bin/bash

## Assuming that the script will be placed in the Pkg/Contents/Resources folder

path=`pwd `

cd..

PKG_PATH=`pwd `

PKG_INFO_PATH=&quot;${PKG_PATH}/Contents/Info&quot;
INSTALLED_COMPONENT_INFO_PATH=&quot;/Applications/appname/Contents/Info&quot;

function CompareVersions()
{
	local FIRST_VERSION=${1}
	local SECOND_VERSION=${2}
	
#Installing component	

	local MAJOR_FIRST_VERSION=$(echo ${FIRST_VERSION} &#124; cut -d &#039;.&#039; -f 1)
	local MINOR_FIRST_VERSION=$(echo ${FIRST_VERSION} &#124; cut -d &#039;.&#039; -f 2)
	local BUILD_FIRST_VERSION=$(echo ${FIRST_VERSION} &#124; cut -d &#039;.&#039; -f 3)
	
#Installed component	
	local MAJOR_SECOND_VERSION=$(echo ${SECOND_VERSION} &#124; cut -d &#039;.&#039; -f 1)
	local MINOR_SECOND_VERSION=$(echo ${SECOND_VERSION} &#124; cut -d &#039;.&#039; -f 2)
	local BUILD_SECOND_VERSION=$(echo ${SECOND_VERSION} &#124; cut -d &#039;.&#039; -f 3)
	
	if [ ${MAJOR_FIRST_VERSION} -gt ${MAJOR_SECOND_VERSION} ]; then
		exit 0
	elif [ ${MAJOR_FIRST_VERSION} -lt ${MAJOR_SECOND_VERSION} ]; then
		exit 65
	elif [ ${MINOR_FIRST_VERSION} -gt ${MINOR_SECOND_VERSION} ]; then
		exit 0
	elif [ ${MINOR_FIRST_VERSION} -lt ${MINOR_SECOND_VERSION} ]; then
		exit 65
	elif [ ${BUILD_FIRST_VERSION} -gt ${BUILD_SECOND_VERSION} ]; then
		exit 0
	elif [ ${BUILD_FIRST_VERSION} -lt ${BUILD_SECOND_VERSION} ]; then
		exit 65
	fi

	exit 0
}


	if [ -e &quot;${INSTALLED_COMPONENT_INFO_PATH}.plist&quot; ]; then
		INSTALLED_COMPONENT_VERSION=$(defaults read &quot;${INSTALLED_COMPONENT_INFO_PATH}&quot; &quot;CFBundleShortVersionString&quot;)
		INSTALLING_COMPONENT_VERSION=$(defaults read &quot;${PKG_INFO_PATH}&quot; &quot;CFBundleShortVersionString&quot;)
		CompareVersions &quot;${INSTALLING_COMPONENT_VERSION}&quot; &quot;${INSTALLED_COMPONENT_VERSION}&quot;
	else
		exit 0
	fi

===================

Here, I am able to get the version numbers of the Installed component and the &quot;yet to be&quot; installed component. 
But how do I get the final Result (i.e if the Version check Fails) and get the Versioncheck.strings to display the error message(in case of Error) in the Installer window?

Thanks in advance,

Ruby
</description>
		<content:encoded><![CDATA[<p>Thanks Peelman for responding <img src='http://peelman.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>My expertise in shellscript/perl can be ranged to Beginner! <img src='http://peelman.us/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
Hence, a detailed help would be very much appreciated. </p>
<p>I&#8217;ve written a script to compare versions of the installed and installing software(Package). Could you let me know where am I missing the link..</p>
<p>==============</p>
<p>#!/bin/bash</p>
<p>## Assuming that the script will be placed in the Pkg/Contents/Resources folder</p>
<p>path=`pwd `</p>
<p>cd..</p>
<p>PKG_PATH=`pwd `</p>
<p>PKG_INFO_PATH=&#8221;${PKG_PATH}/Contents/Info&#8221;<br />
INSTALLED_COMPONENT_INFO_PATH=&#8221;/Applications/appname/Contents/Info&#8221;</p>
<p>function CompareVersions()<br />
{<br />
	local FIRST_VERSION=${1}<br />
	local SECOND_VERSION=${2}</p>
<p>#Installing component	</p>
<p>	local MAJOR_FIRST_VERSION=$(echo ${FIRST_VERSION} | cut -d &#8216;.&#8217; -f 1)<br />
	local MINOR_FIRST_VERSION=$(echo ${FIRST_VERSION} | cut -d &#8216;.&#8217; -f 2)<br />
	local BUILD_FIRST_VERSION=$(echo ${FIRST_VERSION} | cut -d &#8216;.&#8217; -f 3)</p>
<p>#Installed component<br />
	local MAJOR_SECOND_VERSION=$(echo ${SECOND_VERSION} | cut -d &#8216;.&#8217; -f 1)<br />
	local MINOR_SECOND_VERSION=$(echo ${SECOND_VERSION} | cut -d &#8216;.&#8217; -f 2)<br />
	local BUILD_SECOND_VERSION=$(echo ${SECOND_VERSION} | cut -d &#8216;.&#8217; -f 3)</p>
<p>	if [ ${MAJOR_FIRST_VERSION} -gt ${MAJOR_SECOND_VERSION} ]; then<br />
		exit 0<br />
	elif [ ${MAJOR_FIRST_VERSION} -lt ${MAJOR_SECOND_VERSION} ]; then<br />
		exit 65<br />
	elif [ ${MINOR_FIRST_VERSION} -gt ${MINOR_SECOND_VERSION} ]; then<br />
		exit 0<br />
	elif [ ${MINOR_FIRST_VERSION} -lt ${MINOR_SECOND_VERSION} ]; then<br />
		exit 65<br />
	elif [ ${BUILD_FIRST_VERSION} -gt ${BUILD_SECOND_VERSION} ]; then<br />
		exit 0<br />
	elif [ ${BUILD_FIRST_VERSION} -lt ${BUILD_SECOND_VERSION} ]; then<br />
		exit 65<br />
	fi</p>
<p>	exit 0<br />
}</p>
<p>	if [ -e "${INSTALLED_COMPONENT_INFO_PATH}.plist" ]; then<br />
		INSTALLED_COMPONENT_VERSION=$(defaults read &#8220;${INSTALLED_COMPONENT_INFO_PATH}&#8221; &#8220;CFBundleShortVersionString&#8221;)<br />
		INSTALLING_COMPONENT_VERSION=$(defaults read &#8220;${PKG_INFO_PATH}&#8221; &#8220;CFBundleShortVersionString&#8221;)<br />
		CompareVersions &#8220;${INSTALLING_COMPONENT_VERSION}&#8221; &#8220;${INSTALLED_COMPONENT_VERSION}&#8221;<br />
	else<br />
		exit 0<br />
	fi</p>
<p>===================</p>
<p>Here, I am able to get the version numbers of the Installed component and the &#8220;yet to be&#8221; installed component.<br />
But how do I get the final Result (i.e if the Version check Fails) and get the Versioncheck.strings to display the error message(in case of Error) in the Installer window?</p>
<p>Thanks in advance,</p>
<p>Ruby</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peelman</title>
		<link>http://peelman.us/tech/apple-packages/comment-page-1/#comment-3044</link>
		<dc:creator>peelman</dc:creator>
		<pubDate>Tue, 08 Mar 2011 14:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.peelman.us/wordpress/#comment-3044</guid>
		<description>You just need the set your preflight script to handle the check for you. Have it query the version of a file, or whatever, if its already a newer version, exit with code 112, the set your InstallationCheck.strings file to report that to the user (&quot;16&quot; = &quot;There is a newer version of the software already on this machine!&quot;).</description>
		<content:encoded><![CDATA[<p>You just need the set your preflight script to handle the check for you. Have it query the version of a file, or whatever, if its already a newer version, exit with code 112, the set your InstallationCheck.strings file to report that to the user (&#8220;16&#8243; = &#8220;There is a newer version of the software already on this machine!&#8221;).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blueruby</title>
		<link>http://peelman.us/tech/apple-packages/comment-page-1/#comment-3043</link>
		<dc:creator>Blueruby</dc:creator>
		<pubDate>Tue, 08 Mar 2011 09:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.peelman.us/wordpress/#comment-3043</guid>
		<description>Hey there,

i need a help with packagemaker app.

 I need my Installer to verify if there is actually a newer version of the software installed on the system. If YES, warn the user and abort the install process. If No, upgrade the existing version.

Do you have a script that can do this for me?

Thanks,
ruby</description>
		<content:encoded><![CDATA[<p>Hey there,</p>
<p>i need a help with packagemaker app.</p>
<p> I need my Installer to verify if there is actually a newer version of the software installed on the system. If YES, warn the user and abort the install process. If No, upgrade the existing version.</p>
<p>Do you have a script that can do this for me?</p>
<p>Thanks,<br />
ruby</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peelman</title>
		<link>http://peelman.us/tech/apple-packages/comment-page-1/#comment-2857</link>
		<dc:creator>peelman</dc:creator>
		<pubDate>Wed, 24 Mar 2010 22:04:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.peelman.us/wordpress/#comment-2857</guid>
		<description>Thanks Robin, I&#039;ve heard similar things from guys on the Installer-Dev list, I&#039;ve just never had a reason to use it so I didn&#039;t want to praise or bash it, given my ignorance.  I have never used PackageMaker&#039;s CLI tool either, but I&#039;ve poked around it enough and read enough threads about frustration that I know the basics of it.  I plan on revising those comments and others in the near future, I&#039;ll probably try to work up some test cases for both PM and Iceberg to tinker with the command line building stuff.</description>
		<content:encoded><![CDATA[<p>Thanks Robin, I&#39;ve heard similar things from guys on the Installer-Dev list, I&#39;ve just never had a reason to use it so I didn&#39;t want to praise or bash it, given my ignorance.  I have never used PackageMaker&#39;s CLI tool either, but I&#39;ve poked around it enough and read enough threads about frustration that I know the basics of it.  I plan on revising those comments and others in the near future, I&#39;ll probably try to work up some test cases for both PM and Iceberg to tinker with the command line building stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robin Forder</title>
		<link>http://peelman.us/tech/apple-packages/comment-page-1/#comment-2856</link>
		<dc:creator>Robin Forder</dc:creator>
		<pubDate>Wed, 24 Mar 2010 21:41:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.peelman.us/wordpress/#comment-2856</guid>
		<description>Re. the command-line version, freeze: it worked fine for me. In Terminal it didn&#039;t need a path, but in Automator it did, so when I replaced &#039;freeze MyInstaller.packproj&#039; with &#039;/usr/local/bin/freeze MyInstaller.packproj&#039;, it worked. There are two optional flags: -v, verbose; -d, scratch folder - supply the folder as the argument, presumably.</description>
		<content:encoded><![CDATA[<p>Re. the command-line version, freeze: it worked fine for me. In Terminal it didn&#39;t need a path, but in Automator it did, so when I replaced &#39;freeze MyInstaller.packproj&#39; with &#39;/usr/local/bin/freeze MyInstaller.packproj&#39;, it worked. There are two optional flags: -v, verbose; -d, scratch folder &#8211; supply the folder as the argument, presumably.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

