cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
konstantin
Level 2

Create Windows User

We having problems creating a new windows account as part of the install. Here is what we do:

1. InstallScript MSI project type.
2. Included NetApiRT.obl (before isrt.obl) in build/settings.
3. Used the following as part of the script:

Dlg_SdLogon:
nResult = SdLogonUserInformation(szTitle, szMsg, szAccount, szPassword);
if (nResult = BACK) goto Dlg_SdAskDestPath;
OnLogonUserSetMsiProperties();

From what I can see, everything works properly, I can select a user or successfully fill in the information to create a new user. However, the new user doesn't get created.

Even more, further inversigation showed, that during the install process the user DOES get created and than quickly REMOVED again. Which makes me completely puzzled as to why would InstallShield remove the newly created account at the end of the installation...

Please, I need some guidance to allow users to successfully create (and use) a new windows account, belonging to user selected group...

As usual, the documentation is not very helpful, no practical information or working example found.

Thanks in advance
Konstantin

I understand that there are options to create a custom .NET dll, or call an external command line tool, but the IS build-in functionality should work, shouldn't it? Thus, I am really interested in how to get it to work using IS included functionality.
Labels (1)
0 Kudos
(5) Replies
competent_tech
Level 3

We are experiencing an identical issue in an MSI project using the built-in LogonInformation dialog set. The frustrating thing is that it used to work (in 2010 and earlier versions), so I suspect that something has broken in NetAPI.
0 Kudos
wrun44
Level 4

Did you ever find a way around this?
0 Kudos
jwallenstein
Level 4

Hello,

we are still using Netapi functions to create user accounts.
It makes us free and we know exactly how it does work.
We are also free to set user information and flags.

Regards

Jan
0 Kudos
wrun44
Level 4

Hi Jan,
Yes, it seems that we also need a custom dialog. Could you kindly advise where to start? I created InstallScript msi and imported the sample dialog script and see all needed NetApi calls there, but not sure how to call that (or similar) dialog from my Setup.rul - the dialog is not declared, and if I declare it, it is not seen from Setup.rul anyway, and that script file is #included. I'm missing something. I worked with custom dialogs before, but never used loaded dlls.

Regards,
Wrun.
0 Kudos
wrun44
Level 4

OK, found my answers here http://community.installshield.com/archive/index.php?t-142448.html

(1) Do not add the... \Script\ISRT\Lib\NetApiRT.obl
...statement in your Build->Settings->Link Libraries field.

(2) Take a copy of "NetApiRT.rul" file and insert it into your project. Make the necessary changes to the SdLogonUserInformation() function so that it doesn't call ISNetApiRT.ISNetValidateLogonName(...) under Win2K. Tip: you could also add a pop-up to confirm the password in Win2K, as it is not validated.

(3) Add #include \"NetApiRT.rul" to "Setup.rul".

(2) Add the #define statement... #define NETAPIRT_OBL to "Setup.rul"
...before your #include "ifx.h" statement and the #include "NetApiRT.rul".
0 Kudos