[wpkg-users] Read exitcode of previous install command?

Nils Thiele it.service.kultur at uni-hamburg.de
Fri Dec 11 15:46:23 CET 2015

Thanks for the working solution... in the end i used i different wpkg 
only method but this only works for iexplorer so will keep your solution 
for future packages

On our Systems (i guess all windows 7) even if iexplorer is deactivated 
using dism there is still a folder in Program Files with an exe called 
ieinstal.exe, this holds the same version number as the iexplorer.exe if 
it is activated.

So in my package i first have a install command using dism but with the 
condition that ieinstal.exe has a version number greater than the one 
from the installer.
After that i have the install command using the packaged exe installer, 
again with a condition that checks if the client is windows 7 and that 
either the iexplorer.exe version number is smaller than the one from the 
packaged installer or iexplorer exe doesnt exist at all.

install part:

     <install cmd='dism /NoRestart /online /enable-feature 
             <check type="file" condition="versiongreaterthan" 
path="%PKG_DESTINATION%\ieinstal.exe" value="%exeversion%" />
             <check type="logical" condition="and">
                 <check type="logical" condition="or">
                     <check type="file" condition="versionsmallerthan" 
path="%PKG_DESTINATION%\iexplore.exe" value="%exeversion%" />
                     <check type="logical" condition="not">
                         <check type="file" condition="exists" 
                 <check type="host" condition="os" 
value="professional.+6\.1\.\d{4}" />
         <exit code='0' />
         <exit code='3010' />
         <exit code='40008' /> <!-- Greater Version installed -->
         <!-- exit codes from 
https://msdn.microsoft.com/en-us/library/dn321441.aspx -->

Am 11.12.2015 um 13:14 schrieb Rainer Meier:
> Hi Nils,
> On 11.12.2015 12:43, Nils Thiele wrote:
>> The Solution would be to use dism here instead of the installer to 
>> activate ie
>> again.
>> Is there a way to do this inside a wpkg package?
>> For example run the installer, if exitcode is 40008 run this command?
> I would recommend simply to place a small cmd script on your share and 
> call it from WPKG.
> Contents might be something like:
> @echo off
> start /wait "IE install" "~dp0IE11-Windows6.1-x64-en-us.exe" /quiet 
> /closeprograms /norestart
> if not %ERRORLEVEL% == 40008 goto skip-dism-install
> :: install using dism
> dism ......
> :: install IE11
> start /wait "IE install" "~dp0IE11-Windows6.1-x64-en-us.exe" /quiet 
> /closeprograms /norestart
> :skip-dism-install
> exit /b 0
> This is just an example and not tested code at all.
> br,
> Rainer

IT-Support - Fachbereich 09 Kulturgeschichte und Kulturkunde
Universität Hamburg
Flügelbau West, R. 204
Edmund-Siemers-Allee 1
D-20146 Hamburg
Tel.: +49-40-42838-3024
Email: it.service.kultur at uni-hamburg.de

More information about the wpkg-users mailing list