[wpkg-users] Deploy different versions of wpkg dependent on XP/Seven

zorgman zorg at probesys.com
Wed Nov 17 11:34:16 CET 2010


Hi Rainer,

Le 16/11/2010 20:08, Rainer Meier a écrit :
> Hi Zorgman,
>
> On 16.11.2010 18:15, zorgman wrote:
>
>> Hi,
>> I'm used to deploy wpkg by a batch script which run wpkg.msi with correct
>> setting info ...
>>
>> Now i have some old XP and new Seven 64bits, i need to install different version
>> of wpkg dependent on OS Version/bits.
>> Do you now en easy way to do it? May be a script already exists? I have tried to
>> use %OS% environment variable but it returns alway window_NT.
>>
> You might point your package to call s small CMD script. E.g. (not tested)
>
> install.cmd:
>
> ===========================================================================
> @echo off
> :: Detect Windows version
>
> :: set default installer
> set CMD32=WPKG Client 1.3.6.msi
> set CMD64=WPKG Client 1.3.6_64.msi
>
> ver | findstr /i "5\.1\.">  nul
> IF %ERRORLEVEL% EQU 0 (
>      REM Windows XP
>      set CMD32=WPKG Client 1.3.5.msi
>      set CMD64=WPKG Client 1.3.5_64.msi
> )
>
> if not "%ProgramFiles(x86)%" == "" goto 64bit
> msiexec /i "%~dp0%CMD32%" /qn
> goto end
>
> :64bit
> msiexec /i "%~dp0%CMD64%" /qn
> goto end
>
> :end
> ===========================================================================
>
>
thanks i'll try.
Why do you use 1.3.5 for XP and 1.3.6 for Seven? is it no beta version? 
what change from 1.3.5 to 1.3.6, am i wrong to deploy 1.3.9?

> Such a small and simple script does not only allow you to use different
> installers for different OS but it also allows you to use the right installer
> for 32-bit and 64-bit OS.
>
> For sure you need to make sure that your checks are valid for all versions which
> might be applies. In case of WPKG it's very simple:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <packages>
>
> <package id='WPKG' name='WPKG Package management' revision='1' priority='100'
> reboot='false'>
>
>    <check type='uninstall' condition='exists' path='WPKG' />
>
>    <install cmd='"%SOFTWARE%\wpkg\install.cmd"' />
>    <remove cmd='"%SOFTWARE%\wpkg\uninstall.cmd"' />
>    <upgrade cmd='"%SOFTWARE%\wpkg\install.cmd"' />
>    <upgrade cmd='"%SOFTWARE%\wpkg\install.cmd"' />
> </package>
>
> </packages>
>
>
> The package just needs to check the "WPKG" uninstall entry (which is the same
> for all versions. The install.cmd wrapper will make sure the right version for
> the OS it runs on is applied.
>
Thanks
> This should also answer your question about 64-bit version and %ProgramFiles% vs
> %ProgramFiles(x86)%.
>
What do you mean?
I have to do a script which return me if %programfiles(x86)% exist, if 
it's true, i run %programfiles(x86)%\soft\uninstall.exe

So i have to do 2 packages, one for 32bits, one with logical check (is 
sofware install and is 64bits) which run 
%programfiles(x86)%\soft\uninstall.exe and an other with logical check 
(is sofware install and is 32bits) which run 
%programfiles%\soft\uninstall.exe

> br,
> Rainer
>




More information about the wpkg-users mailing list