@ECHO OFF

Setlocal EnableDelayedExpansion

ECHO Installing HPE Systems Insight Manager...
echo This might take some time please wait...
:set
if not exist "%SystemDrive%\HPIC\logs\LimitedRelease4" mkdir "%SystemDrive%\HPIC\logs\LimitedRelease4"
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ("%TIME%") do (set mytime=%%a%%b)
set mytime=%mytime: =0%
set OUTPUT=%SystemDrive%\HPIC\logs\LimitedRelease4\hpsim_output.txt
set LOGFILE=%SystemDrive%\HPIC\logs\LimitedRelease4\hpsim_%mydate%_%mytime%.log
ECHO [%date% %time%]Installing HPE Systems Insight Manager...   >>%LOGFILE% 
echo [%date% %time%]This might take some time please wait...    >>%LOGFILE% 
echo [%date% %time%]LogFile Path: %LOGFILE%                     >> %LOGFILE% 
:main
FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLM\Software\Hewlett-Packard\Systems Insight Manager\Settings" /v InstallPath') DO set SIMInstallPath=%%B

echo [%date% %time%]%SIMInstallPath%         >>%LOGFILE% 

:: Creating BackupFolder
echo [%date% %time%]Creating Backup Folder:   >>%LOGFILE% 
set hpsim=Systems Insight Manager
rem set BackupInstallPath=%SIMInstallPath%
for /D %%D in ("%SIMInstallPath%") do (
	set BackupInstallPath=%%~dpD
)
if exist "%BackupInstallPath%LimitedRelease1\%hpsim%" rmdir /s /q  "%BackupInstallPath%LimitedRelease1\%hpsim%"
if exist "%BackupInstallPath%LimitedRelease2\%hpsim%" rmdir /s /q  "%BackupInstallPath%LimitedRelease2\%hpsim%"
if exist "%BackupInstallPath%LimitedRelease3\%hpsim%" rmdir /s /q  "%BackupInstallPath%LimitedRelease3\%hpsim%"
if not exist "%BackupInstallPath%LimitedRelease4\%hpsim%" mkdir "%BackupInstallPath%LimitedRelease4\%hpsim%" 
set BackupFolder=%BackupInstallPath%LimitedRelease4\%hpsim%
echo [%date% %time%]Backup Folder Path: %BackupFolder%     >>%LOGFILE% 
mkdir "%BackupFolder%\hpsum"            			>>%LOGFILE%  2>>&1 
mkdir "%BackupFolder%\linuxagents"      			>>%LOGFILE%  2>>&1 
mkdir "%BackupFolder%\mibs"             			>>%LOGFILE%  2>>&1
mkdir "%BackupFolder%\preloadm"         			>>%LOGFILE%  2>>&1  
mkdir "%BackupFolder%\smartcomponents"  			>>%LOGFILE%  2>>&1
mkdir "%BackupFolder%\mxportal\en\content"  		>>%LOGFILE%  2>>&1
mkdir "%BackupFolder%\mxportal\ja\content"  		>>%LOGFILE%  2>>&1
mkdir "%BackupFolder%\mxportal\ko\content"  		>>%LOGFILE%  2>>&1
mkdir "%BackupFolder%\mxportal\zh_CN\content"  		>>%LOGFILE%  2>>&1
mkdir "%BackupFolder%\mxportal\zh_TW\content"  		>>%LOGFILE%  2>>&1


:copy mx.jar
echo [%date% %time%]Copying mx.jar               to 	"%SIMInstallPath%\lib"      >>%LOGFILE%
copy /Y "%SIMInstallPath%\lib\mx.jar "              	"%BackupFolder%\mx.jar"     1>nul   
copy /Y "%~dp0\File\mx.jar"                        		"%SIMInstallPath%\lib"      1>nul     
if errorlevel 1 goto rollback   

:copy mxpartner.jar
echo [%date% %time%]Copying mxpartner.jar              to 	"%SIMInstallPath%\lib"  		    >>%LOGFILE%
copy /Y "%SIMInstallPath%\lib\mxpartner.jar "              	"%BackupFolder%\mxpartner.jar " 	1>nul 
copy /Y "%~dp0\File\mxpartner.jar"                           	"%SIMInstallPath%\lib"  		   	1>nul
if errorlevel 1 goto rollback 

:copy AgentRepair.jar
echo [%date% %time%]Copying AgentRepair.jar               to 	"%SIMInstallPath%\lib" 				>>%LOGFILE%
copy /Y "%SIMInstallPath%\lib\AgentRepair.jar "              	"%BackupFolder%\AgentRepair.jar"  	1>nul
copy /Y "%~dp0\File\AgentRepair.jar"                       	 	"%SIMInstallPath%\lib"  			1>nul
if errorlevel 1 goto rollback
 
:copy cimclient.jar
echo [%date% %time%]Copying cimclient.jar                  to 	"%SIMInstallPath%\lib"  		>>%LOGFILE%
copy /Y "%SIMInstallPath%\lib\cimclient.jar "                 	"%BackupFolder%\cimclient.jar"  1>nul 
copy /Y "%~dp0\File\cimclient.jar"                           	 	"%SIMInstallPath%\lib"  		1>nul 
if errorlevel 1 goto rollback
 
:copy MigrationFramework.jar  
echo [%date% %time%]Copying MigrationFramework.jar         to 	"%SIMInstallPath%\lib"  					>>%LOGFILE%
copy /Y "%SIMInstallPath%\lib\MigrationFramework.jar "        	"%BackupFolder%\MigrationFramework.jar"   	1>nul
copy /Y "%~dp0\File\MigrationFramework.jar"                  		"%SIMInstallPath%\lib" 						1>nul 
if errorlevel 1 goto rollback 

:copy bladeime.jar
echo [%date% %time%]copying bladeime.jar                    to 	"%SIMInstallPath%\lib"  		>>%LOGFILE%
copy /Y "%SIMInstallPath%\lib\bladeime.jar"    					"%BackupFolder%\bladeime.jar"  	1>nul
copy /Y "%~dp0\File\bladeime.jar"                      			"%SIMInstallPath%\lib"  		1>nul
if errorlevel 1 goto rollback 

:copy hpsim_event.xml
echo [%date% %time%]Copying hpsim_event.xml                      	to 	"%SIMInstallPath%\config\Capabilities"   	>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\Capabilities\hpsim_event.xml "   		"%BackupFolder%\hpsim_event.xml "  			1>nul 
copy /Y "%~dp0\File\hpsim_event.xml"                              		"%SIMInstallPath%\config\Capabilities"  	1>nul
if errorlevel 1 goto rollback
 
:copy hpsim_runtools.xml
echo [%date% %time%]Copying hpsim_runtools.xml                      to 	"%SIMInstallPath%\config\Capabilities"  	>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\Capabilities\hpsim_runtools.xml "   	"%BackupFolder%\hpsim_runtools.xml"  		1>nul
copy /Y "%~dp0\File\hpsim_runtools.xml"                             		"%SIMInstallPath%\config\Capabilities"  	1>nul
if errorlevel 1 goto rollback
 
:copy hpsim_supportautomation.xml
echo [%date% %time%]Copying hpsim_supportautomation.xml                       to 	"%SIMInstallPath%\config\Capabilities"  		>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\Capabilities\hpsim_supportautomation.xml  "    	"%BackupFolder%\hpsim_supportautomation.xml "  	1>nul
copy /Y "%~dp0\File\hpsim_supportautomation.xml"                              		"%SIMInstallPath%\config\Capabilities"  		1>nul
if errorlevel 1 goto rollback
 
:copy ILO.xml
echo [%date% %time%]Copying ILO.xml                                to 	"%SIMInstallPath%\config\Capabilities" 	>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\Capabilities\ILO.xml  "              	"%BackupFolder%\ILO.xml  "  			1>nul 
copy /Y "%~dp0\File\ILO.xml"                                        		"%SIMInstallPath%\config\Capabilities"  1>nul
if errorlevel 1 goto rollback
 
:copy iLO2Links.xml
echo [%date% %time%]Copying iLO2Links.xml                  to 	"%SIMInstallPath%\tools" 		>>%LOGFILE%
copy /Y "%SIMInstallPath%\tools\iLO2Links.xml "              	"%BackupFolder%\iLO2Links.xml"  1>nul 
copy /Y "%~dp0\File\iLO2Links.xml"                            	"%SIMInstallPath%\tools"  		1>nul
if errorlevel 1 goto rollback
 
:copy ilo-wsman-tools.xml
echo [%date% %time%]Copying ilo-wsman-tools.xml            to 	"%SIMInstallPath%\tools"   				>>%LOGFILE%
copy /Y "%SIMInstallPath%\tools\ilo-wsman-tools.xml "           "%BackupFolder%\ilo-wsman-tools.xml"  	1>nul  
copy /Y "%~dp0\File\ilo-wsman-tools.xml"                          "%SIMInstallPath%\tools"  				1>nul
if errorlevel 1 goto rollback
 
:copy telnetTool.xml
echo [%date% %time%]Copying telnetTool.xml                 to 	"%SIMInstallPath%\tools"  			>>%LOGFILE%
copy /Y "%SIMInstallPath%\tools\telnetTool.xml"              	"%BackupFolder%\telnetTool.xml"  	1>nul
copy /Y "%~dp0\File\telnetTool.xml"                            	"%SIMInstallPath%\tools"  			1>nul
if errorlevel 1 goto rollback 

:copy lm_AddLicenseEmpty.jsp
echo [%date% %time%]Copying lm_AddLicenseEmpty.jsp                               		to 	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\lm"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\lm\lm_AddLicenseEmpty.jsp"   	"%BackupFolder%\lm_AddLicenseEmpty.jsp"  				1>nul
copy /Y "%~dp0\File\lm_AddLicenseEmpty.jsp"                                               	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\lm"  1>nul
if errorlevel 1 goto rollback 

:copy MxPortal.jsp
echo [%date% %time%]Copying MxPortal.jsp                                         to 	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\home" 	>>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\home\MxPortal.jsp  "      	"%BackupFolder%\MxPortal.jsp "  							1>nul 
copy /Y "%~dp0\File\MxPortal.jsp"                                                        	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\home"  	1>nul
if errorlevel 1 goto rollback
 
:copy NodeMatchRequest.jsp
echo [%date% %time%]Copying NodeMatchRequest.jsp                                 		to 	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\home" 	>>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\home\NodeMatchRequest.jsp "    	"%BackupFolder%\NodeMatchRequest.jsp"  						1>nul 
copy /Y "%~dp0\File\NodeMatchRequest.jsp"                                                		"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\home"  	1>nul
if errorlevel 1 goto rollback 

:copy NodeSubTypeEnums.properties
echo [%date% %time%]Copying NodeSubTypeEnums.properties              		to 	"%SIMInstallPath%\config\res" 					>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\res\NodeSubTypeEnums.properties "              "%BackupFolder%\NodeSubTypeEnums.properties"  	1>nul 
copy /Y "%~dp0\File\NodeSubTypeEnums.properties"                               	"%SIMInstallPath%\config\res"  					1>nul
if errorlevel 1 goto rollback 

:copy NodeSubTypeEnums_ja.properties
echo [%date% %time%]Copying NodeSubTypeEnums_ja.properties               to 	"%SIMInstallPath%\config\res"  						>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\res\NodeSubTypeEnums_ja.properties "         	"%BackupFolder%\NodeSubTypeEnums_ja.properties"  	1>nul
copy /Y "%~dp0\File\NodeSubTypeEnums_ja.properties"                               "%SIMInstallPath%\config\res"  						1>nul
if errorlevel 1 goto rollback
 
:copy NodeSubTypeEnums_ko.properties
echo [%date% %time%]Copying NodeSubTypeEnums_ko.properties               to "%SIMInstallPath%\config\res"  						>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\res\NodeSubTypeEnums_ko.properties"    	"%BackupFolder%\NodeSubTypeEnums_ko.properties"  	1>nul
copy /Y "%~dp0\File\NodeSubTypeEnums_ko.properties"                   		"%SIMInstallPath%\config\res"  						1>nul
if errorlevel 1 goto rollback
 
:copy NodeSubTypeEnums_zh_CN.properties
echo [%date% %time%]Copying NodeSubTypeEnums_zh_CN.properties           	to 	"%SIMInstallPath%\config\res" 						>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\res\NodeSubTypeEnums_zh_CN.properties"   		"%BackupFolder%\NodeSubTypeEnums_zh_CN.properties"  1>nul 
copy /Y "%~dp0\File\NodeSubTypeEnums_zh_CN.properties"                      		"%SIMInstallPath%\config\res"  						1>nul
if errorlevel 1 goto rollback
 
:copy NodeSubTypeEnums_zh_TW.properties
echo [%date% %time%]Copying NodeSubTypeEnums_zh_TW.properties              to "%SIMInstallPath%\config\res" 						>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\res\NodeSubTypeEnums_zh_TW.properties "      "%BackupFolder%\NodeSubTypeEnums_zh_TW.properties"  	1>nul 
copy /Y "%~dp0\File\NodeSubTypeEnums_zh_TW.properties"                          "%SIMInstallPath%\config\res"  						1>nul
if errorlevel 1 goto rollback
 
:copy WBEMAlertTypeEnum.properties
echo [%date% %time%]Copying WBEMAlertTypeEnum.properties                    to 	"%SIMInstallPath%\config\res" 					>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\res\WBEMAlertTypeEnum.properties "             "%BackupFolder%\WBEMAlertTypeEnum.properties "  1>nul 
copy /Y "%~dp0\File\WBEMAlertTypeEnum.properties"                               	"%SIMInstallPath%\config\res"  					1>nul
if errorlevel 1 goto rollback 

:copy WBEMAlertTypeEnum_ja.properties
echo [%date% %time%]Copying WBEMAlertTypeEnum_ja.properties                  to "%SIMInstallPath%\config\res" 						>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\res\WBEMAlertTypeEnum_ja.properties "          "%BackupFolder%\WBEMAlertTypeEnum_ja.properties"  	1>nul 
copy /Y "%~dp0\File\WBEMAlertTypeEnum_ja.properties"                              "%SIMInstallPath%\config\res"  						1>nul
if errorlevel 1 goto rollback 

:copy WBEMAlertTypeEnum_ko.properties
echo [%date% %time%]Copying WBEMAlertTypeEnum_ko.properties                  to "%SIMInstallPath%\config\res"  						>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\res\WBEMAlertTypeEnum_ko.properties "          "%BackupFolder%\WBEMAlertTypeEnum_ko.properties "  	1>nul
copy /Y "%~dp0\File\WBEMAlertTypeEnum_ko.properties"                              "%SIMInstallPath%\config\res"  						1>nul
if errorlevel 1 goto rollback
 
:copy WBEMAlertTypeEnum_zh_CN.properties
echo [%date% %time%]Copying WBEMAlertTypeEnum_zh_CN.properties                 to 	"%SIMInstallPath%\config\res"  							>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\res\WBEMAlertTypeEnum_zh_CN.properties "         	"%BackupFolder%\WBEMAlertTypeEnum_zh_CN.properties"  	1>nul
copy /Y "%~dp0\File\WBEMAlertTypeEnum_zh_CN.properties"                           	"%SIMInstallPath%\config\res"  							1>nul
if errorlevel 1 goto rollback 

:copy WBEMAlertTypeEnum_zh_TW.properties
echo [%date% %time%]Copying WBEMAlertTypeEnum_zh_TW.properties                to 	"%SIMInstallPath%\config\res"  							>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\res\WBEMAlertTypeEnum_zh_TW.properties"           	"%BackupFolder%\WBEMAlertTypeEnum_zh_TW.properties"  	1>nul
copy /Y "%~dp0\File\WBEMAlertTypeEnum_zh_TW.properties"                           	"%SIMInstallPath%\config\res"  							1>nul
if errorlevel 1 goto rollback 

