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

Dave Evans dave.evans at goodness.co.uk
Wed Mar 18 10:26:16 CET 2015


On 17/03/2015 21:01, Stefan Pendl wrote:
> Am 17.03.2015 um 12:45 schrieb Nils Thiele:
>> 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" />
>> </remove>
>>
>> Hope i could help someone else with this!
>>
>> Nils
>
> OK, so I missed to get rid of the output.
> Another way would be to use the at-sign (@) in front of msiexec to 
> suppress the output.
>
> /passive and /qn are essentially the same.
>
> '---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
>
we use this at the start of our install command:
         <!-- first thing is to remove *any* version of Java, whatever 
version, the ' are because we need single quotes (') there -->
         <install cmd='wmic product where "Name like 'Java%'" 
call uninstall /nointeractive' >
             <exit code='any' />
         </install>

it seems to work so far & removes Java7 off the machine prior to the 
Java8 install as well.

Dave

> -- 
> Stefan P.
>




More information about the wpkg-users mailing list