[wpkg-users] Window OS Version check?

Rainer Meier r.meier at wpkg.org
Sat Jan 23 10:51:34 CET 2010


Hi Sean,

On 23.01.2010 09:31, Sean Kennedy wrote:
> How has everyone else handled version checks with wpkg? For example, I
> would install some packages differently in Vista than I would in XP; is
> there a quick and simple way of handling this?

Sure.


> What I'd like to see is a method by which most of the config files stay
> the same, but wpkg check for different package definition files based on
> the OS version it's running on. So I might have acroread.xml, but if it
> runs under 7 it might look for acroread.6.1.7600.xml ( or something ).

Well, for the checks there are multiple possibilities. Personally I usually just
add appropriate checks to the package and use a logical OR grouping. For example:

<check type='logical' condition 'or'>
  <check type='uninstall' condition='exists' path='XP entry' />
  <check type='uninstall' condition='exists' path='Vista entry' />
</check>

This will make WPKG to detect the package to be installed correctly on both
systems depending on system state.

An alternative solution would be to use a check of type "execute" which allows
you to point to a script which performs various checks depending on OS, registry
values or anything else and then returns 0 if the application is correctly
installed or returns 1 if the application is not installed correctly.


Regarding installation commands. I am usually pointing WPKG to execute a script
called "unattended.cmd". This script can of course detect the OS it is running
on and perform the right operations.
You might have a look at my example attached. It's my script to install Internet
Explorer 8.

My package directory includes the following files:
checkIEVersion.cmd:
I am not using this script now but you might use a similar script if you need to
perform extensive checks based on operating system version. So you might call it
within an "execute" type check.

IE8-WindowsVista-x64-DEU.exe:
IE 8 Installer for Vista x64, German

IE8-WindowsVista-x64-ENU.exe:
IE 8 Installer for Vista x64, English

IE8-WindowsVista-x86-DEU.exe:
IE 8 Installer for Vista 32-bit, German

IE8-WindowsVista-x86-ENU.exe:
IE 8 Installer for Vista 32-bit, English

IE8-WindowsXP-x86-DEU.exe:
IE 8 Installer for XP 32-bit, German

IE8-WindowsXP-x86-ENU.exe:
IE 8 Installer for XP 32-bit, English

install.cmd:
My generic installer helper - it's able to run many silent installers.

unattended.cmd:
The script I am calling from WPKG. It detects the language and calls
unattended-[lang].cmd depending on system language. So I can support multiple OS
languages with one script easily.

unattended-de.cmd:
Detects OS version and runs correct installer depending on OS version. German
installers are run from within this script.

unattended-en.cmd:
Detects OS version and runs correct installer depending on OS version. English
installers are run from within this script.

unattended-uninstall.cmd:
Is called by WPKG to uninstall the application.



This set of scripts can be easily adapted to almost any application.

br,
Rainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Microsoft Internet Explorer 8.7z
Type: application/octet-stream
Size: 2966 bytes
Desc: not available
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20100123/a75cdbf8/attachment.obj>


More information about the wpkg-users mailing list