:copy NoPrinter.rpt
echo [%date% %time%]Copying NoPrinter.rpt                              		to 	"%SIMInstallPath%\reporting\sim\reports"  	>>%LOGFILE%
copy /Y "%SIMInstallPath%\reporting\sim\reports\NoPrinter.rpt "    				"%BackupFolder%\NoPrinter.rpt"  			1>nul
copy /Y "%~dp0\File\NoPrinter.rpt"                                				"%SIMInstallPath%\reporting\sim\reports"  	1>nul
if errorlevel 1 goto rollback 

:copy registration.jsp
echo [%date% %time%]Copying registration.jsp                                to "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\settings"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\settings\registration.jsp"      "%BackupFolder%\registration.jsp"  1>nul
copy /Y "%~dp0\File\registration.jsp"                                                     "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\settings"  1>nul
if errorlevel 1 goto rollback 

:copy Top10EventsHighResolutionTimet.rpt
echo [%date% %time%]Copying Top10EventsHighResolutionTimet.rpt              to "%SIMInstallPath%\reporting\sim\reports"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\reporting\sim\reports\Top10EventsHighResolutionTimet.rpt"       "%BackupFolder%\Top10EventsHighResolutionTimet.rpt"  1>nul
copy /Y "%~dp0\File\Top10EventsHighResolutionTimet.rpt"                                  "%SIMInstallPath%\reporting\sim\reports"  1>nul
if errorlevel 1 goto rollback
 
:copy Top10EventsLowestResolutionTimet.rpt
echo [%date% %time%]Copying Top10EventsLowestResolutionTimet.rpt            to "%SIMInstallPath%\reporting\sim\reports"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\reporting\sim\reports\Top10EventsLowestResolutionTimet.rpt"      "%BackupFolder%\Top10EventsLowestResolutionTimet.rpt"  1>nul
copy /Y "%~dp0\File\Top10EventsLowestResolutionTimet.rpt"                                 "%SIMInstallPath%\reporting\sim\reports"  1>nul
if errorlevel 1 goto rollback 

:copy version.pl
echo [%date% %time%]Copying version.pl                                      to "%SIMInstallPath%\config\rules"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\rules\version.pl"          "%BackupFolder%\version.pl"  1>nul
copy /Y "%~dp0\File\version.pl"                                 "%SIMInstallPath%\config\rules"  1>nul
if errorlevel 1 goto rollback

:copy storageservices.jar
echo [%date% %time%]Copying storageservices.jar       to "%SIMInstallPath%\lib" >>%LOGFILE%
copy /Y "%SIMInstallPath%\lib\storageservices.jar "          "%BackupFolder%\storageservices.jar"  1>nul
copy /Y "%~dp0\File\storageservices.jar"          "%SIMInstallPath%\lib"  1>nul
if errorlevel 1 goto rollback

:copy SDCapacity.jsp
echo [%date% %time%]Copying SDCapacity.jsp      to "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\DevicePage"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\DevicePage\SDCapacity.jsp"          "%BackupFolder%\SDCapacity.jsp"  1>nul
copy /Y "%~dp0\File\SDCapacity.jsp"         "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\DevicePage"  1>nul
if errorlevel 1 goto rollback

:copy globalsettingsupd.tpl
echo [%date% %time%]Copying globalsettingsupd.tpl       to "%SIMInstallPath%\config"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\globalsettingsupd.tpl"          "%BackupFolder%\globalsettingsupd.tpl"  1>nul
copy /Y "%~dp0\File\globalsettingsupd.tpl"          "%SIMInstallPath%\config"   1>nul
if errorlevel 1 goto rollback

:copy flashplayer_win.exe
echo [%date% %time%]Copying flashplayer_win.exe                     to "%SIMInstallPath%\hpwebadmin\webapps\flash_install.war\flash_kits"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\flash_install.war\flash_kits\flashplayer_win.exe"    "%BackupFolder%\flashplayer_win.exe"  1>nul
copy /Y "%~dp0\File\flashplayer_win.exe"                       "%SIMInstallPath%\hpwebadmin\webapps\flash_install.war\flash_kits"  1>nul
if errorlevel 1 goto rollback

:copy flashplayer_winax.exe
echo [%date% %time%]Copying flashplayer_winax.exe                     to "%SIMInstallPath%\hpwebadmin\webapps\flash_install.war\flash_kits"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\flash_install.war\flash_kits\flashplayer_winax.exe"    "%BackupFolder%\flashplayer_winax.exe"  1>nul
copy /Y "%~dp0\File\flashplayer_winax.exe"                       "%SIMInstallPath%\hpwebadmin\webapps\flash_install.war\flash_kits"  1>nul
if errorlevel 1 goto rollback

:copy flashplayer_linux.rpm
echo [%date% %time%]Copying flashplayer_linux.rpm                     to "%SIMInstallPath%\hpwebadmin\webapps\flash_install.war\flash_kits"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\flash_install.war\flash_kits\flashplayer_linux.rpm"    "%BackupFolder%\flashplayer_linux.rpm"  1>nul
copy /Y "%~dp0\File\flashplayer_linux.rpm"                       "%SIMInstallPath%\hpwebadmin\webapps\flash_install.war\flash_kits"  1>nul
if errorlevel 1 goto rollback

:copy flashplayer version.txt
echo [%date% %time%]Copying version.txt                     							to "%SIMInstallPath%\hpwebadmin\webapps\flash_install.war\flash_kits"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\flash_install.war\flash_kits\version.txt"          "%BackupFolder%\version.txt"  1>nul
copy /Y "%~dp0\File\version.txt"                        "%SIMInstallPath%\hpwebadmin\webapps\flash_install.war\flash_kits"  1>nul
if errorlevel 1 goto rollback

:copy loginscript.jsp
echo [%date% %time%]Copying loginscript.jsp      to "%SIMInstallPath%\hpwebadmin\webapps\ROOT"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\loginscript.jsp"          "%BackupFolder%\loginscript.jsp "  1>nul
copy /Y "%~dp0\File\loginscript.jsp"      "%SIMInstallPath%\hpwebadmin\webapps\ROOT" 1>nul
if errorlevel 1 goto rollback

:copy simsearch.war
echo [%date% %time%]Copying simsearch.war      							to 	"%SIMInstallPath%\jboss\server\hpsim\deploy"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\jboss\server\hpsim\deploy\simsearch.war"         "%BackupFolder%\simsearch.war"  1>nul
copy /Y "%~dp0\File\simsearch.war"     										"%SIMInstallPath%\jboss\server\hpsim\deploy" 1>nul
if errorlevel 1 goto rollback

:copy openssh
echo [%date% %time%]Copying cp017273.exe                     to "%SIMInstallPath%\openssh"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\openssh\cp017273.exe"          "%BackupFolder%\cp017273.exe"  1>nul
copy /Y "%~dp0\File\cp017273.exe"                        "%SIMInstallPath%\openssh"  1>nul
if errorlevel 1 goto rollback

:copy storeInfo.bat
echo [%date% %time%]Copying storeInfo.bat                     to 	"%SIMInstallPath%\bin"  		>>%LOGFILE%
copy /Y "%SIMInstallPath%\bin\storeInfo.bat"          				"%BackupFolder%\storeInfo.bat"  1>nul
copy /Y "%~dp0\File\storeInfo.bat"                       			"%SIMInstallPath%\bin"  		1>nul
if errorlevel 1 goto rollback

:copy SimPowerManagement.xml 
echo [%date% %time%]Copying SimPowerManagement.xml        				to 	"%SIMInstallPath%\config\construction"   		>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\construction\SimPowerManagement.xml"		"%BackupFolder%\SimPowerManagement.xml" 	1>nul
copy /Y "%~dp0\File\SimPowerManagement.xml"           	   					"%SIMInstallPath%\config\construction"   		1>nul
if errorlevel 1 goto rollback

