appyface Posted March 18, 2009 Report Share Posted March 18, 2009 (edited) Hi Flo, I have a command batch file that Ketarin executes for me, prior to downloading some apps, my "pre-processor". I can make tests in the .bat file (error level and others) that can tell me if there was a problem executing the pre-processor. I'd like to communicate to Ketarin that the pre-processor had an error and to NOT download but show error in the pop-up and/or log file? One possible way I thought of, is to use the 'set' environment variable command during my pre-processor .bat file. If I have a place in the app to tell Ketarin to check for the existence of this environment variable (doesn't exist = no error), if it exists Ketarin could print the contents of it in the log. That's just one idea on how to implement this, I'm sure there are other ways... I just had a pre-processor .bat file fail on me (my fault totally) and of course Ketarin still downloaded the new file as it should have... except that I really didn't want that to happen in this case... d'oh!!!! Thoughts? TIA as always for consideration of 'wishes' --appyface P.S. I did do a few searches and didn't come up with this as already asked or already implemented. Of course if I missed (!) please point out the posts - TIA Edited March 18, 2009 by appyface Link to comment Share on other sites More sharing options...
floele Posted March 18, 2009 Report Share Posted March 18, 2009 An exit code could be a possibility. 0 = OK is the default exit code, so let's use "1" for error and abort. Link to comment Share on other sites More sharing options...
appyface Posted March 23, 2009 Author Report Share Posted March 23, 2009 Hi Flo, Would you give example on how this would be implemented? Can this be switched on or off from the app in Ketarin? I have a universal batch script and for some apps I want Ketarin to obey some sort of abort code, but for other apps I don't want Ketarin to stop. The batch script will still produce error code but Ketarin should keep going in that case. Thoughts? --appyface Link to comment Share on other sites More sharing options...
floele Posted March 23, 2009 Report Share Posted March 23, 2009 Use "exit X" to exit with the code of your choice. Link to comment Share on other sites More sharing options...
appyface Posted March 23, 2009 Author Report Share Posted March 23, 2009 Where is that command placed in Ketarin? Link to comment Share on other sites More sharing options...
floele Posted March 23, 2009 Report Share Posted March 23, 2009 At the end of your script/command. Link to comment Share on other sites More sharing options...
appyface Posted March 23, 2009 Author Report Share Posted March 23, 2009 >>The batch script will still produce error code but Ketarin should keep going in that case. How would this goal be achieved? Link to comment Share on other sites More sharing options...
Stalker Posted March 23, 2009 Report Share Posted March 23, 2009 As far as I understood Ketarin will abort on only exit code 1. You can use non-0, non-1 exit code then. Link to comment Share on other sites More sharing options...
appyface Posted March 23, 2009 Author Report Share Posted March 23, 2009 I think what is missing here, is an understanding of my stated objectives? Maybe it would help to ask everyone to re-read what I have written above, but maybe not... maybe what I want is still not clear? (It is to me, but that's no good if you don't know too LOL.) So, I'll incorporate what I believe is being proposed with the use of exit code 0/1 inside the batch script and I'll state my objectives again... hope this is clearer... Situation: If Ketarin is about to download I have it run a universal batch script first. I'll go ahead and set exit=1 if I have some error detected inside the script. If there is no error, I will set exit=0. I think that is what Flo proposed. Now, here are my objectives again: 1. For some apps I do want Ketarin to notice if exit=1 is set and to abort the download. 2. For other apps I do not want Ketarin to react if exit=1 is coming from the script, I want Ketarin to do the download anyway. This is a decision from Ketarin app, the batch script doesn't know if this time the error should be ignored. #1 is addressed with setting exit code in batch script to '1' and Ketarin watching for a '1'. What about #2? I guess I could pass some dummy parameter from Ketarin into the batch script, and use that to ensure exit=0 so Ketarin won't react to any errors... Is there a cleaner way to achieve BOTH of my objectives? Link to comment Share on other sites More sharing options...
floele Posted March 23, 2009 Report Share Posted March 23, 2009 Why not use two scripts (or switch per command line argument), so that one script always returns 0? Link to comment Share on other sites More sharing options...
appyface Posted March 23, 2009 Author Report Share Posted March 23, 2009 The script I have is at the database level, to run for every app. I'd have to move the script command to each app in order to use different scripts, right? Passing in a dummy parameter to the script, to tell it to output exit=0 no matter what, would be simpler if so. Even simpler would be a tickmark in the app to say "ignore batch exit codes" but I can live with a dummy parameter. Link to comment Share on other sites More sharing options...
floele Posted March 23, 2009 Report Share Posted March 23, 2009 I think that parameters are better. You could also pass the appname to the script and let it decide or whatever else comes into your mind. I just don't want too many options in Ketarin for so specific desires Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now