Page 1 of 1
Run Program returns -11 or 256 as Return Result in Variable
Posted: Mon Nov 24, 2008 10:35 am
by voiid
No matter if I use Run-Program or Run-Program-As, the return result variable always contains only 256 or -11. I tested it with 3 different win32 console exe. I have to use a company tool which determines specific settings on customer machines. It returns an integer value between -2 and 6 depending on certain criterias. When I test the app with a batch file (ECHO %ERRORLEVEL%) it returns 2 for this development machine. As soon as I call this console app via Run-Program in the installer it retuns 256 or -11 but non of the values it should return. I updated my IA Studio version up to 8.01 but no change. I can't rewrite the app to make it an IA plugin, too much source hanging behind. I written a cheap console exe myself, which should simply return an (INT 13), but same FX.
Does anyone have experience with that issue?
Reason found!
Posted: Tue Nov 25, 2008 5:35 am
by voiid
Stay away from localization, I knew that it often causes trouble if you change certain parts in your script without re-localizing.
After the complete removal of the translations, the variable check and the run program return value problem was solved!
I tried to have a german and english setup, but right now, english only is the only way for me to solve the problem.
And yes .. I did, re-translate after all changes, but didn't work.
Posted: Tue Nov 25, 2008 8:21 am
by ulrichard
What I ended up doing is often copying some statements (like if's). And then delete the original. So the new one is not translated until the next translation run.
What happens often is that you change a value to check against in an if statment, which can also be the name of a variable. So you look at the code and think it compares against variable aaa, but behind the scene in the translation it still compares agains some old variable bbb.
I don't understand why if-statements have to be translated anyway.
There are some options regarding the behavior of the translations. I didn't find proper documentation to it, and didn't have time to play with it though.
Rgds
Richard
Translation Engine
Posted: Wed Nov 26, 2008 7:55 am
by voiid
I agree UlRichard. To me it also makes no sense to translate parts of the script itself. Nasty nasty, as C++ programmer I already fight enough with the extreme lack of real coding functionality.
Regards,
voiid
Run Program Returns 259
Posted: Fri Dec 05, 2008 8:41 am
by tj
Did you ever identify why the return value was 256? I'm getting 259 with no localization or translation code. I can verify, as you did with echo, that the console app returns a 15 but I can't get anything other than 259.
Return Value
Posted: Fri Dec 05, 2008 11:07 am
by voiid
Hey TJ,
in your case I would check if my command line is correct.
Maye it contains spaces, in that case I would use something like that:
my.exe "$TARGETDIR\\SOMEFOLDER"
Use \"Wait For Program To Finish\" Checkbox
Posted: Fri Dec 05, 2008 1:04 pm
by tj
I just determined that 259 is a standard exit code.
Simple solution, for me, was to use "Wait For Program To Finish" checkbox to ensure the program had finished updating the return value.
Use \"Wait For Program To Finish\" Checkbox
Posted: Mon Feb 09, 2009 6:39 pm
by colnjackman
I am trying to do something like this as well with a batch file and even with the "Wait for program to finish" checkbox is checked it doesn't seem to work.
I have a very simple batch file that just contains.
@echo off
EXIT /B 1
This should return a non-zero value to IA but it seems that using the Run Program doesn't get this value. Now when I run this from command line, I can check %ERRORVALUE% and it is set to 1.
In IA it always returns 0.
Ideas
Thanks
Colin
Posted: Tue Feb 10, 2009 11:59 am
by MichaelNesmith
Batch files are processed by cmd.exe, they cannot be run natively as they are not executable files.
You can read up about cmd.exe command line parameters to execute batch files.