Subinacl.exe return code in Wise Script

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)

Posted by: anonymous_9363 12 years ago
Red Belt
1. Test if ERRORLEVEL gets set in a batch file. If it doesn't, then SubInACL isn't returning the error to the OS, making capturing it impossible.
2. Wouldn't it be simpler to alter your WiseScript to test for the key/value's existence and, if not found, create it?
Posted by: timmsie 12 years ago
Fourth Degree Brown Belt
PROCEXITCODE should work

have you got the "Wait for Program to Exit" check box ticked on your execute program action for subinacl.exe

EDIT: What Ian said 2 minutes before me, change the script to check the reg keys before running
Posted by: troy_in_wi 12 years ago
Orange Belt
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: MSIPackager 12 years ago
3rd Degree Black Belt
Perhaps setacl would be more reliable if you don't want to do the script checking?

Posted by: anonymous_9363 12 years ago
Red Belt
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 12 years ago
Fifth Degree Brown Belt
why all this malakee when you are only setting permissions

a single script suggested already ie setacl will do the trick or secedit etc

then your CA will return a code in your log file and job done
Posted by: WSPPackager 12 years ago
Senior Purple Belt
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
Exit Installation with return code 0
End if

Hope this solves your problem.

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