AgentRev / WindowsAppsUnfukker

PowerShell script to fix WindowsApps-related permission errors and crashes.
The Unlicense
356 stars 20 forks source link

Can you add support for repairing the ProgramData/Packages folder too? #18

Closed nasserakhter closed 8 months ago

nasserakhter commented 1 year ago

Hey,

I ran your program and like magic it restored all my apps, except for the windows store. However, I was able to figure out that the permissions on the C:\ProgramData\Packages folder were still the old ones. And that these old permissions were causing the windows store app to not load. So, in order to fix this, I simply copied these permissions:

D:PAI(A;;FA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;OICIIO;GA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;;0x1200a9;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)(A;OICIIO;GXGR;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)(A;;FA;;;SY)(A;OICIIO;GA;;;SY)(A;CI;0x1200a9;;;BA)(A;OICI;0x1200a9;;;LS)(A;OICI;0x1200a9;;;NS)(A;OICI;0x1200a9;;;RC)(XA;;0x1200a9;;;BU;(Exists WIN://SYSAPPID))

to the ProgramData\Packages folder and then set the owner to nt service\trustedinstaller and it worked!

Just opening this issue so the tool can be updated to also fix permissions for the Packages folder, which should help people who had a similar problem as mine.

ChaosAndCoffee commented 10 months ago

Hey,

I ran your program and like magic it restored all my apps, except for the windows store. However, I was able to figure out that the permissions on the C:\ProgramData\Packages folder were still the old ones. And that these old permissions were causing the windows store app to not load. So, in order to fix this, I simply copied these permissions:

D:PAI(A;;FA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;OICIIO;GA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;;0x1200a9;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)(A;OICIIO;GXGR;;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)(A;;FA;;;SY)(A;OICIIO;GA;;;SY)(A;CI;0x1200a9;;;BA)(A;OICI;0x1200a9;;;LS)(A;OICI;0x1200a9;;;NS)(A;OICI;0x1200a9;;;RC)(XA;;0x1200a9;;;BU;(Exists WIN://SYSAPPID))

to the ProgramData\Packages folder and then set the owner to nt service\trustedinstaller and it worked!

Just opening this issue so the tool can be updated to also fix permissions for the Packages folder, which should help people who had a similar problem as mine.

Hi, could you please explain what you mean by "copied these permissions:" ? I know how to change the owner but I have no idea how/where I copy those permissions.

Thanks in advance

Hoernchen commented 8 months ago

I'd appreciate it if someone would add this, I spend quite some time wondering what was missing until I copied the programdata acls from a different system....

AgentRev commented 8 months ago

Fixed: ba5df32

The proper owner is SYSTEM and not TrustedInstaller, but I also granted "Full control" to TrustedInstaller, so hopefully it should have the same effect.