This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- question
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 22, 2011
10:28 PM
Get Group name from standard Security ID?
I need an InstallScript equivalent of the following function for getting the language-specific "User" group NAME from it's standard windows Security Identifier (S-1-5-32-545).
I need to implement it in InstallScript in a software installer. The problem is that depending on than language of the operating system, the name of the "Users" group can be different.
The company does not want to fork the installations to full language editions, since we don't have enough customers in each. However, if we can make small modifications (like permissions in the language of the operating system here), we can get by.
Anyone of any help? Has anyone seen such a thing? What DLL would be called to engage the functionality? Does the function etNameFromSID() even exist outside of C Sharp?
string GetNameFromSID( SecurityIdentifier sid )
{
NTAccount ntAccount = (NTAccount)sid.Translate( typeof( NTAccount ) );
return ntAccount.ToString();
}
.
I need to implement it in InstallScript in a software installer. The problem is that depending on than language of the operating system, the name of the "Users" group can be different.
The company does not want to fork the installations to full language editions, since we don't have enough customers in each. However, if we can make small modifications (like permissions in the language of the operating system here), we can get by.
Anyone of any help? Has anyone seen such a thing? What DLL would be called to engage the functionality? Does the function etNameFromSID() even exist outside of C Sharp?
string GetNameFromSID( SecurityIdentifier sid )
{
NTAccount ntAccount = (NTAccount)sid.Translate( typeof( NTAccount ) );
return ntAccount.ToString();
}
.
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 23, 2011
04:20 PM
Here is the Windows API function that is needed. I was having trouble finding it on the Microsoft site, but eventually (with the help of someone else at work), it turned up:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa379166%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/aa379166%28v=vs.85%29.aspx
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 20, 2012
07:18 PM
Unfortunately, I cannot prototype the necessary windows API functions successfully in InstallScript. They don't work. Two are required, plus a struct. Installshield seems to be inadquate to the task of implementing the Windows API in this instance. As someone else pointed out, it does not understand string pointers.
prototype BOOL Advapi32.LookupAccountSidA(POINTER, POINTER, POINTER, POINTER, POINTER, POINTER, POINTER);
prototype BOOL Advapi32.ConvertStringSidToSidA(POINTER,POINTER);
And the second function’s second parameter is a pointer to a SID structure.
prototype BOOL Advapi32.LookupAccountSidA(POINTER, POINTER, POINTER, POINTER, POINTER, POINTER, POINTER);
prototype BOOL Advapi32.ConvertStringSidToSidA(POINTER,POINTER);
And the second function’s second parameter is a pointer to a SID structure.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 20, 2012
07:20 PM
Has anyone actually implemented any code successfully with these functions?