Installing an IBM Rational Product with an Absolute Path in Its Response File Using a Wise Script.
When your deployment tool creates a folder in the 'cache' folder on the users workstation, downloads it package/installation files into that folder and your application depends on an absolute path, then this Wise Script might come in handy. You don't know the folder name the deployment tool creates beforehand and it is most likely different on every workstation.
The IBM Rational and WebSphere products use Installation Manager and a XML response file for their silent installs. That response file relies on a repository, which... yes, needs an absolute path in the XML response file. Believe me, a simple "." doesn't work. I even asked IBM and their reply was that it needs an absolute path.
I created a Wise Script that searches for the XML file, searches for the path where the repository resides, opens the XML file, writes the correct path in the correct line and installs the Rational Product. Of course you can use this script for other installations, where ever you need to do a search for a path and that path needs to end up in a file (any file).
Response File and Installation Manager
This is the path in the response file I am talking about.
I changed the path to this, so I don't have to type this long path later on in my Wise Script.
First you need to create the response file. IBM has very good documentation on how to do this.
Here it is in a short version.
To record a response file for installation (or uninstallation):
First thing you need to do is install Installation Manager.
- On a command line, change to the eclipse subdirectory in the directory where you installed Installation Manager. For example:
- For Windows: cd C:\Program Files\IBM\Installation Manager\eclipse
- For other platforms: cd /opt/IBM/InstallationManager/eclipse
- On a command line, type the following command to start the Installation Manager, substituting your own file name and location for the response file and (optionally) the log file:
- IBMIM -record <response file and path name> -log <log file and path name>. For example, IBMIM.exe -record c:\mylog\responsefile.xml -log c:\mylog\record_log.xml
- You can record a response file without installing or uninstalling a product by adding the optional -skipInstall <agentDataLocation>. Note that <agentDataLocation> must be a writable directory. The argument does two things. 1) It causes the Installation Manager to save the installation data to this location. 2) The package will not be fully installed. The artifacts will not be downloaded and the installation actions will not be executed.
Read more on how to create the response file here and about the Installation Manager. http://publib.boulder.ibm.com/infocenter/install/v...
To install Rational Functional Tester silent (or any other IBM product that uses the Installation Manager), IBM states that Installation Manager needs to be installed.
Not necessarily so, you can use the Installation Manager Installer.
With this approach you will only need the Installation Manager installation files.
The Installation Manager is always part of the installation files. Its folder name is usually InstallerImage_win32 (IBM is known to change things, so it might be slightly different for their other products. This folder holds the installc.exe (note the c after installc.exe).
I will be using that executable to install Functional Tester silently. Using that I don't have to install the Installation Manager on the user's workstation.
I like to have the files that I created and that I need to do a silent install together in the same folder. "This is not a requirement, but preference".
I named the XML response file that I created FuncTester8.xml and copied it in the InstallerImage_win32 folder.
I also copied my Wise Script SetUpFuncTester8.exe to the InstallerImage_win32folder.
Now I have everything in one place, but again, this is only preference.
Creating the Wise Script
Step 1
Open the Wise Script Editor and select the Script Editor tab.
Step 2
First we declare three variables, one for the XML file, one for the Repository path and one for the Installation path. The values in these variables are left empty, since the "search file" settings will place the value it finds in that variable.
Name the variable so it's easy recognizable for you and you know what it is for. You can also add comments in your Wise script with a small explanation of what the next step does in the script. Very similar to VBscript.
First I'll create the variable for the Repository which points to the DiskTag.inf file.
- Double click Set Variable in the left pane.
- In the Variable field type: DISKTAG
- Leave everything else as is and click OK.
Step 3
The second variable is for the Response XML file.
- Double click Set Variable in the left pane.
- In the Variable field type: RATIONALXML (now that I think of it, I could've named it RESPONSE).
- Leave everything else as is and click OK.
Step 4
The third Variable is to find the path where the installc.exe and the FuncTester8.xml resides. (The installc.exe is needed to install the application).
- Double click Set Variable in the left pane.
- In the Variable field type: INSTALLC
- Leave everything else as is and click OK.
Step 5
This one needs a little explanation. I know that the cache folder, where in my case SMS drops its packages, is inside the System32 folder. I don't want this command to search the whole C:\ drive, therefore I used the Global Variable SYS32 in the file name.
If your cache folder resides somewhere else then just create a Variable and in the Value field type the path to the folder. You can then use that variable in the way that I am using the Global Variable.
- Double click Search for File in the left pane.
- In the File Name field type:%SYS32%\FuncTester8.xml (that is my response file).
- In the Variable Name field type: RATIONALXML (now the results of this search will be placed in that Variable).
- In the Return Type field: select "Return first file that matches"
- In the Drives to Search field: select "Directory given by File Name field" (see File name, where I typed %SYS32%).
You can also select:
- Local hard drives only
- Network drives only
- Or Both local and network drives (which ever you need).
I don't need a search depth since this search will search the whole System 32 folder.
- Click OK.
Step 6
Now I want the script to find the path to the DiskTag.inf file.
The Search for File command can also be used to look for a directory. They could've named it Search for File/Dir, since it works for both.
- Double click Search for File in the left pane.
- In the File Name field type:%SYS32%\Disk1 (that is the directory where the DiskTag.inf is).
- In the Variable Name field type: DISKTAG (now the results of this search will be placed in that Variable).
- In the Return Type field: select "Return first file that matches"
- In the Drives to Search field: select "Directory given by File Name field" (see File name, where I typed %SYS32%).
- Click Ok.
Step 7
To make sure that the script works so far, I added some Display Message Settings.
When running the script a Message box pops up with the path that is placed in the RATIONALXML variable and the other Message box displays the path to the Disk1 directory where the DiskTag.inf is. I also created one for the INSTALLC variable.
- Double click Display Message in the left pane.
- In the Message Title field: You can type whatever you like, but you want to specify it in such a manner that you know which results are displayed.
- In the Message Text field: You can also type whatever you like, but you must specify the Variable from which you want results displayed.
- Click OK.
The above also applies to the next Message Box for the DISKTAG variable and the INSTALLC variable.
You'll notice on this print screen that the Display Message "Path xml file%rationalxml%" is green and that there are a /* in front of the line.
When I was satisfied with the results displayed by the Message boxes I commented it out, so the message boxes are 'disabled', but I didn't want to delete them yet. You'll find the comment out option in the menu.
Step 8
Now I'll have the script add the path it found in the XML file it found, by replacing the line.
- Double click Insert Line into Text File in the left pane.
- In the File to Edit field type: %RATIONALXML% (this is my response file, 'FuncTester8.xml')
- In the Text to Insert field type: <repository location='%DISKTAG%'/> (or the line that you want to insert).
- In the Line Number field, you can add the line number where you want your line to end up. I am not using this field so left it default which is 0.
- In the Search for Text field type: <repository location='disk1'/> (This is the line that I want to replace with the line in that I typed in the Text to Insert field above).
- In the Insert Action field select: Replace line containing text (now the line in the Search for Text field will get replaced with the line in the Text to Insert field.
The other two options are;
- Insert before line containing text
- Insert after line containing text. (Select which ever you need).
- Click OK.
Step 9
Here I am adding a small 'pause' to give the script time to open the XML file, replace the line and close it.
- Double click Pause in the left pane.
- IN the Milliseconds to pause field type: 1000 (or however long or short you want it).
- Click OK.
Step 10
Now we are going to install the program, which is as I mentioned Rational Functional Tester.
Since I am using the response file, I need this command line:
"Installc.exe --launcher.ini silent-install -silent -input FuncTester8.xml"
The full command looks like this:
%INSTALLC%\installc.exe --launcher.ini silent-install.ini -silent -input "%INSTALLC%\FuncTester8.xml"-log "%TEMP%\RationalFuncTester8.log"
As you can see I also added a log file. I am using the Global variable TEMP, since that's the place where I want the log file. If you want it somewhere else, create a Variable and fill out the path to the folder as its value.
- Double click Execute Program in the left pane.
- In the .EXE Path field type: %INSTALLC%\installc.exe
- In the Command Line field type: --launcher.ini silent-install.ini -silent -input "%INSTALLC%\FuncTester8.xml"-log "%TEMP%\RationalFuncTester8.log"
- In the Window Size field: I selected hidden, so the user doesn't see anything. (this setup opens a command prompt, which the user can 'accidentally' close).
- Select 'Wait for Program to Exit and click OK.
I also attached this Wise Script, just rename from .txt to .wse and there you have the script.
| License: | AJSL By clicking the download link below, you agree to the terms and conditions in the Altiris Juice Software License |
| Support: | User-contributed tools on the Juice are not supported by Altiris Technical Support. If you have questions about a tool, please communicate directly with the author by visiting their profile page and clicking the 'contact' tab. |
