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

Registry Key permissions


5 replies to this topic

BBrownlee

BBrownlee
  • Members
  • 14 posts

Posted 16 June 2003 - 23:00

Hi all,

I need to set my hkcu\software\progname key to be "Everyone - Full Control" during the install. So far I have found 1 post about Regini.exe from a year+ ago. I can't seem to find any good documentation on this file and am afraid that it will only be available on some machines.

I was wondering if there is now some way to set permissions on Registry Keys in NT os' ?

*edit* And, how can I retrieve the current user's SID?

Thanks in advance for any help provided!

Brandon

Edited by BBrownlee, 16 June 2003 - 23:10.


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 17 June 2003 - 01:25

I want to do this for our next product release as well. I was thinking I'd have to break down and write a C++ DLL to do this for me because I'd forgotten about regini. If I can make that work though, then I'll probably just use that.

We'll work through this problem togther though, so don't worry man I got your back. wink.gif

Also, I believe there are IS functions to retrieve the current user's SID, but may I ask why do you need it? Why not just defer to HKCU? unsure.gif
user posted image

BBrownlee

BBrownlee
  • Members
  • 14 posts

Posted 17 June 2003 - 20:15

Heyas.

I need the current SID for this:

Regini.exe will set permissions on an HKCU key only by using the full SID of the user (even the current, logged in user)... I will then be opening each UserHive and setting the keys for the individual users. This part already occurs in my install. This copies the current user's settings into the other user's HKCU (and if I set the permissions on the current user's settings, they'll get copied over too i hope!)

Method behind the madness.

.default never worked for us, by the way.

Brandon

BBrownlee

BBrownlee
  • Members
  • 14 posts

Posted 17 June 2003 - 20:32

Here's my current test that is working manually to set my HKCU

CODE

New.ini

HKEY_USERS\S-1-5-21-1606980848-507921405-1343024091-1003
             software
                 fuglei [1 5 7 17]


I then invoke this by using "regini.exe new.ini" at the command prompt.

This gives my registry key I need access to Administrator, Creator, Everyone, and System group Full Control. There are other security settings with RegIni.exe of course. Search for Regini.doc to find a good walkthrough.

Of course, to make this something that can happen during install I need to find the SID of the user that is installing the product. I'll set this directly before the rest of my code opens the user hives and copies the key into them. That's the idea anyway. Gotta go find some way to get an SID and then have my install write this file and run it. Scary. Unless one could figure out how to use regini.exe on the hkcu without using the SID, which would be ideal.

Brandon

Edited by BBrownlee, 17 June 2003 - 20:37.


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 17 June 2003 - 21:44

Okay, that certainly explains why you need the SID then. However, it looks like I was mistaken about IS having a function to retrieve it. I must have been thinking of some other programming language.

Alright, thanks for the info. I'll look into this further and let you know what I find. Later.
user posted image

PeterFlickinger

PeterFlickinger
  • Members
  • 8 posts

Posted 05 May 2005 - 20:46

Was there any progress made (offline)?
I'd like to know any solutions/deadlocks you had....