[wpkg-users] Use regex to get installed version number?

Stefan Pendl stefan.pendl.71 at gmail.com
Fri Feb 27 00:33:30 CET 2015

Am 26.02.2015 um 10:51 schrieb Nils Thiele:
> Hey,
> we are currently still deploying java 7.
> i was looking into java 8 but it seems oracle removed the function to 
> automaticly remove the installed version and replace it with the new 
> one like in java 7, instead it will install the update additionally.
> The easiest solution is of course to keep the previous versionnumber 
> in the package and remove it before the installation of the new one.
> But this wont work if a system doesnt have the last release but maybe 
> a older one because it hasnt connected to the server that often.
> Now i was wondering if it is possible to use regex to fix this problem 
> inside the package file without having to rely on other problems.
> If you use regex command like this
> Java.8.Update.([0-9]*)
> the result of regex is the sub version number.
> Is it possible to integrate the results of a check into a wpkg variable?
> Something like this:
> <check type="uninstall" condition="exists" path="Java 8 Update 
> ([0-9]*)" />
> <variable name="oldsubversion" value="%regexcheckresult%" />
> <upgrade cmd='msiexec.exe /qn /x 
> {26A24AE4-039D-4CA4-87B4-2F832180%oldsubversion%F0}' />
> This obviously wont work, just wondering if something like this is 
> possible at all without having to rely on a "outside" wpkg script.
> Thanks!
> Best regards,
> Nils

The ability for in place updates is still listed in the documentation, 
but it seems that the installer is broken.

You can use the code below to remove any previous release of the 32-bit 
JRE 8.

Use "FOR /?" in a command prompt for further information about the /L 
switch of the FOR DOS command.

'---code start (watch for line wraps)

<remove cmd="%ComSpec% /c for /L %N in (10,1,99) do msiexec /passive /x {26A24AE4-039D-4CA4-87B4-2F832180%~NF0}">
     <exit code="1605" />

'---code end

Stefan P.

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