PDA

View Full Version : SdLogonUserInformation on Win2K



mremars
12-22-2004, 04:58 AM
Is there a workaround to the use of the SdLogonUserInformation function on windows 2000 ? This function works on windows 2003 (I tested it) and on XP (I did not test it, but I found this post : http://community.installshield.com/showthread.php?postid=299219#post299219).
But on windows 2000, the password is always refused !

I tried to use the SdLogonUserBrowse function instead, but my script does not compile. SdLogonUserBrowse is recognized as a keyword by the editor, but not by the compiler ('SdLogonUserBrowse' : undefined identifier C8025).

rmccollam
01-05-2005, 01:16 PM
I'm having similar issues with this function. It works on every environment we've tried it on, both 2000 and 2003, except for one specific domain. In this domain, we can browse for users, but the password is always refused. (Even if attempting to use a local machine account rather than a domain account.)

Adding users *seems* to work from in the installer (at least, the password of the user I created validates) but the user is never actually created, either in the domain or on the local machine.

Anybody have any tips on debugging what's going on? Is there anything on the domain controller that should or shouldn't be set that would cause this behavior?

michaelk
06-21-2005, 06:48 AM
Here's the definitive reason why it doesn't work and a proper solution:

The reason -> The Win API call that is used to validate the user requires powerful permissions in Win2k that are not required in XP or 2003. This is documented by Microsoft at: http://support.microsoft.com/default.aspx?scid=kb;en-us;180548

The solution -> Include "NetApiRT.rul" source code directly in your setup and modify the code so that it doesn't validate the account in Win2K. There is however a little trick to get this source code to compile into your "setup.inx" file though!

You need to add the #ifdef NETAPIRT_OBL statement. This ifdef is surrounding the includes and source code for the SdLogonUserInformation() function (and the others) and so if NETAPIRT_OBL is not defined, at compile time the "NetApiRT.rul" file is basically empty of code. Here's the steps:

(1) Do not add the... <ISProductFolder>\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 <your path>\"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".

For interest, apparently this is the approach that has been taken to solve the problem in InstallShield 11.

Regards,
Mike.

michaelk
02-15-2006, 08:28 AM
> For interest, apparently this is the approach that has
> been taken to solve the problem in InstallShield 11.

For info, InstallShield hasn't made this change in InstallShield 11.5, so I'm not sure why they told me they had? Therefore this feature still remains unusable when run on a Windows 2000 machine without applying the work around documented above!

Mike.

as.turna
04-11-2006, 02:23 AM
Hello Mike,

The following solution is working on Win2k.

Thanx for your help.

sundars
06-08-2006, 10:58 PM
Here's the definitive reason why it doesn't work and a proper solution:

The reason -> The Win API call that is used to validate the user requires powerful permissions in Win2k that are not required in XP or 2003. This is documented by Microsoft at: http://support.microsoft.com/default.aspx?scid=kb;en-us;180548

The solution -> Include "NetApiRT.rul" source code directly in your setup and modify the code so that it doesn't validate the account in Win2K. There is however a little trick to get this source code to compile into your "setup.inx" file though!

You need to add the #ifdef NETAPIRT_OBL statement. This ifdef is surrounding the includes and source code for the SdLogonUserInformation() function (and the others) and so if NETAPIRT_OBL is not defined, at compile time the "NetApiRT.rul" file is basically empty of code. Here's the steps:

(1) Do not add the... <ISProductFolder>\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 <your path>\"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".

For interest, apparently this is the approach that has been taken to solve the problem in InstallShield 11.

Regards,
Mike.

Hi,

I was able to get the NetApiRT.rul file to compile based on the instruction.
Thanx for that. Based on my requirement, when a push button is pressed,
I'm directly invoking SdLogonUserListGroups() (or) SdLogonUserListUsers(). What I see is an error message 'The list is empty', and I'm not able to
cancel out the program. The only way out is Taskmanger -> setup.exe -> End process.

Is there something extra that I need to do here (or) my approach won't work.

SS.

IoanaGoga
01-26-2007, 06:53 AM
Hi,

is this issue solved on InstallShield 12?
Because I cannot create the user neither with the original code, or with the modifications suggested above.

Thanks a million
ioana goga