@echo off

rem ********************************************************************************
rem *
rem * LOADMENU.BAT
rem *
rem * This file controls loading of the ServerGuide Scripting Toolkit custom menu 
rem * into the Altiris Deployment Solution for Windows console.  
rem *
rem * This batch file is called by Integrate-IBMToolkit-AltirisForWindows.BAT.
rem *
rem ********************************************************************************

rem ********************************************************************************
rem * Set some environment variables to make this easier to maintain
rem * Toolkit: Path to base Toolkit directory - TK_PT
rem * Toolkit: Install directory - TK_INS
rem ********************************************************************************

rem ********************************************************************************
rem * Change to the system drive
rem ********************************************************************************
C:


rem ********************************************************************************
rem * Change to the Altiris base directory, their import command only seems to work
rem * from inside this directory.
rem ********************************************************************************
cd %TK_INS%


rem ********************************************************************************
rem * Create or update the Altiris - tools.ini - file, adding our menu to the list.
rem ********************************************************************************
%TK_PT%\utils\win32\Clini.exe tools.ini /S:SubMenus /I:"&IBM Tools" /V:ibmtools.ini /NS
if errorlevel 1 goto ERROR

rem ********************************************************************************
rem * Create or update the custom IBM tools menu file - ibmtools.ini
rem * Create the ServerGuide Scripting Toolkit custom menu file into the Altiris 
rem * directory, so that the Altiris GUI can find it.
rem ********************************************************************************

rem * Add Toolkit Assembly directory to menu
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:ToolkitDir /I:MenuText /V:"IBM ServerGuide Scripting &Toolkit directory" /NS
if errorlevel 1 goto ERROR
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:ToolkitDir /I:Description /V:"View the IBM ServerGuide Scripting Toolkit directory" /NS
if errorlevel 1 goto ERROR
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:ToolkitDir /I:WorkDir /V:"." /NS
if errorlevel 1 goto ERROR
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:ToolkitDir /I:Executable /V:"explorer.exe \"sgdeploy\"" /NS
if errorlevel 1 goto ERROR

rem * Add User's Reference to menu
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:UserGuide /I:MenuText /V:"&User's Reference" /NS
if errorlevel 1 goto ERROR
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:UserGuide /I:Description /V:"The IBM ServerGuide Scripting Toolkit User's Reference" /NS
if errorlevel 1 goto ERROR
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:UserGuide /I:WorkDir /V:"." /NS
if errorlevel 1 goto ERROR
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:UserGuide /I:Executable /V:"\"sgdeploy\sgtk\docs\UserGuide.pdf\"" /NS
if errorlevel 1 goto ERROR

rem * Add Support web page to menu
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:Webpage /I:MenuText /V:"IBM &xSeries Support Page" /NS
if errorlevel 1 goto ERROR
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:Webpage /I:Description /V:"IBM's Support page" /NS
if errorlevel 1 goto ERROR
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:Webpage /I:WorkDir /V:"." /NS
if errorlevel 1 goto ERROR
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:Webpage /I:Executable /V:iexplore.exe www.ibm.com/pc/support/us /NS
if errorlevel 1 goto ERROR

rem * Add Readme to menu
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:Readme /I:MenuText /V:"&Readme" /NS
if errorlevel 1 goto ERROR
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:Readme /I:Description /V:"The IBM ServerGuide Scripting Toolkit readme file." /NS
if errorlevel 1 goto ERROR
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:Readme /I:WorkDir /V:"." /NS
if errorlevel 1 goto ERROR
%TK_PT%\utils\win32\Clini.exe ibmtools.ini /S:Readme /I:Executable /V:iexplore.exe "\"%TK_INS%sgdeploy\sgtk\docs\readme.htm\"" /NS
if errorlevel 1 goto ERROR

goto END


:ERROR
rem ********************************************************************************
rem * Hit an error in this batch file.
rem ********************************************************************************
echo Encountered an error and stopped processing in "loadmenu.bat".

pause
goto END


:END