:copy identify.xml 
echo [%date% %time%]Copying identify.xml        									to 	"%SIMInstallPath%\config\identification\identifiers"   >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\identification\identifiers\identify.xml"				"%BackupFolder%\identify.xml" 						1>nul
copy /Y "%~dp0\File\identify.xml"           	   											"%SIMInstallPath%\config\identification\identifiers"   1>nul
if errorlevel 1 goto rollback

:copy SimipmCircuit.xml 
echo [%date% %time%]Copying SimipmCircuit.xml        									to 	"%SIMInstallPath%\config\identification\noderelationships"   	>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\identification\noderelationships\SimipmCircuit.xml"		"%BackupFolder%\SimipmCircuit.xml" 							1>nul
copy /Y "%~dp0\File\SimipmCircuit.xml"           	   											"%SIMInstallPath%\config\identification\noderelationships"   	1>nul
if errorlevel 1 goto rollback

:Create SIMIPM\Connectors directiories for new SIM-IPM xml files copying
mkdir "%SIMInstallPath%\config\plugin\SIMIPM\Connectors"   >>%LOGFILE%	2>>&1

:copy Circuit.xml 
echo [%date% %time%]Copying Circuit.xml        											to 	"%SIMInstallPath%\config\plugin\SIMIPM\Connectors"  	>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\plugin\SIMIPM\Connectors\Circuit.xml"						"%BackupFolder%\Circuit.xml" 						1>nul
copy /Y "%~dp0\File\SIMIPM\Connectors\Circuit.xml"           	   								"%SIMInstallPath%\config\plugin\SIMIPM\Connectors"   	1>nul
if errorlevel 1 goto rollback

:copy iLO2.xml 
echo [%date% %time%]Copying iLO2.xml        											to 	"%SIMInstallPath%\config\plugin\SIMIPM\Connectors"   	>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\plugin\SIMIPM\Connectors\iLO2.xml"							"%BackupFolder%\iLO2.xml" 							1>nul
copy /Y "%~dp0\File\SIMIPM\Connectors\iLO2.xml"          	   									"%SIMInstallPath%\config\plugin\SIMIPM\Connectors"   	1>nul
if errorlevel 1 goto rollback

:copy iLO2Integrity.xml 
echo [%date% %time%]Copying iLO2Integrity.xml        									to 	"%SIMInstallPath%\config\plugin\SIMIPM\Connectors"   	>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\plugin\SIMIPM\Connectors\iLO2Integrity.xml"				"%BackupFolder%\iLO2Integrity.xml" 					1>nul
copy /Y "%~dp0\File\SIMIPM\Connectors\iLO2Integrity.xml"           	   						"%SIMInstallPath%\config\plugin\SIMIPM\Connectors"   	1>nul
if errorlevel 1 goto rollback

:copy iLO3ProLiant.xml 
echo [%date% %time%]Copying iLO3ProLiant.xml        									to 	"%SIMInstallPath%\config\plugin\SIMIPM\Connectors"   	>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\plugin\SIMIPM\Connectors\iLO3ProLiant.xml"					"%BackupFolder%\iLO3ProLiant.xml" 					1>nul
copy /Y "%~dp0\File\SIMIPM\Connectors\iLO3ProLiant.xml"           	   						"%SIMInstallPath%\config\plugin\SIMIPM\Connectors"   	1>nul
if errorlevel 1 goto rollback

:Create addfiles directiory for new SIM-IPM hpipmreports.xml file copying
mkdir "%SIMInstallPath%\config\preload-plugins\76\addfiles"   >>%LOGFILE%	2>>&1

:copy hpipmreports.xml 
echo [%date% %time%]Copying hpipmreports.xml        									to 	"%SIMInstallPath%\config\preload-plugins\76\addfiles"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\preload-plugins\76\addfiles\hpipmreports.xml"				"%BackupFolder%\hpipmreports.xml" 					1>nul
copy /Y "%~dp0\File\hpipmreports.xml"           	   											"%SIMInstallPath%\config\preload-plugins\76\addfiles"  1>nul
if errorlevel 1 goto rollback

:copy SimPowerThermalOneDay.rpt  
echo [%date% %time%]Copying SimPowerThermalOneDay.rpt       							to 	"%SIMInstallPath%\reporting\sim\reports"   			>>%LOGFILE%
copy /Y "%SIMInstallPath%\reporting\sim\reports\SimPowerThermalOneDay.rpt"					"%BackupFolder%\SimPowerThermalOneDay.rpt" 			1>nul
copy /Y "%~dp0\File\SimPowerThermalOneDay.rpt"          	   									"%SIMInstallPath%\reporting\sim\reports"   			1>nul
if errorlevel 1 goto rollback

:copy SimPowerThermal7Days.rpt
echo [%date% %time%]Copying SimPowerThermal7Days.rpt       								to 	"%SIMInstallPath%\reporting\sim\reports"   			>>%LOGFILE%
copy /Y "%SIMInstallPath%\reporting\sim\reports\SimPowerThermal7Days.rpt"					"%BackupFolder%\SimPowerThermal7Days.rpt" 			1>nul
copy /Y "%~dp0\File\SimPowerThermal7Days.rpt"          	   	   								"%SIMInstallPath%\reporting\sim\reports"   			1>nul
if errorlevel 1 goto rollback

:copy SimPowerThermalMonth.rpt
echo [%date% %time%]Copying SimPowerThermalMonth.rpt       								to 	"%SIMInstallPath%\reporting\sim\reports"   			>>%LOGFILE%
copy /Y "%SIMInstallPath%\reporting\sim\reports\SimPowerThermalMonth.rpt"					"%BackupFolder%\SimPowerThermalMonth.rpt" 			1>nul
copy /Y "%~dp0\File\SimPowerThermalMonth.rpt"          	   	   								"%SIMInstallPath%\reporting\sim\reports"   			1>nul
if errorlevel 1 goto rollback

:copy SimServerPowerUtilAnalysisV.rpt
echo [%date% %time%]Copying SimServerPowerUtilAnalysisV.rpt       						to 	"%SIMInstallPath%\reporting\sim\reports"   			>>%LOGFILE%
copy /Y "%SIMInstallPath%\reporting\sim\reports\SimServerPowerUtilAnalysisV.rpt"			"%BackupFolder%\SimServerPowerUtilAnalysisV.rpt" 	1>nul
copy /Y "%~dp0\File\SimServerPowerUtilAnalysisV.rpt"          	   							"%SIMInstallPath%\reporting\sim\reports"   			1>nul
if errorlevel 1 goto rollback

:copy SimServerUtilizationV.rpt
echo [%date% %time%]Copying SimServerUtilizationV.rpt       							to 	"%SIMInstallPath%\reporting\sim\reports"   			>>%LOGFILE%
copy /Y "%SIMInstallPath%\reporting\sim\reports\SimServerUtilizationV.rpt"					"%BackupFolder%\SimServerUtilizationV.rpt" 			1>nul
copy /Y "%~dp0\File\SimServerUtilizationV.rpt"          	   									"%SIMInstallPath%\reporting\sim\reports"   			1>nul
if errorlevel 1 goto rollback

:copy sim.properties
echo [%date% %time%]Copying sim.properties       										to 	"%SIMInstallPath%\reporting\sim"   		>>%LOGFILE%
copy /Y "%SIMInstallPath%\reporting\sim\sim.properties"										"%BackupFolder%\sim.properties" 		1>nul
copy /Y "%~dp0\File\sim.properties"          	   												"%SIMInstallPath%\reporting\sim"   		1>nul
if errorlevel 1 goto rollback

:copy sim_en_US.properties
echo [%date% %time%]Copying sim_en_US.properties       									to 	"%SIMInstallPath%\reporting\sim"   		>>%LOGFILE%
copy /Y "%SIMInstallPath%\reporting\sim\sim_en_US.properties"								"%BackupFolder%\sim_en_US.properties" 	1>nul
copy /Y "%~dp0\File\sim_en_US.properties"          	   										"%SIMInstallPath%\reporting\sim"   		1>nul
if errorlevel 1 goto rollback

