共用方式為


clusrun.vbs fix to handle name="value" parameters

I want to install an application on a CCS cluster nodes using MSIEXEC. I use clusrun while have the package available on a share. i want the installation target to be at C:\Program Files\product name location on all nodes.

 

clusrun hangs when I give TARGETDIRECTORY="Program Files\product name" as a parameter for MSIEXEC. A simple workaround I used:

 

change the clusrun.vbs as follows -

(look at <CCP ROOT>\bin\ for clusrun.vbs).

 

you need to look at the part that processes supplied arguments in the commnd line (line 101 through 144). It should be as follows.

 

 

for i=0 to objArgs.Count - 1
if Left(objArgs(i),1) <> "/" then

if schedname="" then
set wshShell = Wscript.CreateObject ("WScript.Shell")
set WshEnv = WshShell.Environment("Process")
schedname = WshEnv("CCP_SCHEDULER")
if schedname="" then
schedname = "localhost"
end if
end if

'
' build the command line out of everything left
'
for j = i to objArgs.Count - 1
'if the argument contains a space then add quotes to maintain the structure

 

if InStr(objArgs(j), " ") = 0 then
cmdline = cmdline + objArgs(j) + " "
else
cmdline = cmdline + Replace(objArgs(j),"=","=""") + """ "
end if

         next
task.CommandLine = cmdline
exit for

      end if

 

I could successfully use MSIEXEC with name value parameter and quotes as well as spaces.

 

Note: One way to overcome situations of having space in paramter is to place the command within a batch file and execute the batch file using clusrun or job submit.