cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Nightmare1723
Level 3

To create Windows account

Hi All

I need my InstallShield project to create a new Windows user account for usage by SQL server. How shall I do that?

Thanks, Ilya Druker
Labels (1)
0 Kudos
(7) Replies
RobertDickau
Flexera Alumni

Depending on your needs, perhaps see the help topic "Adding the Ability to Create or Set an Existing User Account".
0 Kudos
nitsev
Level 6

RobertDickau wrote:
Depending on your needs, perhaps see the help topic "Adding the Ability to Create or Set an Existing User Account".


Correct me if I am wrong but that will not CREATE any account, simply show dialogs and save the parameters in some properties?

I'd say that to create an account you must create a custom action that calls an external MSI DLL or similar that does the job. I've done this so if you need it, let me know.

/Frede
0 Kudos
Nightmare1723
Level 3

nitsev wrote:

I'd say that to create an account you must create a custom action that calls an external MSI DLL or similar that does the job. I've done this so if you need it, let me know.

/Frede


Frede

Could you tell me the exact name of that DLL you used to silently create the account and what method is to be called?

Thanks, Ilya
0 Kudos
RobertDickau
Flexera Alumni

Please see the help topic "Adding the Ability to Create or Set an Existing User Account":
InstallShield offers support for setting an existing Windows user account or creating a new one during installation by enabling you to add the appropriate run-time dialogs to your installation.
0 Kudos
Nightmare1723
Level 3

RobertDickau wrote:
Please see the help topic "Adding the Ability to Create or Set an Existing User Account":


Hi Robert

Thank you for your reply.

I have read this section and tried to follow the instruction but
1. after the dialog appears and new user information is typed I don't see that actual account is created.
2. I have been looking for more silent creation of the user account, i.e. without direct intervention of an end user. Till now I have not found any built-in function for that. That's strange, because if there is a dialog box for user account creation, then there should be a built-in function or a function in some attached DLL.

Do you know anything about it?

Ilya
0 Kudos
Simon_Dand
Level 4

Hi Ilya,

You could write an ISScript function that calls the the net user command.

So if you open a Command Prompt on a Windows machine and type "net user /?" you can see how to use this command. Then from your ISScript function you could use something like:

Sprintf (szCommand, "cmd /c net user \"%s\" \"%s\" /ADD" szAccountName, szAccountPassword);
LaunchAppAndWait ( "", szCommand, nOptions );

You can also then use the net command to setup group membership for your newly created account by using:
Sprintf (szCommand, "cmd /c net localgroup \"%s\" \"%s\" /ADD", szGroupName, szAccountName);

Hope this helps

Regards
Simon
0 Kudos
Nightmare1723
Level 3

Simon Dand wrote:
Hi Ilya,

You could write an ISScript function that calls the the net user command.

So if you open a Command Prompt on a Windows machine and type "net user /?" you can see how to use this command. Then from your ISScript function you could use something like:

Sprintf (szCommand, "cmd /c net user \"%s\" \"%s\" /ADD" szAccountName, szAccountPassword);
LaunchAppAndWait ( "", szCommand, nOptions );

You can also then use the net command to setup group membership for your newly created account by using:
Sprintf (szCommand, "cmd /c net localgroup \"%s\" \"%s\" /ADD", szGroupName, szAccountName);

Hope this helps

Regards
Simon


Hi Simon,

That is exactly what I need

Thank you, Ilya
0 Kudos