[wpkg-users] Java7 for all but one host
Paul McGrath
J.P.McGrath at leeds.ac.uk
Mon Nov 4 15:27:18 CET 2013
Hi Jader,
This is how I exclude in Java:
I have an exclusion list of PCs and exclude them from the ‘check’
<!-- add a PC in here to NOT install java 7 -->
<variable name="excludelist" value="^(limm-pc4060|limm-pc3171)$"/> <!-- Jo|May -->
<check type="logical" condition="and">
<check type="uninstall" condition="versiongreaterorequal" path="Java 7 Update %cpversion%" value="%version%"/>
<check type="logical" condition="not">
<check type="uninstall" condition="versiongreaterorequal" path="Java SE Development Kit 7 Update %cpversion%" value="1.%version%"/>
<check type="logical" condition="or">
<check type="host" condition="hostname" value="%excludelist%"/>
</check>
</check>
</check>
I then exclude from each ‘install’ that I DO NOT want to run on them:
<install architecture="x64" cmd='%COMSPEC% /c rmdir /s /q "%PROGRAMFILES(x86)%\java\jre6"'>
<condition>
<check type="logical" condition="not">
<check type="logical" condition="or">
<check type="host" condition="hostname" value="%excludelist%"/> </check>
</check>
</condition>
<exit code='any'/>
</install>
<install architecture="x86" cmd='%COMSPEC% /c rmdir /s /q "%PROGRAMFILES%\java\jre6"'>
<condition>
<check type="logical" condition="not">
<check type="logical" condition="or">
<check type="host" condition="hostname" value="%excludelist%"/> </check>
</check>
</condition>
<exit code='any'/>
</install>
<install cmd='msiexec.exe /i "%SOFTWARE%\jre\jre1.%progversion%\jre1.%progversion%.msi" /quiet /norestart /l* "C:\netinst\jre.log" AgreeToLicense=YES ADDLOCAL=ALL WEB_JAVA=1 IEXPLORER=1 NETSCAPE=1 MOZILLA=1 REBOOT=Suppress JAVAUPDATE=0' >
<condition>
<check type="logical" condition="not">
<check type="logical" condition="or">
<check type="host" condition="hostname" value="%excludelist%"/> </check>
</check>
</condition>
</install>
<install cmd='net STOP JavaQuickStarterService'>
<condition>
<check type="logical" condition="not">
<check type="logical" condition="or">
<check type="host" condition="hostname" value="%excludelist%"/> </check>
</check>
</condition>
<exit code='2'/>
</install>
<install os="windows.+5\.\d{1}\.\d{4}" architecture="x86" cmd='%COMSPEC% /C set PATH = c:\progra~1\java\jre7\bin;%path% '/>
<install os="windows.+6\.\d{1}\.\d{4}" architecture="x86" cmd='reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path /t REG_SZ /d "%path%;c:\progra~1\java\jre7\bin" /f '>
<condition>
<check type="logical" condition="not">
<check type="logical" condition="or">
<check type="host" condition="hostname" value="%excludelist%"/> </check>
</check>
</condition>
<exit code='any'/>
</install>
<install os="windows.+6\.\d{1}\.\d{4}" architecture="x64" cmd='reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path /t REG_SZ /d "%path%;c:\progra~2\java\jre7\bin" /f '>
<condition>
<check type="logical" condition="not">
<check type="logical" condition="or">
<check type="host" condition="hostname" value="%excludelist%"/> </check>
</check>
</condition>
<exit code='any'/>
</install>
Someone may suggest there is a simpler way, but this is how I do it.
BW
Paul
From: wpkg-users-bounces at lists.wpkg.org [mailto:wpkg-users-bounces at lists.wpkg.org] On Behalf Of Jáder Marasca
Sent: 04 November 2013 14:19
To: Stefan Pendl
Cc: wpkg-users at lists.wpkg.org
Subject: Re: [wpkg-users] Java7 for all but one host
Stefan
Thanks by your answer.
I speak portuguese, not english... so sometimes it´s more difficult to understand small details. Sorry about that.
I have a Java.xml package (for Java6) and now I created a new Java7.xml package.
So I replace the word "Java" with "Java7" in the default/common profile , hoping WPG would remove Java (java6) from all computers and install Java7 on them.
Results: I have some computer with both of them and failed to exclude PC-MICHELE :(
For now, I think best way woud be exclude Java7 from host PC-MICHELE. All other things are working for now.
I´m still not sure about how to exclude a package from a host or how to exclude a host from a profile. :o :$
Sorry.
Any help would be great.
Thanks
Jáder
2013/11/1 Stefan Pendl <stefan.pendl.71 at gmail.com<mailto:stefan.pendl.71 at gmail.com>>
Am 01.11.2013 14:35, schrieb Jáder Marasca:
Stefan
Thanks by your quick ansser... but I´m not sure if I understood it.
I have a Java7 package as from wiki page.
I´ll update it to include the new verification.
It will became something like to avoid install on hostname "PC-MICHELE":
(...)
name="Java Runtime Environment 7"
revision="%version%"
reboot="false"
priority="100">
<condition>
<check type="logical" condition="not">
<check type="host" condition="hostname" value="PC-MICHELE"/>
</check>
</condition>
No, that doesn't work as you may think and it is not supported either.
There are multiple ways to exclude a package.
In my case I add the "Java" package to all profiles and that package will decide which Java version to install.
This will reduce the need to add host checks to one spot.
Since I don't know your WPKG structure it is hard to tell what would be the best way for you.
If you have one common profile, you can exclude the host in that profile, so you only need the "Java7" package.
If you have no common profile, you would end up with two packages, "Java" and "Java7", where "Java" is included in every profile and it will decide if "Java7" needs to be installed.
Make sure to read the change log file shipping with WPKG, so you know what is really supported.
--
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?
-------------------------------------------------------------------------
Hotel discounts, best prices: http://www.booking.com/index.html?aid=366545
-------------------------------------------------------------------------
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
_______________________________________________
wpkg-users mailing list
wpkg-users at lists.wpkg.org<mailto:wpkg-users at lists.wpkg.org>
http://lists.wpkg.org/mailman/listinfo/wpkg-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20131104/1cbeb165/attachment-0003.html>
More information about the wpkg-users
mailing list