Discussion:
[wpkg-users] Read exitcode of previous install command?
Nils Thiele
2015-12-11 11:43:28 UTC
Permalink
Hey,
i was creating a package for IE11, we have deactivated it by default but
because some SAP Webinterface wont work on Firefox we now have to
activate it again on some clients (All Windows 7 SP1).

I thought i use the ie11 install package for this and not use dism so
the latest version gets installed right away, if i would use dism on
those clients it would activate iexplorer 8 first and then needs to
install all the update through windows update.

On my WPKG Test System i had Internet Explorer activated allready and it
was updated to the latest version. I deactivated it and ran the
installer but it quits returning exitcode 40008 (Newer Version allready
installed), even tho internet explorer is not installed at the moment.
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?
This is a very rare case but i would like to cover every possible system
and maybe something similiar is needed in the future for another package.

Thanks
--
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: ***@uni-hamburg.de

-------------------------------------------------------------------------
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/
Rainer Meier
2015-12-11 12:14:40 UTC
Permalink
Hi Nils,
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
-------------------------------------------------------------------------
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/
Nils Thiele
2015-12-11 14:46:23 UTC
Permalink
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
/featurename:%ie-feature%'>
<condition>
<check type="file" condition="versiongreaterthan"
path="%PKG_DESTINATION%\ieinstal.exe" value="%exeversion%" />
</condition>
</install>
<install
cmd='"%SOFTWARE%\MS\iexplorer\IE11-Windows6.1-%arch%-%locale%.exe"
%switches%'>
<condition>
<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"
path="%PKG_DESTINATION%\iexplore.exe"/>
</check>
</check>
<check type="host" condition="os"
value="professional.+6\.1\.\d{4}" />
</check>
</condition>
<exit code='0' />
<exit code='3010' />
<exit code='40008' /> <!-- Greater Version installed -->
<!-- exit codes from
https://msdn.microsoft.com/en-us/library/dn321441.aspx -->
</install>
Post by Rainer Meier
Hi Nils,
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.
@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: ***@uni-hamburg.de

-------------------------------------------------------------------------
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/
Loading...