Subinacl.exe return code in Wise Script
Hello,
In my Wise Script I'm running the subinacl.exe program to set some registry permissions. The subinacl.exe program writes an output text file showing error of 2 if the registry key does not exist. However, I can't seem to find a way to capture that subinacl.exe exit code in my Wise Script. I've tried PROCEXITCODE but that always shows 0 even if I know it fails. Any idea how to capture the return code from subinacl.exe in my Wise Script so I can evaluate it?
In my Wise Script I'm running the subinacl.exe program to set some registry permissions. The subinacl.exe program writes an output text file showing error of 2 if the registry key does not exist. However, I can't seem to find a way to capture that subinacl.exe exit code in my Wise Script. I've tried PROCEXITCODE but that always shows 0 even if I know it fails. Any idea how to capture the return code from subinacl.exe in my Wise Script so I can evaluate it?
0 Comments
[ + ] Show comments
Answers (7)
Please log in to answer
Posted by:
anonymous_9363
14 years ago
Posted by:
timmsie
14 years ago
Posted by:
troy_in_wi
14 years ago
Hello,
I tested ERRORLEVEL in a batch file and it does not change when it fails, it's always zero. So it appears subinacl.exe does not report back to the OS. Right?
I also double-checked PROCEXITCODE in my wise script and that I had the "Wait for Program to Exit" checked. I have it checked, but the output is always zero.
So it appears I can't get a return code from subinacl.exe. I'll have to pursue other routes.
Thanks for your response!
I tested ERRORLEVEL in a batch file and it does not change when it fails, it's always zero. So it appears subinacl.exe does not report back to the OS. Right?
I also double-checked PROCEXITCODE in my wise script and that I had the "Wait for Program to Exit" checked. I have it checked, but the output is always zero.
So it appears I can't get a return code from subinacl.exe. I'll have to pursue other routes.
Thanks for your response!
Posted by:
anonymous_9363
14 years ago
If going the script route, why not go the whole hog and use this DACL script? The function and variable naming is awful but it works.
Posted by:
cygan
14 years ago
Posted by:
WSPPackager
14 years ago
Hi Troy,
If you know the exact path and output file name that gets generated by exe...then you have a way to find the return code by reading the content of the file.
see below lines of code for reference.. we do in our applications.
Read Lines of file %WIN%abc.log into variable LOGTEXT Start Block
If LOGTEXT contains "Error code or whatever you know to check" then
Exit Installation with return code -1
Else
Exit Installation with return code 0
End if
Hope this solves your problem.
Regards,
WSP
If you know the exact path and output file name that gets generated by exe...then you have a way to find the return code by reading the content of the file.
see below lines of code for reference.. we do in our applications.
Read Lines of file %WIN%abc.log into variable LOGTEXT Start Block
If LOGTEXT contains "Error code or whatever you know to check" then
Exit Installation with return code -1
Else
Exit Installation with return code 0
End if
Hope this solves your problem.
Regards,
WSP
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.