:copy sim_ja.properties
echo [%date% %time%]Copying sim_ja.properties       									to 	"%SIMInstallPath%\reporting\sim"   		>>%LOGFILE%
copy /Y "%SIMInstallPath%\reporting\sim\sim_ja.properties"									"%BackupFolder%\sim_ja.properties" 		1>nul
copy /Y "%~dp0\File\sim_ja.properties"          	   											"%SIMInstallPath%\reporting\sim"   		1>nul
if errorlevel 1 goto rollback

:copy sim_zh_CN.properties
echo [%date% %time%]Copying sim_zh_CN.properties       									to 	"%SIMInstallPath%\reporting\sim"   		>>%LOGFILE%
copy /Y "%SIMInstallPath%\reporting\sim\sim_zh_CN.properties"								"%BackupFolder%\sim_zh_CN.properties" 	1>nul
copy /Y "%~dp0\File\sim_zh_CN.properties"          	   										"%SIMInstallPath%\reporting\sim"   		1>nul
if errorlevel 1 goto rollback

:copy mgmtproc.jar
echo [%date% %time%]copying mgmtproc.jar                    to 	"%SIMInstallPath%\lib"  		>>%LOGFILE%
copy /Y "%SIMInstallPath%\lib\mgmtproc.jar"    					"%BackupFolder%\mgmtproc.jar"  	1>nul
copy /Y "%~dp0\File\mgmtproc.jar"                      			"%SIMInstallPath%\lib"  		1>nul
if errorlevel 1 goto rollback

:copy hpsim_migrate.xml
echo [%date% %time%]copying hpsim_migrate.xml                    to "%SIMInstallPath%\config\migration"  	>>%LOGFILE%
copy /Y "%SIMInstallPath%\config\migration\hpsim_migrate.xml"    	"%BackupFolder%\hpsim_migrate.xml"  	1>nul
copy /Y "%~dp0\File\hpsim_migrate.xml"                      			"%SIMInstallPath%\config\migration"  	1>nul
if errorlevel 1 goto rollback

:copy proliant-msa-tools.xml
echo [%date% %time%]copying proliant-msa-tools.xml       to "%SIMInstallPath%\tools"  					>>%LOGFILE%
copy /Y "%SIMInstallPath%\tools\proliant-msa-tools.xml"    	"%BackupFolder%\proliant-msa-tools.xml"  	1>nul
copy /Y "%~dp0\File\proliant-msa-tools.xml"                   "%SIMInstallPath%\tools"  					1>nul
if errorlevel 1 goto rollback

:copy mxtools.properties
echo [%date% %time%]copying mxtools.properties       to "%SIMInstallPath%\tools"  				>>%LOGFILE%
copy /Y "%SIMInstallPath%\tools\mxtools.properties"    	"%BackupFolder%\mxtools.properties"  	1>nul
copy /Y "%~dp0\File\mxtools.properties"                   "%SIMInstallPath%\tools"  				1>nul
if errorlevel 1 goto rollback

:copy mxtools_ja.properties
echo [%date% %time%]copying mxtools_ja.properties       to "%SIMInstallPath%\tools"  					>>%LOGFILE%
copy /Y "%SIMInstallPath%\tools\mxtools_ja.properties"    	"%BackupFolder%\mxtools_ja.properties"  	1>nul
copy /Y "%~dp0\File\mxtools_ja.properties"                   "%SIMInstallPath%\tools"  					1>nul
if errorlevel 1 goto rollback

:copy mxtools_ko.properties
echo [%date% %time%]copying mxtools_ko.properties       to "%SIMInstallPath%\tools"  					>>%LOGFILE%
copy /Y "%SIMInstallPath%\tools\mxtools_ko.properties"     "%BackupFolder%\mxtools_ko.properties"  		1>nul
copy /Y "%~dp0\File\mxtools_ko.properties"                   "%SIMInstallPath%\tools"  					1>nul
if errorlevel 1 goto rollback

:copy mxtools_zh_CN.properties
echo [%date% %time%]copying mxtools_zh_CN.properties       		to "%SIMInstallPath%\tools"  					>>%LOGFILE%
copy /Y "%SIMInstallPath%\tools\mxtools_zh_CN.properties"    		"%BackupFolder%\mxtools_zh_CN.properties"  	1>nul
copy /Y "%~dp0\File\mxtools_zh_CN.properties"                   		"%SIMInstallPath%\tools"  					1>nul
if errorlevel 1 goto rollback

:copy mxtools_zh_TW.properties
echo [%date% %time%]copying mxtools_zh_TW.properties       		to "%SIMInstallPath%\tools"  					>>%LOGFILE%
copy /Y "%SIMInstallPath%\tools\mxtools_zh_TW.properties"    		"%BackupFolder%\mxtools_zh_TW.properties"  	1>nul
copy /Y "%~dp0\File\mxtools_zh_TW.properties"                   		"%SIMInstallPath%\tools"  					1>nul
if errorlevel 1 goto rollback

:copy dbExtensions.xml
echo [%date% %time%]Copying dbExtensions.xml							to "%SIMInstallPath%\config\preload\76\addfiles"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\preload\76\addfiles\dbExtensions.xml"      "%BackupFolder%\dbExtensions.xml"  1>nul
copy /Y "%~dp0\File\dbExtensions.xml"      									"%SIMInstallPath%\config\preload\76\addfiles" 1>nul
if errorlevel 1 goto rollback

:copy fwSumExecutor.sh
echo [%date% %time%]Copying fwSumExecutor.sh		to "%SIMInstallPath%\config"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\fwSumExecutor.sh"     "%BackupFolder%\fwSumExecutor.sh"  1>nul
copy /Y "%~dp0\File\fwSumExecutor.sh"      				"%SIMInstallPath%\config" 1>nul
if errorlevel 1 goto rollback

:copy fwupdate.sh
echo [%date% %time%]Copying fwupdate.sh			to "%SIMInstallPath%\config"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\fwupdate.sh"      "%BackupFolder%\fwupdate.sh"  1>nul
copy /Y "%~dp0\File\fwupdate.sh"      				"%SIMInstallPath%\config" 1>nul
if errorlevel 1 goto rollback

