RunProgram retuns only 0 or 2

Got a problem you cannot solve? Try here.
Post Reply
Ton_B
Posts: 115
Joined: Wed Nov 16, 2005 8:34 am
Location: Netherlands
Contact:

RunProgram retuns only 0 or 2

Post 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
Ton Blokhuizen
Tooling Engineer
BMA BV - Netherlands
[i]BMA: leading the way in obstetrical data management
http://www.bma-mosos.nl[/i]
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: RunProgram retuns only 0 or 2

Post 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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply