Error code running a DOS command.
Posted: Thu Apr 23, 2009 5:39 am
Guys, could someone explain why my snippet below does not work? I check if a file exists and it successfully returns TRUE to variable DLLEXISTS. I then check the variable returned and if it's TRUE I then run a DOS command that renames the file. I do this before the Apply Install is run. If I manually run the command in a DOS window it works and the DOS %errorlevel% result is 0, confirming it works. But if I run the command using the Run Program As statement, it does not. It returns error code -11. I'm a bit stumped. Can anyone explain what I'm doing wrong?
[DEFINE WEB MEDIA P1 - Cache sockets break-fix]
Get Component P1 - Cache sockets break-fix Selection State into Variable SELECTED
if Variable SELECTED Equals TRUE
end
Comment: TO-DO: Insert any additional install commands here
Set Variable DLLEXISTS to
Does File Exist C:\\Program Files\\ACE cache\\ACE.Apollo.Framework.CacheSockets.dll (get result into variable DLLEXISTS)
if Variable DLLEXISTS Equals TRUE
Set Variable COPYRESULT to
Run Program rename "C:\\Program Files\\ACE cache\\ACE.Apollo.Framework.CacheSockets.dll" ACE.Apollo.Framework.CacheSockets.dll.PreP1BreakFix, startup in folder "C:\\Program Files\\ACE cache" (WAIT, get result into variable COPYRESULT)
MessageBox: Copy result, $COPYRESULT$
end
[compiler if Variable BUILDMODE Equals PATCH]
Apply Patch (get result into variable SUCCESS)
[compiler else]
if Variable ADVERTISE Equals TRUE
Apply Advertised (get result into variable SUCCESS)
else
Apply Install (get result into variable SUCCESS)
end
[compiler end]
Set Variable PROGRESS to 100
end
[DEFINE WEB MEDIA P1 - Cache sockets break-fix]
Get Component P1 - Cache sockets break-fix Selection State into Variable SELECTED
if Variable SELECTED Equals TRUE
end
Comment: TO-DO: Insert any additional install commands here
Set Variable DLLEXISTS to
Does File Exist C:\\Program Files\\ACE cache\\ACE.Apollo.Framework.CacheSockets.dll (get result into variable DLLEXISTS)
if Variable DLLEXISTS Equals TRUE
Set Variable COPYRESULT to
Run Program rename "C:\\Program Files\\ACE cache\\ACE.Apollo.Framework.CacheSockets.dll" ACE.Apollo.Framework.CacheSockets.dll.PreP1BreakFix, startup in folder "C:\\Program Files\\ACE cache" (WAIT, get result into variable COPYRESULT)
MessageBox: Copy result, $COPYRESULT$
end
[compiler if Variable BUILDMODE Equals PATCH]
Apply Patch (get result into variable SUCCESS)
[compiler else]
if Variable ADVERTISE Equals TRUE
Apply Advertised (get result into variable SUCCESS)
else
Apply Install (get result into variable SUCCESS)
end
[compiler end]
Set Variable PROGRESS to 100
end