:copy ilo.properties
echo [%date% %time%]Copying ilo.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\ilo.properties"      "%BackupFolder%\ilo.properties"  1>nul
copy /Y "%~dp0\File\ilo.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy ilo_en.properties
echo [%date% %time%]Copying ilo_en.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\ilo_en.properties"      "%BackupFolder%\ilo_en.properties"  1>nul
copy /Y "%~dp0\File\ilo_en.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy ilo_ja.properties
echo [%date% %time%]Copying ilo_ja.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\ilo_ja.properties"      "%BackupFolder%\ilo_ja.properties"  1>nul
copy /Y "%~dp0\File\ilo_ja.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy ilo_ko.properties
echo [%date% %time%]Copying ilo_ko.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\ilo_ko.properties"      "%BackupFolder%\ilo_ko.properties"  1>nul
copy /Y "%~dp0\File\ilo_ko.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy ilo_zh_CN.properties
echo [%date% %time%]Copying ilo_zh_CN.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\ilo_zh_CN.properties"      "%BackupFolder%\ilo_zh_CN.properties"  1>nul
copy /Y "%~dp0\File\ilo_zh_CN.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy ilo_zh_TW.properties
echo [%date% %time%]Copying ilo_zh_TW.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\ilo_zh_TW.properties"      "%BackupFolder%\ilo_zh_TW.properties"  1>nul
copy /Y "%~dp0\File\ilo_zh_TW.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy insight_control.properties
echo [%date% %time%]Copying insight_control.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\insight_control.properties"      "%BackupFolder%\insight_control.properties"  1>nul
copy /Y "%~dp0\File\insight_control.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy insight_control_en.properties
echo [%date% %time%]Copying insight_control_en.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\insight_control_en.properties"      "%BackupFolder%\insight_control_en.properties"  1>nul
copy /Y "%~dp0\File\insight_control_en.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy insight_control_ja.properties
echo [%date% %time%]Copying insight_control_ja.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\insight_control_ja.properties"      "%BackupFolder%\insight_control_ja.properties"  1>nul
copy /Y "%~dp0\File\insight_control_ja.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy insight_control_ko.properties
echo [%date% %time%]Copying insight_control_ko.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\insight_control_ko.properties"      "%BackupFolder%\insight_control_ko.properties"  1>nul
copy /Y "%~dp0\File\insight_control_ko.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy insight_control_zh_CN.properties
echo [%date% %time%]Copying insight_control_zh_CN.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\insight_control_zh_CN.properties"      "%BackupFolder%\insight_control_zh_CN.properties"  1>nul
copy /Y "%~dp0\File\insight_control_zh_CN.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy insight_control_zh_TW.properties
echo [%date% %time%]Copying insight_control_zh_TW.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\insight_control_zh_TW.properties"      "%BackupFolder%\insight_control_zh_TW.properties"  1>nul
copy /Y "%~dp0\File\insight_control_zh_TW.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy insightdynamics.properties
echo [%date% %time%]Copying insightdynamics.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\insightdynamics.properties"      "%BackupFolder%\insightdynamics.properties"  1>nul
copy /Y "%~dp0\File\insightdynamics.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy insightdynamics_en.properties
echo [%date% %time%]Copying insightdynamics_en.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\insightdynamics_en.properties"      "%BackupFolder%\insightdynamics_en.properties"  1>nul
copy /Y "%~dp0\File\insightdynamics_en.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy insightdynamics_ja.properties
echo [%date% %time%]Copying insightdynamics_ja.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\insightdynamics_ja.properties"      "%BackupFolder%\insightdynamics_ja.properties"  1>nul
copy /Y "%~dp0\File\insightdynamics_ja.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy insightdynamics_ko.properties
echo [%date% %time%]Copying insightdynamics_ko.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\insightdynamics_ko.properties"      "%BackupFolder%\insightdynamics_ko.properties"  1>nul
copy /Y "%~dp0\File\insightdynamics_ko.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy insightdynamics_zh_CN.properties
echo [%date% %time%]Copying insightdynamics_zh_CN.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\insightdynamics_zh_CN.properties"      "%BackupFolder%\insightdynamics_zh_CN.properties"  1>nul
copy /Y "%~dp0\File\insightdynamics_zh_CN.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy insightdynamics_zh_TW.properties
echo [%date% %time%]Copying insightdynamics_zh_TW.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\insightdynamics_zh_TW.properties"      "%BackupFolder%\insightdynamics_zh_TW.properties"  1>nul
copy /Y "%~dp0\File\insightdynamics_zh_TW.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy rspclient.properties
echo [%date% %time%]Copying rspclient.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\rspclient.properties"      "%BackupFolder%\rspclient.properties"  1>nul
copy /Y "%~dp0\File\rspclient.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy rspclient_en.properties
echo [%date% %time%]Copying rspclient_en.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\rspclient_en.properties"      "%BackupFolder%\rspclient_en.properties"  1>nul
copy /Y "%~dp0\File\rspclient_en.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy rspclient_ja.properties
echo [%date% %time%]Copying rspclient_ja.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\rspclient_ja.properties"      "%BackupFolder%\rspclient_ja.properties"  1>nul
copy /Y "%~dp0\File\rspclient_ja.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy rspclient_ko.properties
echo [%date% %time%]Copying rspclient_ko.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\rspclient_ko.properties"      "%BackupFolder%\rspclient_ko.properties"  1>nul
copy /Y "%~dp0\File\rspclient_ko.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy rspclient_zh_CN.properties
echo [%date% %time%]Copying rspclient_zh_CN.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\rspclient_zh_CN.properties"      "%BackupFolder%\rspclient_zh_CN.properties"  1>nul
copy /Y "%~dp0\File\rspclient_zh_CN.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy rspclient_zh_TW.properties
echo [%date% %time%]Copying rspclient_zh_TW.properties			to "%SIMInstallPath%\config\essentials"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\essentials\rspclient_zh_TW.properties"      "%BackupFolder%\rspclient_zh_TW.properties"  1>nul
copy /Y "%~dp0\File\rspclient_zh_TW.properties"      				"%SIMInstallPath%\config\essentials" 1>nul
if errorlevel 1 goto rollback

:copy en\index.html
echo [%date% %time%]Copying index.html			to "%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\en\content"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\en\content\index.html"      "%BackupFolder%\mxportal\en\content\index.html"  1>nul
copy /Y "%~dp0\File\mxportal\en\content\index.html"      				"%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\en\content" 1>nul
if errorlevel 1 goto rollback

:copy ja\index.html
echo [%date% %time%]Copying index.html			to "%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\ja\content"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\ja\content\index.html"      "%BackupFolder%\mxportal\ja\content\index.html"  1>nul
copy /Y "%~dp0\File\mxportal\ja\content\index.html"      				"%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\ja\content" 1>nul
if errorlevel 1 goto rollback

:copy ko\index.html
echo [%date% %time%]Copying index.html			to "%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\ko\content"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\ko\content\index.html"      "%BackupFolder%\mxportal\ko\content\index.html"  1>nul
copy /Y "%~dp0\File\mxportal\ko\content\index.html"      				"%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\ko\content" 1>nul
if errorlevel 1 goto rollback

:copy zh_CN\index.html
echo [%date% %time%]Copying index.html			to "%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\zh_CN\content"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\zh_CN\content\index.html"      "%BackupFolder%\mxportal\zh_CN\content\index.html"  1>nul
copy /Y "%~dp0\File\mxportal\zh_CN\content\index.html"      				"%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\zh_CN\content" 1>nul
if errorlevel 1 goto rollback

:copy zh_TW\index.html
echo [%date% %time%]Copying index.html			to "%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\zh_TW\content"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\zh_TW\content\index.html"      "%BackupFolder%\mxportal\zh_TW\content\index.html"  1>nul
copy /Y "%~dp0\File\mxportal\zh_TW\content\index.html"      				"%SIMInstallPath%\hpwebadmin\webapps\mxhelp\mxportal\zh_TW\content" 1>nul
if errorlevel 1 goto rollback

:copy actions.properties
echo [%date% %time%]Copying actions.properties			to "%SIMInstallPath%\actions"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\actions\actions.properties"      "%BackupFolder%\actions.properties"  1>nul
copy /Y "%~dp0\File\actions.properties"      			   "%SIMInstallPath%\actions" 1>nul
if errorlevel 1 goto rollback

:copy actions_ja.properties
echo [%date% %time%]Copying actions_ja.properties			to "%SIMInstallPath%\actions"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\actions\actions_ja.properties"       "%BackupFolder%\actions_ja.properties"  1>nul
copy /Y "%~dp0\File\actions_ja.properties"      			   "%SIMInstallPath%\actions" 1>nul
if errorlevel 1 goto rollback

:copy actions_ko.properties
echo [%date% %time%]Copying actions_ko.properties			to "%SIMInstallPath%\actions"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\actions\actions_ko.properties"       "%BackupFolder%\actions_ko.properties"  1>nul
copy /Y "%~dp0\File\actions_ko.properties"      			   "%SIMInstallPath%\actions" 1>nul
if errorlevel 1 goto rollback

:copy actions_zh_CN.properties
echo [%date% %time%]Copying actions_zh_CN.properties			to 	"%SIMInstallPath%\actions"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\actions\actions_zh_CN.properties"       	"%BackupFolder%\actions_zh_CN.properties"  1>nul
copy /Y "%~dp0\File\actions_zh_CN.properties"      			   		"%SIMInstallPath%\actions" 1>nul
if errorlevel 1 goto rollback

:copy actions_zh_TW.properties
echo [%date% %time%]Copying actions_zh_TW.properties			to 	"%SIMInstallPath%\actions"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\actions\actions_zh_TW.properties"       	"%BackupFolder%\actions_zh_TW.properties"  1>nul
copy /Y "%~dp0\File\actions_zh_TW.properties"      			   		"%SIMInstallPath%\actions" 1>nul
if errorlevel 1 goto rollback

