Creating custom task for software deployment

(imported topic written by sam770491)

I want to create a custom task to install an .exe in quiet mode to certain group of systems only if they have oracle client installed. I’m having problem coming up with a action script to accomplish this. I have used the debugger to come up with my first line (or what I think my first line should be). Does anyone have any suggestions

exist folder “c:\oracle”

(imported comment written by BenKus)

Hey sam,

If your Oracle clients are always installed in that location and that location does not exist if Orace is not currently installed, it sounds like that relevance should be OK.

For the action piece that controls the download/install, do you have the executable and command line options that you want to run?

Ben

(imported comment written by Sam_Lam91)

Hi sam7704,

There are a few Relevance tricks we’re using in BigFix Product Engineering to determine whether or not Oracle Client is installed on a machine, specifically Oracle Client 10g Release 2. Depending on your version of Oracle Client, the following may or may not be useful to you. Many of these Relevance statements depend upon specific XML files that can be found in Oracle install directories.

The first is a basic idea for a Relevance statement that is probably more dependable than looking for a hard-coded install directory. We use this Relevance to check the registry for the appropriate Oracle install registry key(s), e.g.,


exists key “HKEY_LOCAL_MACHINE\Software\Oracle” of registry


This may be all the Relevance you need, in fact! The problem with this Relevance statement is that it checks for an Oracle install registry key, but doesn’t specify whether it’s Oracle Client that has been installed (versus, say, Oracle Database, etc.).

A slightly better statement expands upon the above to check whether or not the Opatch Universal Installer is available. Opatch is required for all patch updates on Oracle Client 10.2, and thus it is pretty safe to check for it if you’re looking to deal with Oracle Client 10.2 at all. This and the last Relevance statement below look for specific XML nodes contained in the file “{Oracle Client Install Path)\ContentsXML\inventory.xml” which spit out information such as the existence of Oracle Client, the location of the Client home, etc.


exists file ((it & “\Opatch\Opatch.bat”) of node value of attribute “LOC” of child node whose (node name of it = “HOME” AND node value of attribute “LOC” of it contains “client”) of xpath “INVENTORY/HOME_LIST” of xml document of file ((value “inst_loc” of key “HKLM\Software\Oracle” of registry as string) & “\ContentsXML\inventory.xml”))


Lastly, the following Relevance statement will check to see if Oracle Client is currently at version 10.2.0.1.0:

(You can change the “2.0.1.0” to either “2.0.2.0” or “2.0.3.0” for the other versions currently release by Oracle. Of course, you can also use comparison operators as appropriate.)


(exists file ((value “inst_loc” of key “HKLM\Software\Oracle” of registry as string) & “\ContentsXML\inventory.xml”)) AND (exists xpath “PRD_LIST/TL_LIST/COMP” whose (node value of attribute “NAME” of it as string = “oracle.client” AND exists node value whose (preceding text of first “.” of it as integer = 10 AND following text of first “.” of it as version = "

2.0.1.0

" as version) of attribute “VER” of it) of xml document of file ((it & “\inventory\ContentsXML\comps.xml” ) of (node value of attribute “LOC” of child node whose (node name of it = “HOME” AND node value of attribute “LOC” of it contains “client”) of xpath “INVENTORY/HOME_LIST” of xml document of file ((value “inst_loc” of key “HKLM\Software\Oracle” of registry as string) & “\ContentsXML\inventory.xml” ))))


Hope this helps!

Sam Lam