tiny11builder icon indicating copy to clipboard operation
tiny11builder copied to clipboard

Registry access error

Open BolteDev opened this issue 9 months ago • 5 comments

Using latest script and a clean ISO from UUP (22631.3527 - 23H2) getting the below error in the log.

False
MethodInvocationException: D:\Tiny11\tiny11maker.ps1:284
Line |
 284 |  $regKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("zSOFTW …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "OpenSubKey" with "3" argument(s): "Requested registry access is not allowed."
MethodInvocationException: D:\Tiny11\tiny11maker.ps1:284
Line |
 284 |  $regKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("zSOFTW …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "OpenSubKey" with "3" argument(s): "Requested registry access is not
     | allowed."

tiny11.log

BolteDev avatar May 04 '24 13:05 BolteDev

Just to add to this, I swapped out the system drive and all instances of it for D: drive to ensure its not permissions related, same issue.

The other registry commands complete OK. It just seems to fall over when it reaches

$regKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("zSOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks",[Microsoft.Win32.RegistryKeyPermissionCheck]::ReadWriteSubTree,[System.Security.AccessControl.RegistryRights]::TakeOwnership)

BolteDev avatar May 05 '24 08:05 BolteDev

Ok, so I ran this with windows Powershell, instead of Powershell Core, and it was able to complete successfully without the mentioned error.

BolteDev avatar May 05 '24 15:05 BolteDev

I actually noticed that there is a difference when running the script from Terminal (as it cannot takeown the registry keys - maybe a sandbox measure?) compared to running it by right-clicking and selecting "run with PowerShell", where it runs just fine

ntdevlabs avatar May 05 '24 15:05 ntdevlabs

I still ran it in Terminal, just using the Windows Powershell profile

BolteDev avatar May 05 '24 16:05 BolteDev

I actually noticed that there is a difference when running the script from Terminal (as it cannot takeown the registry keys - maybe a sandbox measure?) compared to running it by right-clicking and selecting "run with PowerShell", where it runs just fine

#198 Related... If you run the script via cmd "Home" edition will not finish correctly, but with "run with powershell" it not have any problem

ebuwiz avatar May 30 '24 06:05 ebuwiz