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?
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

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

Answers

0
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?
Answered 04/15/2010 by: VBScab
Red Belt

Please log in to comment
0
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
Answered 04/15/2010 by: timmsie
Fourth Degree Brown Belt

Please log in to comment
0
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!
Answered 04/15/2010 by: troy_in_wi
Orange Belt

Please log in to comment
0
Perhaps setacl would be more reliable if you don't want to do the script checking?

Cheers,
Rob.
Answered 04/15/2010 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
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.
Answered 04/15/2010 by: VBScab
Red Belt

Please log in to comment
0
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
Answered 04/15/2010 by: cygan
Fifth Degree Brown Belt

Please log in to comment
0
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
Answered 04/15/2010 by: WSPPackager
Senior Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity