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

Nils Thiele it.service.kultur at uni-hamburg.de
Tue Mar 17 12:45:43 CET 2015

Am 2015-02-27 00:33, schrieb Stefan Pendl:
> 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" />
> </remove>
> '---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?
> -------------------------------------------------------------------------
> SSLrack - get your cheap cheap SSL certificates (standard, wildcard, 
> EV)
> http://www.sslrack.com/
> -------------------------------------------------------------------------
> wpkg-users mailing list archives >> 
> http://lists.wpkg.org/pipermail/wpkg-users/
> _______________________________________________
> wpkg-users mailing list
> wpkg-users at lists.wpkg.org
> https://lists.wpkg.org/mailman/listinfo/wpkg-users

Hey just to keep other updated...
I tried the method (replaced /passive with /qn tho after testing was 
done) and i noticed something.
With the Command you posted it always stopped after the the 26th attempt 
while using wpkg.js, running the command manually in cmd promt worked 
fine. (Win7 Prof x64)
Adding ">NUL" to the command fixed the problem for me!

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

Hope i could help someone else with this!

IT-Support - Fachbereich 09 Kulturgeschichte und Kulturkunde
Universität Hamburg

More information about the wpkg-users mailing list