Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Logon Information Dialog -->Verify Group


3 replies to this topic

DenMori

DenMori
  • Full Members
  • 38 posts

Posted 30 September 2005 - 19:18

My project contains the Logon Information dialog to allow the installer to specify a username and password for use by the one of the application's components. My problem is that I need to ensure that this user is a member of the computer's Administrators group. I looked for some properties to work with, but they seem oriented towards the logged in user.

Has anyone dealt with this before (i.e. validating that a supplied user id is an administrator)?


Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 30 September 2005 - 22:36

I haven't dealt with that problem, but a similar one (outside Windows Installer, detect whether the user is member of an administrator group). You have two problems, first the Administrators group may be localized (eg. "Beheerders" in Dutch) or renamed, and second multiple Administrator groups exist (Local administrators and Domain administrators).

Prepare for low-level coding like C: You'll need to create a DLL, and call a function in it.

For example code that determines the group name, look at http://support.micro...kb;en-us;157234

When you know the group name, you should be able to look up membership with NetGroupEnumUsers or NetUserGetGroups. If you don't care about Windows NT, you can use ADSI functions too.


DenMori

DenMori
  • Full Members
  • 38 posts

Posted 06 October 2005 - 21:37

I located an old DLL that our previous IS guru was using to accomplish this, but I've hit a major snag -- XP. For some bizarre reason, the DLL returns correct results when run w/in a VB App, but when I call it from within my setup, it insists that the supplied user id (mine by the way) is not a member of the local administrators group.

I also tried working with a VB script I found out on the web, but it is giving me the opposite problem : every user Id I specify is thought to be an administrator. Similarly, the vbscript code works correctly w/in a VB app.

It's been years since I did any sort of C programming, so I'm not comfortable with trying to write low-level code. I've been searching for any kind of tools (dlls, vbs, exes) that will help me solve this problem.

DenMori

DenMori
  • Full Members
  • 38 posts

Posted 06 December 2005 - 21:31

Ok, I've managed to get past the issue I was having with verifying whether or not a user was a member of the local Administrators group. Now I'm having a different problem!

I am trying to use the "Add New User" functionality of the LogonInformation dialog to add a new user to the local Administrators group. I select the local machine name as the Domain and Administrators as the group, put in the login id and password.

Everything seems to work fine until the user gets past the Ready To Install dialog. I get a error 1606: Could not access network location Administrators.

Process works ok if I enter an already existing user on the LogonInformation dialog who is already part of the local Administrators group

Target system is XP Pro SP1.

What should I be looking for?? I created a dummy project and it looked like it handled this fine.