[wpkg-users] regex in registry paths?

Stefan Pendl stefan.pendl.71 at gmail.com
Fri Jun 1 17:08:57 CEST 2012


Am 01.06.2012 09:08, schrieb heiko.helmle at horiba.com:
>
>  >
>  > What I want to do is to check if the 32-bit version of Java has been
>  > installed on 64-bit Windows 7.
>  > Is there a better way to do this? uninstall only checks for 64 bit apps
>  > (on 64-bit os), or will it check for both?
>

I use the packages below.
The first package just determines which JRE to install based on the O/S, 
since Win2k is not supported by JRE 1.7
So I only have to add the "Java" package to a general profile that is 
included by any host.


<!--code start (watch for line wraps)-->

<?xml version="1.0" encoding="UTF-8"?>

<packages:packages xmlns:packages="http://www.wpkg.org/packages" 
xmlns:wpkg="http://www.wpkg.org/wpkg"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="../xsd/packages.xsd" >

     <package id="Java" name="Java" revision="2011.10.22" reboot="false" 
priority="10" execute="once">
         <include package-id="JRE6" os="5\.0\.\d{4}"/>
         <include package-id="JRE7">
             <condition>
                 <check type="logical" condition="not">
                     <check type="host" condition="os" value="5\.0\.\d{4}"/>
                 </check>
             </condition>
         </include>
     </package>

     <package id="JRE6" name="Java Runtime Environment 6" 
revision="%JRE_VER%" reboot="false" priority="10">
         <variable name="JRE_VER"            value="31" />
         <variable name="PKG_SOURCE_X86" 
value="%SOFTWARE%\Java\jre-6u%JRE_VER%-windows-i586.exe"/>
         <variable name="PKG_SOURCE_X64" 
value="%SOFTWARE%\Java\jre-6u%JRE_VER%-windows-x64.exe"/>
         <variable name="PKG_DEST_NATIVE" 
value="%ProgramFiles%\Java\jre6\bin" />
         <variable name="PKG_DEST_WOW64" 
value="%ProgramFiles(x86)%\Java\jre6\bin" />
         <variable name="PKG_INSTALL_SWITCH" value="ADDLOCAL=ALL 
IEXPLORER=1 MOZILLA=1 REBOOT=Suppress"/>

         <check type="uninstall" condition="versiongreaterorequal" 
path="Java.TM. 6 Update [0-9]+"   value="6.0.%JRE_VER%0" />

         <install include="remove" />
         <!-- install latest version -->
         <install cmd='"%PKG_SOURCE_X86%" /s /v"/passive /norestart /log 
%TMP%\JRE6_x86.log %PKG_INSTALL_SWITCH%"' />
         <install cmd='"%PKG_SOURCE_X64%" /s /v"/passive /norestart /log 
%TMP%\JRE6_AMD64.log %PKG_INSTALL_SWITCH%"' architecture="x64" />

         <upgrade include="install" />

         <!-- stop quick start service -->
         <remove cmd="%ComSpec% /c net stop JavaQuickStarterService">
             <exit code="2" />
         </remove>
         <!-- remove 32-bit version -->
         <remove cmd="%ComSpec% /c for /L %V in (0,1,9) do @msiexec 
/passive /x {3248F0A8-6813-11D6-A77B-00B0D01600%V0}">
             <exit code="1605" />
         </remove>
         <remove cmd="%ComSpec% /c for /L %V in (10,1,%JRE_VER%) do 
@msiexec /passive /x {26A24AE4-039D-4CA4-87B4-2F832160%VFF}">
             <exit code="1605" />
         </remove>
         <!-- remove 64-bit version -->
         <remove cmd="%ComSpec% /c for /L %V in (10,1,%JRE_VER%) do 
@msiexec /passive /x {26A24AE4-039D-4CA4-87B4-2F864160%VFF}" 
architecture="x64">
             <exit code="1605" />
         </remove>
     </package>

     <package id="JRE7" name="Java Runtime Environment 7" 
revision="%JRE_VER%" reboot="false" priority="10">
         <variable name="JRE_VER"            value="3" />
         <variable name="PKG_SOURCE_X86" 
value="%SOFTWARE%\Java\jre-7u%JRE_VER%-windows-i586.exe"/>
         <variable name="PKG_SOURCE_X64" 
value="%SOFTWARE%\Java\jre-7u%JRE_VER%-windows-x64.exe"/>
         <variable name="PKG_DEST_NATIVE" 
value="%ProgramFiles%\Java\jre7\bin" />
         <variable name="PKG_DEST_WOW64" 
value="%ProgramFiles(x86)%\Java\jre7\bin" />
         <variable name="PKG_INSTALL_SWITCH" value="ADDLOCAL=ALL 
IEXPLORER=1 MOZILLA=1 REBOOT=Suppress"/>

         <check type="uninstall" condition="versiongreaterorequal" 
path="Java.TM. 7 Update [0-9]+"   value="7.0.%JRE_VER%0" />

         <install include="remove" />
         <!-- install latest version -->
         <install cmd='"%PKG_SOURCE_X86%" /s /v"/passive /norestart /log 
%TMP%\JRE7_x86.log %PKG_INSTALL_SWITCH%"' />
         <install cmd='"%PKG_SOURCE_X64%" /s /v"/passive /norestart /log 
%TMP%\JRE7_AMD64.log %PKG_INSTALL_SWITCH%"' architecture="x64" />

         <upgrade include="install" />

         <!-- stop quick start service -->
         <remove cmd="%ComSpec% /c net stop JavaQuickStarterService">
             <exit code="2" />
         </remove>
         <!-- remove 32-bit version -->
         <remove cmd="%ComSpec% /c for /L %V in (0,1,%JRE_VER%) do 
@msiexec /passive /x {26A24AE4-039D-4CA4-87B4-2F8321700%VFF}">
             <exit code="1605" />
         </remove>
         <!-- remove 64-bit version -->
         <remove cmd="%ComSpec% /c for /L %V in (0,1,%JRE_VER%) do 
@msiexec /passive /x {26A24AE4-039D-4CA4-87B4-2F8641700%VFF}" 
architecture="x64">
             <exit code="1605" />
         </remove>
     </package>
</packages:packages>

<!--code end-->

--
Stefan P.

Top-posting:
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



More information about the wpkg-users mailing list