File and registry permissions
Sometimes we have to raise the white flag. Some programs are poorly written and no matter how you repackage or tweak the installation, regular users can’t run them.
The last resort is opening up the problematic folder or registry key so that the program can do it’s thing.
Two great commands for doing this is: setACL.exe and icacls.exe
Icacls is built into Windows 7 but setACL is not. It’s available as both x86 and x64 from various sources on the internet https://helgeklein.com/download/#
Grant builtin_users full permissions in registry
setacl32.exe" -on "HKLM\SOFTWARE\Classes\StupidKey" -ot reg -actn ace -ace "n:S-1-5-32-545;p:full"
Grant authenticated users modify permission to folder and subfolders
icacls.exe "%PROGRAMFILES%\StupidProgram" /grant *S-1-5-11:(OI)(CI)(M) /C /Q