Page 1 of 1

Run Program As - Cannot read result

Posted: Mon Apr 06, 2009 8:40 am
by Bar_BQ
Hi,


I have already read couple of threads about similar problems, but I haven't found solution for that.

I've created for test a small setup, which runs .net application that returns a string value. I can see, that application returns correct value, however this value seems not to be passed to my variable, and in result I get message box with value '0'. Furthermore, when run this setup in debug mode I get result '-11':

[DEFINE WEB MEDIA t]
Comment: My Product Setup Project
Set Variable CSAPP to
Set Variable NUMBER to 1
Define File Bag : D:\\Moje Dokumenty\\Visual Studio 2008\\Projects\\ConsoleApplication1\\ConsoleApplication1\\bin\\Release\\*.*, get runtime location of files into variable CSAPP
Run Program $CSAPP$\\ConsoleApplication.exe (WAIT)
MessageBox: , $NUMBER$


Any idea what's wrong?

Posted: Mon Apr 06, 2009 9:26 am
by bokkie
I created a .Net console application containing this code:

namespace ReturnStatusCode
{
class Program
{
static int Main(string[] args)
{
return args.Length != 0 ? args.Length : int.MinValue;
}
}
}


I then used this code in my test IA project (basic project type)

~InstallAware Clipboard Data~
~Comment~
~{7483D4EF-42D2-4140-A58B-EF8ABECE925C}~
~~
~MessageBox~
~{6FED61FB-9B43-488B-8ADF-A171FE00960D}~
~RESULT~
~$RESULT$~
~0~
~1~
~~
~Run Program~
~{CC29F92C-A516-4DAA-9931-502FDD7F5F9E}~
~$PATHNAME$\\ReturnStatusCode~
~FALSE~
~1 2 3 4 5 6 7 8 9 0~
~TRUE~
~RESULT~
~MessageBox~
~{0A5959DE-A700-4AE5-98A1-F4E6004647B6}~
~PATHNAME~
~$PATHNAME$~
~0~
~1~
~~
~File Bag~
~{B08B2261-9C9C-4534-B6FD-A606700BF15F}~
~"C:\\PHS stuff\\C#\\ReturnStatusCode\\bin\\Debug\\*.*|",FALSE,PATHNAME~
~mFileBagIDE.dll\\mFileBagEXE.dll~
~Set Variable~
~{C091770E-D60F-4166-A496-D171A14A9183}~
~RESULT$MYAH$MYAH$FALSE~
~~
~Set Variable~
~{EC85B1B7-1B27-4A35-8C34-702934AA3A33}~
~PATHNAME$MYAH$MYAH$FALSE~
~~
~Web Media Block~
~{D9DA9AB1-0B8A-4963-AC1A-58CE06EDE5F1}~
~TEST~
~http://~
~FALSE$MYAH_CARET$~


My console application accepts any number of arguments and the status value I return is the number of arguments or int.MinValue if no arguments are used. In my example, using the executable in the file bag does work ok.

Perhaps you'd like to copy-and-paste my example and see how it stacks up on your machine?

Posted: Mon Apr 06, 2009 10:05 am
by Bar_BQ
oh Gee....


My fault, I used console.writeline instead of return in my console application :oops:

Thanks Bookie!

Posted: Mon Apr 06, 2009 10:18 am
by bokkie
Welcome to my world! I've also done that before as well.

Looks like we are both Honorary Muppets.

:lol:

Posted: Mon Apr 06, 2009 10:24 am
by Bar_BQ
"Honorary Muppets", I like it!!! :D