Page 1 of 1

RunProgram retuns only 0 or 2

Posted: Wed Jun 06, 2012 6:36 am
by Ton_B
I need to create a Local Usergroup on my system during install.

The commandprompt is : c:\NET LOCALGROUP MososUsers /ADD /COMMENT:"MososUsers"

This works fine.
And you can see in the dos-box a errorcode if anything went wrong.

This returncode is excalty what I need in IA.
So I put it in the RunProgram box as shown below:

Code: Select all

~InstallAware Clipboard Data~
~Run Program~
~{245DBE97-0969-4845-8330-0097F723C570}~
~NET~
~FALSE~
~LOCALGROUP MososUsers /ADD /COMMENT:"MososUsers" /DOMAIN~
~TRUE~
~NETGROUP~
Unfortuanally The only returnvalues I receive is 0 (assumes success) or 2 if anything went wrong, but not knowing what went wrong.
I need the errrocode so I can deside it the setup can continue or if it should quit.
In case the usergrou existst, everything is oke, but if any other error occurs i need to terminate or do something else.

please advice

Ton

Re: RunProgram retuns only 0 or 2

Posted: Wed Jun 06, 2012 9:34 am
by FrancescoT
Dear Ton,

Unfortunately, using NET command there isn't much to do. It returns just those two values.

Very probably the only possible way to have more detailed infos, it is to create a native DLL or an EXE that wraps User creation via WIN API functions.

I do exactly the same in similar circumstances.

I'm sorry but I do not think there are other possibilities.

Regards