|
|
#1 |
|
Junior Member
Join Date: Nov 2015
Posts: 4
|
Registry writes fail quietly in Win7 x64
I'm trying to make a few adjustments to explorer on Windows 7 Ultimate x64 with that following registry writes (this removes the damn homegroup)
code: But the writes silently fail. Using Process Monitor i can see that they fail with access denied. Shouldn't there at least be an error message? Turns out Administrator doesn't have write access to the keys. TrustedInstaller it is the only "user" that has access. Is there something I'm doing wrong, or is there a bug in NSIS? Shouldn't the installer automatically be run under the TrustedInstaller account? |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
No, TrustedInstaller is Microsoft exclusive special user account that exists to make it harder for people to change Windows system files and settings. RequestExecutionLevel admin only gets you a integrity level of high, there are two levels above this.
You need to use the AccessControl plugin to take ownership of the key and give yourself write access before you can write. Ideally you should restore the ACL and owner when you are done... IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Nov 2015
Posts: 4
|
I had a feeling it was going to be something like that :-(
So no way to trick Windows into thinking the installer was for XP or older so it would be run in some kind of compatibility mode with full registry access? Is there a suggestions forum somewhere? Cause taking care of standard access problems for registry writes seem very much like something NSIS should be doing automatically. |
|
|
|
|
|
#4 | |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
Quote:
NSIS is always going to stay within the restrictions set out by Microsoft, I'm sorry but that's the way it is. You are free to write your own code that does the job though. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
|
#5 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
This is not a standard access problem, Microsoft changed the owner of these keys to stop people from changing them. You face the same issue if you try to do it with regedit. I already told you how to get around it in my first reply...
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Nov 2015
Posts: 4
|
I'd still like to bring the issue to the attention of the developers, modifying the registry is absolutely basic installer functionality, it shouldn't be necessary to go through a ton of trouble to get it done.
|
|
|
|
|
|
#7 | |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
Quote:
You are doing special things here that Microsoft don't really want you to do, some extra speed bumps should be expected. IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
|
#8 | |
|
Junior Member
Join Date: Nov 2015
Posts: 4
|
Yes, but I'm not trying to edit the registry or make a registry editor! I'm trying to create an installer and installers create and modify registry keys. And even Regedit will modify the registry without changing access rights if you just save your changes in a .reg file!
Quote:
But perhaps the real problem is the RequestExecutionLevel directive? Apparently TrustedInstaller rather than Administrator is the correct user account for installers on all windows versions newer than 7. |
|
|
|
|
|
|
#9 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
A quick google search on this 'TrustedInstaller' shows that it's for Windows Update and System Resource Protection, nothing else. So as far as I can see, only specific tools from Microsoft can use the TrustedInstaller privilege because it modifies the systems files that make the OS work. So I can see why the TrustedInstaller privilege is so restricted, they don't want hackers using it to corrupt the system and cause loss of data, I guess this includes HomeGroup as it's part of the system files.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
![]() |
|
|||||||
| Tags |
| win7 registry x64 |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|