RE: How to skip the installation when install a lower version. (PackageMaker3.02)
RE: How to skip the installation when install a lower version. (PackageMaker3.02)
- Subject: RE: How to skip the installation when install a lower version. (PackageMaker3.02)
- From: "Gu, Kevin" <email@hidden>
- Date: Thu, 27 Nov 2008 13:51:38 +0800
- Acceptlanguage: en-US
- Thread-topic: How to skip the installation when install a lower version. (PackageMaker3.02)
Hi David,
The package version I mean is the "Package Version:" string in "Configuration" tab of the Package's "Contents". I suppose this version info should effect in the way of preventing down-grade. ()
The version of Package Maker I use is 3.0.2. And the target OS is Leopard.
So, the installer package is not a folder with Resource folder in it.
> -----Original Message-----
> From: David Schara [mailto:email@hidden]
> Sent: 2008年11月26日 19:08
> To: Gu, Kevin
> Cc: email@hidden
> Subject: Re: How to skip the installation when install a lower version.
> (PackageMaker3.02)
>
> hi Kevin,
>
> there is a file called "My.pkg/Contents/Resources/package_version
> <cid:email@hidden>" contained in the
> package. I dont know in which way it differs from the version number of
> the app, but maybe it helps...
>
> Greets
>
>
> <cid:email@hidden>
> > Hi David,
> >
> > Thank you very much for your reply.
> >
> > What I really want is to compare the version of install packages. (Not the
> version of my application, because I install not only bundle but also other
> related files.)
> >
> > Anyway, I have made a small test to try the script and my test result is below:
> > /private/tmp/scripts.IXRi/./preinstall[688] Version_Now(1.49.001) <
> Version_Old(1.51.001)
> > That means I do have installed a low version and replace the higher one.
> >
> > So, do you have the second suggestion...?
> >
> > Best Regards,
> > Kevin Gu
> >
> >
> >
> >> -----Original Message-----
> >> From: David Schara [mailto:email@hidden]
> >> Sent: 2008年11月26日 17:51
> >> To: Gu, Kevin
> >> Cc: email@hidden
> >> Subject: Re: How to skip the installation when install a lower version.
> >> (PackageMaker3.02)
> >>
> >> Hi Kevin,
> >>
> >> my fist suggestion would be to write a little bash script that compares
> >> two version numbers. This script should be put into the preinstall
> >> section of your installer or so.
> >>
> >> The script should look something like this (it is only example code!!!):
> >>
> >>
> >> #!/bin/sh
> >> #Script is checking if VERSION_B is higher, lower or equal to Version_A
> >>
> >> #This is how my Version number looks like:
> >> VERSION_A="0.5.0.002"
> >>
> >> #Read it out the plist
> >> VERSION_B=`defaults read "/Applications/my.app/Contents/Info"
> >> "CFBundleShortVersionString"`
> >>
> >> echo "echo1:" $VERSION_B
> >> echo "echo2:" $VERSION_A
> >>
> >> #Reading String VERSION_A to array and writing it to Val_A without "."
> >>
> >> V1[1]=${VERSION_A:0:1}
> >> echo ${V1[1]}
> >> V1[2]=${VERSION_A:2:1}
> >> echo ${V1[2]}
> >> V1[3]=${VERSION_A:4:1}
> >> echo ${V1[3]}
> >> V1[4]=${VERSION_A:6:3}
> >> echo ${V1[4]}
> >>
> >> #put serial back together without dots
> >> Val_A=${V1[1]}${V1[2]}${V1[3]}${V1[4]}
> >> echo $Val_A
> >>
> >> #Reading String VERSION_A to array and writing it to Val_B without "."
> >> V2[1]=${VERSION_B:0:1}
> >> echo ${V2[1]}
> >> V2[2]=${VERSION_B:2:1}
> >> echo ${V2[2]}
> >> V2[3]=${VERSION_B:4:1}
> >> echo ${V2[3]}
> >> V2[4]=${VERSION_B:6:3}
> >> echo ${V2[4]}
> >>
> >> #put serial back together without dots
> >> Val_B=${V2[1]}${V2[2]}${V2[3]}${V2[4]}
> >> echo $Val_B
> >>
> >> #-Comparing here:
> >> #-instead of echo there should be something like return 0 in case of
> >> success or anything higher starting at 64
> >> #will stop the isntallation.
> >>
> >> if [ $Val_A -gt $Val_B ]
> >> then
> >> echo "V1 > V2"
> >> fi
> >>
> >> if [ $Val_A -lt $Val_B ]
> >> then
> >> echo "V1 < V2"
> >> fi
> >>
> >> if [ $Val_A = $Val_B ]
> >> then
> >> echo "V1 = V2"
> >> fi
> >>
> >>
> >> Greetings
> >>
> >> David
> >>
> >> Gu, Kevin schrieb:
> >>
> >>> Hi all,
> >>>
> >>> I know this might be a very simple question, but I tried and failed many
> times
> >>>
> >> and have to write this mail.
> >>
> >>> What I want is very simple:
> >>> 1. Installation runs when install an initial version or install a higher
> >>>
> >> version.
> >>
> >>> 2. Installation skips when install an lower version.
> >>>
> >>> I have tried the "Package Version", but it doesn't work.
> >>> I use PackageMaker 3.02 on Leopard.
> >>>
> >>> Any help will be highly appreciated.
> >>> Thanks in advance.
> >>>
> >>> Best Regards,
> >>> Kevin
> >>>
> >>> _______________________________________________
> >>> Do not post admin requests to the list. They will be ignored.
> >>> Installer-dev mailing list (email@hidden)
> >>> Help/Unsubscribe/Update your Subscription:
> >>>
> >>>
> >>
> >> -instruments.de
> >>
> >>> This email sent to email@hidden
> >>>
> >>>
> >> --
> >> David Schara
> >> Research & Development
> >>
> >> email@hidden
> >>
> >> NATIVE INSTRUMENTS GmbH
> >> Schlesische Str. 28
> >> 10997 Berlin, Germany
> >> http://www.native-instruments.com
> >>
> >> ***
> >>
> >> TRAKTOR PRO - the new benchmark in digital DJing
> >> => http://www.listentopro.com
> >>
> >> KORE PLAYER - the free instrument with access to the best NI sounds
> >> => http://www.native-instruments.com/koreplayer.info
> >>
> >> ->>>>>> NATIVE INSTRUMENTS - The Future of Sound <<<<<<-
> >>
> >> Registergericht: Amtsgericht Charlottenburg
> >> Registernummer: HRB 72458
> >> UST.-ID.-Nr. DE 20 374 7747
> >> Geschaeftsfuehrer: Daniel Haver, Stephan Schmitt
> >>
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > Installer-dev mailing list (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> >
> -instruments.de
> >
> > This email sent to email@hidden
>
> --
> David Schara
> Research & Development
>
> email@hidden
>
> NATIVE INSTRUMENTS GmbH
> Schlesische Str. 28
> 10997 Berlin, Germany
> http://www.native-instruments.com
>
> ***
>
> TRAKTOR PRO - the new benchmark in digital DJing
> => http://www.listentopro.com
>
> KORE PLAYER - the free instrument with access to the best NI sounds
> => http://www.native-instruments.com/koreplayer.info
>
> ->>>>>> NATIVE INSTRUMENTS - The Future of Sound <<<<<<-
>
> Registergericht: Amtsgericht Charlottenburg
> Registernummer: HRB 72458
> UST.-ID.-Nr. DE 20 374 7747
> Geschaeftsfuehrer: Daniel Haver, Stephan Schmitt
_______________________________________________
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