:copy ContactList.jsp
echo [%date% %time%]Copying ContactList.jsp			to 	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\DevicePage"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\DevicePage\ContactList.jsp"       	"%BackupFolder%\ContactList.jsp"  1>nul
copy /Y "%~dp0\File\ContactList.jsp"      			   		"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\DevicePage" 1>nul
if errorlevel 1 goto rollback

:copy SiteList.jsp
echo [%date% %time%]Copying SiteList.jsp			to 	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\DevicePage"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\DevicePage\SiteList.jsp"       	"%BackupFolder%\SiteList.jsp"  1>nul
copy /Y "%~dp0\File\SiteList.jsp"      			   		"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\DevicePage" 1>nul
if errorlevel 1 goto rollback

:copy openAddSystems.jsp
echo [%date% %time%]Copying openAddSystems.jsp			to 	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\baselines"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\baselines\openAddSystems.jsp"       	"%BackupFolder%\openAddSystems.jsp"  1>nul
copy /Y "%~dp0\File\openAddSystems.jsp"      			   		"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\baselines" 1>nul
if errorlevel 1 goto rollback

:copy MxPortalCmd.jsp
echo [%date% %time%]Copying MxPortalCmd.jsp			to 	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\home"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\home\MxPortalCmd.jsp"       	"%BackupFolder%\MxPortalCmd.jsp"  1>nul
copy /Y "%~dp0\File\MxPortalCmd.jsp"      			   		"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\home" 1>nul
if errorlevel 1 goto rollback

:copy ManageReports.jsp
echo [%date% %time%]Copying ManageReports.jsp			to 	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\reporting"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\reporting\ManageReports.jsp"       	"%BackupFolder%\ManageReports.jsp"  1>nul
copy /Y "%~dp0\File\ManageReports.jsp"      			   		"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\reporting" 1>nul
if errorlevel 1 goto rollback

:copy AutoDiscoveryList.jsp
echo [%date% %time%]Copying AutoDiscoveryList.jsp			to 	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\settings"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\settings\AutoDiscoveryList.jsp"       	"%BackupFolder%\AutoDiscoveryList.jsp"  1>nul
copy /Y "%~dp0\File\AutoDiscoveryList.jsp"      			   		"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\settings" 1>nul
if errorlevel 1 goto rollback

:copy jobTargetsTable.jsp
echo [%date% %time%]Copying jobTargetsTable.jsp			to 	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\taskandjob"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\taskandjob\jobTargetsTable.jsp"       	"%BackupFolder%\jobTargetsTable.jsp"  1>nul
copy /Y "%~dp0\File\jobTargetsTable.jsp"      			   		"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\taskandjob" 1>nul
if errorlevel 1 goto rollback

:copy scrubSelections.jsp
echo [%date% %time%]Copying scrubSelections.jsp			to 	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\taskandjob"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\taskandjob\scrubSelections.jsp"       	"%BackupFolder%\scrubSelections.jsp"  1>nul
copy /Y "%~dp0\File\scrubSelections.jsp"      			   		"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\taskandjob" 1>nul
if errorlevel 1 goto rollback

:copy targetSelection.jsp
echo [%date% %time%]Copying targetSelection.jsp			to 	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\taskandjob"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\taskandjob\targetSelection.jsp"       	"%BackupFolder%\targetSelection.jsp"  1>nul
copy /Y "%~dp0\File\targetSelection.jsp"      			   		"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\taskandjob" 1>nul
if errorlevel 1 goto rollback

:copy MxTableViewActions.jsp
echo [%date% %time%]Copying MxTableViewActions.jsp			to 	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\ui\jsp"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\ui\jsp\MxTableViewActions.jsp"       	"%BackupFolder%\MxTableViewActions.jsp"  1>nul
copy /Y "%~dp0\File\MxTableViewActions.jsp"      			   		"%SIMInstallPath%\hpwebadmin\webapps\ROOT\ui\jsp" 1>nul
if errorlevel 1 goto rollback

:copy slf4j-nop-1.7.5.jar
echo [%date% %time%]Copying slf4j-nop-1.7.5.jar			to 	"%SIMInstallPath%\lib"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\lib\slf4j-nop-1.7.5.jar"       	"%BackupFolder%\slf4j-nop-1.7.5.jar"  1>nul
copy /Y "%~dp0\File\slf4j-nop-1.7.5.jar"      			   		"%SIMInstallPath%\lib" 1>nul
if errorlevel 1 goto rollback

:copy commons-fileupload.jar
echo [%date% %time%]Copying commons-fileupload.jar			to 	"%SIMInstallPath%\lib"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\lib\commons-fileupload.jar"       	"%BackupFolder%\commons-fileupload.jar"  1>nul
copy /Y "%~dp0\File\commons-fileupload.jar"      			   	"%SIMInstallPath%\lib" 1>nul
if errorlevel 1 goto rollback

:copy globalsettings.tpl
echo [%date% %time%]Copying globalsettings.tpl       		to "%SIMInstallPath%\config"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\config\globalsettings.tpl"           "%BackupFolder%\globalsettings.tpl"  1>nul
copy /Y "%~dp0\File\globalsettings.tpl"          				"%SIMInstallPath%\config"   1>nul
if errorlevel 1 goto rollback

:copy hprepair.exe
echo [%date% %time%]Copying hprepair.exe                     to 	"%SIMInstallPath%\bin"  		>>%LOGFILE%
copy /Y "%SIMInstallPath%\bin\hprepair.exe"          				"%BackupFolder%\hprepair.exe"   1>nul
copy /Y "%~dp0\File\hprepair.exe"                       			"%SIMInstallPath%\bin"  		1>nul
if errorlevel 1 goto rollback

:copy maverick-all.jar
echo [%date% %time%]Copying maverick-all.jar               to 	"%SIMInstallPath%\lib"      		>>%LOGFILE%
copy /Y "%SIMInstallPath%\lib\maverick-all.jar "              	"%BackupFolder%\maverick-all.jar"   1>nul   
copy /Y "%~dp0\File\maverick-all.jar"                        	"%SIMInstallPath%\lib"      		1>nul     
if errorlevel 1 goto rollback

:copy simcli-provider.ear
echo [%date% %time%]Copying simcli-provider.ear      							to 	"%SIMInstallPath%\jboss\server\hpsim\deploy"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\jboss\server\hpsim\deploy\simcli-provider.ear"         "%BackupFolder%\simcli-provider.ear"  1>nul
copy /Y "%~dp0\File\simcli-provider.ear"     										"%SIMInstallPath%\jboss\server\hpsim\deploy" 1>nul
if errorlevel 1 goto rollback

:copy raapis_persistence.jar
echo [%date% %time%]Copying raapis_persistence.jar               to "%SIMInstallPath%\lib"      		 	>>%LOGFILE%
copy /Y "%SIMInstallPath%\lib\raapis_persistence.jar "              "%BackupFolder%\raapis_persistence.jar" 1>nul   
copy /Y "%~dp0\File\raapis_persistence.jar"                        	"%SIMInstallPath%\lib"      			1>nul     
if errorlevel 1 goto rollback

echo [%date% %time%]Copying raapis_persistence.jar      		to 	"%SIMInstallPath%\jboss\server\hpsim\deploy"  	>>%LOGFILE%
copy /Y "%~dp0\File\raapis_persistence.jar"     					"%SIMInstallPath%\jboss\server\hpsim\deploy" 	1>nul
if errorlevel 1 goto rollback

:copy osidentify
echo [%date% %time%]Copying osidentify               to "%SIMInstallPath%\lbin"     >>%LOGFILE%
copy /Y "%SIMInstallPath%\lbin\osidentify "              "%BackupFolder%\osidentify" 1>nul   
copy /Y "%~dp0\File\osidentify"                        	"%SIMInstallPath%\lbin"     1>nul     
if errorlevel 1 goto rollback

