#151767 - 2005-11-17 09:04 PM
Read a value from the Registry, run a command from dos Could use help!!
|
rhamersley
Fresh Scripter
Registered: 2005-11-09
Posts: 15
Loc: Fort Lauderdale, FL
|
WHat Im trying to accomplish is to verify that the version is 3.5 or less than if so then copy this executable file to the C:\Temp Directory. Then execute the FramePackage. But if this has the 3.5 version already installed on the computer then bypass the installation process and complete the script. Can anyone help me with this issue. The script below doesnt seem to work and from looking at it, it should???? Could use the help Thanks!!!
$ePOAgent=ReadValue('HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\ePolicy Orchestrator\Application Plugins\EPOAGENT3000','Version') ? "Checking for ePOAgent Install" If $ePOAgent<'3.5' ? "Downloading ePO Agent ver 3.5" MD "c:\Temp" Shell "%COMSPEC% /c c:\windows\system32\xcopy.exe " + @LSERVER+ "\netlogon\Utility\ePOAgent\FramePKG.exe C:\temp /e /y /d" ? "Installing ePO Agent ver 3.5" Run "%COMSPEC% /c c:\temp\FramePkg.exe /Install=Agent /Silent" ? "Installation Completed." Else ? "Current ePO Agent Version " + $ePOAgent + " already installed." EndIf EndIf
|
|
Top
|
|
|
|
#151769 - 2005-11-17 09:27 PM
Re: Read a value from the Registry, run a command from dos Could use help!!
|
rhamersley
Fresh Scripter
Registered: 2005-11-09
Posts: 15
Loc: Fort Lauderdale, FL
|
What is the correct copy command in Kixtart
|
|
Top
|
|
|
|
#151771 - 2005-11-17 09:29 PM
Re: Read a value from the Registry, run a command from dos Could use help!!
|
rhamersley
Fresh Scripter
Registered: 2005-11-09
Posts: 15
Loc: Fort Lauderdale, FL
|
The file does not copy down I receive an XCOPY error Failed to initialize properly. Does anyone know what is the correct copy command in KIXTART
|
|
Top
|
|
|
|
#151776 - 2005-11-17 10:03 PM
Re: Read a value from the Registry, run a command from dos Could use help!!
|
rhamersley
Fresh Scripter
Registered: 2005-11-09
Posts: 15
Loc: Fort Lauderdale, FL
|
Could use the help emensly anyone. Lets break this down and let me know if this is correct.
If InGroup ("ALLKIXEPOINSTALL") -
$ePOAgent=ReadValue('HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\ePolicy Orchestrator\Application Plugins\EPOAGENT3000','Version')
? "Checking for ePOAgent Install" If $ePOAgent<'3.5'
? "Downloading ePO Agent ver 3.5" MD "c:\Temp" Shell "%COMSPEC% /c xcopy " + @LSERVER+ "\netlogon\Utility\ePOAgent\FramePKG.exe C:\temp /e /y /d"
? "Installing ePO Agent ver 3.5" Run "%COMSPEC% /c c:\temp\FramePkg.exe /Install=Agent /Silent" <5th run the FramePkg.exe file in a silent mode.>
? "Installation Completed." Else ? "Current ePO Agent Version " + $ePOAgent + " already installed." EndIf EndIf
ALL I CAN SAY IT DOESNT WORK!!!!!
|
|
Top
|
|
|
|
#151777 - 2005-11-17 10:06 PM
Re: Read a value from the Registry, run a command from dos Could use help!!
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
|
Consider your statement: Code:
If $ePOAgent<'3.5' You are forcing the 3.5 to be a string, not a numeric value, by placing it in quotes. I'd certainly get rid of THESE quotes!
Consider, also, that version strings can look like "X.Y.Z", which would be treated as a string. So, "3.4.8" could be "greater" than "3.5" because the string is longer, not because the value is higher. Checking version info can be a black art. You might want to use Split to return only the Major.Minor values, and then compare each of the elements in the array that Split returns. Just one idea of many possible solutions. The key is to know how your data is being represented, so you can compare it accurately.
Glenn
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 1198 anonymous users online.
|
|
|