:copy repairlinux
echo [%date% %time%]Copying repairlinux               to "%SIMInstallPath%\lbin"       	>>%LOGFILE%
copy /Y "%SIMInstallPath%\lbin\repairlinux "              "%BackupFolder%\repairlinux"  	1>nul   
copy /Y "%~dp0\File\repairlinux"                        	"%SIMInstallPath%\lbin"     1>nul     
if errorlevel 1 goto rollback

:copy iLO2Links.jsp
echo [%date% %time%]Copying iLO2Links.jsp			to 	"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\bladeime\tabs\toolsLinks"  >>%LOGFILE%
copy /Y "%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\bladeime\tabs\toolsLinks\iLO2Links.jsp"       	"%BackupFolder%\iLO2Links.jsp"  1>nul
copy /Y "%~dp0\File\iLO2Links.jsp"      			   		"%SIMInstallPath%\hpwebadmin\webapps\ROOT\mxportal\bladeime\tabs\toolsLinks" 1>nul
if errorlevel 1 goto rollback

:copy vimservice.jar
echo [%date% %time%]Copying vimservice.jar               to "%SIMInstallPath%\lib"      		 	>>%LOGFILE%
copy /Y "%SIMInstallPath%\lib\vimservice.jar "              "%BackupFolder%\vimservice.jar" 1>nul   
copy /Y "%~dp0\File\vimservice.jar"                        	"%SIMInstallPath%\lib"      			1>nul     
if errorlevel 1 goto rollback

echo [%date% %time%]Copying vimservice.jar      		to 	"%SIMInstallPath%\jboss\server\hpsim\deploy\vimservice.sar"  	>>%LOGFILE%
copy /Y "%~dp0\File\vimservice.jar"     					"%SIMInstallPath%\jboss\server\hpsim\deploy\vimservice.sar" 	1>nul
if errorlevel 1 goto rollback

:Hotfix jars
echo [%date% %time%]Copying HOTFIX76_001.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE% 
Copy /Y "%~dp0\File\HOTFIX76_001.jar"              			"%SIMInstallPath%\patch"  	1>nul
echo [%date% %time%]Copying HOTFIX76_002.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_002.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_003.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_003.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_004.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_004.jar"              			"%SIMInstallPath%\patch"  	1>nul
echo [%date% %time%]Copying HOTFIX76_005.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_005.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_006.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_006.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_007.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_007.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_008.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_008.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_009.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_009.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_010.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_010.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_011.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_011.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_012.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_012.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_013.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_013.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_014.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_014.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_015.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_015.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_016.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_016.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_017.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_017.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_018.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_018.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_019.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_019.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_020.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_020.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_021.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_021.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_022.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_022.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_023.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_023.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_024.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_024.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_025.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_025.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_026.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_026.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_027.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_027.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_028.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_028.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_029.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_029.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_030.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_030.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_031.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_031.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_032.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_032.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_033.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_033.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_034.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_034.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_035.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_035.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_036.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_036.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_037.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_037.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_038.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_038.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_039.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_039.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_040.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_040.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_041.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_041.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_042.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_042.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_043.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_043.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_044.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_044.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_045.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_045.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_046.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_046.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_047.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_047.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_048.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_048.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_049.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_049.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_050.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_050.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_051.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_051.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_052.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_052.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_053.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_053.jar"              			"%SIMInstallPath%\patch" 	1>nul
echo [%date% %time%]Copying HOTFIX76_054.jar             to "%SIMInstallPath%\patch"  	>>%LOGFILE%
Copy /Y "%~dp0\File\HOTFIX76_054.jar"              			"%SIMInstallPath%\patch" 	1>nul

:copy linuxagents
echo [%date% %time%]Copying linuxagents		             to "%SIMInstallPath%\linuxagents"  	>>%LOGFILE%
xcopy /Y /R "%SIMInstallPath%\linuxagents"       			"%BackupFolder%\linuxagents" /s 	1>nul 
xcopy /Y /R "%~dp0\File\linuxagents"		                    "%SIMInstallPath%\linuxagents" /s 	1>nul
if errorlevel 1 goto rollback

:copy hpsum.tar.gz
echo [%date% %time%]Copying hpsum.tar.gz                 to "%SIMInstallPath%\linuxagents"  	>>%LOGFILE%
copy /Y "%SIMInstallPath%\linuxagents\hpsum.tar.gz "        "%BackupFolder%\hpsum.tar.gz"  		1>nul
copy /Y "%~dp0\File\hpsum.tar.gz"                          	"%SIMInstallPath%\linuxagents"  	1>nul
if errorlevel 1 goto rollback

:copy smartcomponents
echo [%date% %time%]Copying smartcomponents	             to "%SIMInstallPath%\smartcomponents"  	>>%LOGFILE%
xcopy /Y /R  "%SIMInstallPath%\smartcomponents"        		"%BackupFolder%\smartcomponents" /s 	1>nul 
xcopy /Y /R "%~dp0\File\smartcomponents"		                "%SIMInstallPath%\smartcomponents" /s 	1>nul 
if errorlevel 1 goto rollback 

:copy win
echo [%date% %time%]Copying win		                   	to 	"%SIMInstallPath%\hpsum"  		>>%LOGFILE%
xcopy /Y /R  "%SIMInstallPath%\hpsum"     					"%BackupFolder%\hpsum" /s 		1>nul
xcopy /Y /R  "%~dp0\File\win"		             				"%SIMInstallPath%\hpsum" /s 	1>nul
if errorlevel 1 goto rollback 

:copy mibs
echo [%date% %time%]Copying mibs		                to 	"%SIMInstallPath%\mibs"  		>>%LOGFILE%
xcopy /Y /R  "%SIMInstallPath%\mibs"          				"%BackupFolder%\mibs"/s 		1>nul
xcopy /Y /R  "%~dp0\File\mibs"		              			"%SIMInstallPath%\mibs" /s 		1>nul
if errorlevel 1 goto rollback

:copy preloadm
echo [%date% %time%]Copying preloadm		                to 	"%SIMInstallPath%\preloadm"  		>>%LOGFILE%
xcopy /Y /R  "%SIMInstallPath%\preloadm"          				"%BackupFolder%\preloadm"/s 		1>nul
xcopy /Y /R  "%~dp0\File\preloadm"		              			"%SIMInstallPath%\preloadm" /s 		1>nul
if errorlevel 1 goto rollback

echo [%date% %time%]All files copied successfully   >>%LOGFILE%

::Deleting Existing registry
REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Hewlett-Packard\Systems Insight Manager\Settings" /v LRversion >NUL 2>&1 
if %ERRORLEVEL%==0 (
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Hewlett-Packard\Systems Insight Manager\Settings" /v LRversion /f >NUL 2>&1 
echo [%date% %time%] Registry deleted     >>%LOGFILE%
) else (
echo [%date% %time%] Registry not found   >>%LOGFILE%
)

REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Hewlett-Packard\Systems Insight Manager\Settings" /v LRversion >NUL 2>&1 
if %ERRORLEVEL%==0 (
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Hewlett-Packard\Systems Insight Manager\Settings" /v LRversion /f >NUL 2>&1 
echo [%date% %time%] Registry deleted     >>%LOGFILE%
) else (
echo [%date% %time%] Registry not found   >>%LOGFILE%
)

echo [%date% %time%]Updating Registry to LR:        >>%LOGFILE% 
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Hewlett-Packard\Systems Insight Manager\Settings" /v "LRversion" /t REG_SZ /d 7.6.4 /f  1>nul
echo [%date% %time%]Installation completed successfully.                                                  >>%LOGFILE%
echo Installation completed successfully.
echo.
echo Success>"%OUTPUT%"

exit /B %ERROELEVEL%   

:rollback
echo [%date% %time%]Failed to install,see %LOGFILE% for details.   >>%LOGFILE% 
echo Failed to install,see %LOGFILE% for details.
echo Fail>"%OUTPUT%"
call "%~dp0\rollback.bat"
EXIT /B %ERRORLEVEL%
endlocal
