TL;DR
If your Microsoft Office installation fails with Error Code: 30015-4 (5) or you’re seeing GetLastError:5 and strange Wi-Fi issues after using the Microsoft Support and Recovery Assistant (SaRA), it’s probably caused by broken Windows folder permissions.
Fix:
- Re-enable permission inheritance on affected folders under
C:\ProgramData\Microsoft\. - Remove any custom user entries (keep SYSTEM, Administrators, Users).
- Reboot and retry the installer.
Common folders to check:
C:\ProgramData\Microsoft\OFFICEC:\ProgramData\Microsoft\WindowsC:\ProgramData\Microsoft\Wlansvc
Symptoms this resolves:
- Office install error 30015-4 (5)
GetLastError:5during app install/uninstall- Wi-Fi forgetting passwords or crashing with stack-based buffer error
- Missing “Forget” / “Properties” options in Wi-Fi menu
Yesterday, what started as a simple plan to upgrade Microsoft Office and clean up unused Chocolatey packages turned into a full-blown Windows permissions disaster.
While reinstalling Office, I ran into this error Error Code: 30015-4 (5) , from there it escalated quickly to more error messages. At that time, I couldn’t install or uninstall any program that used Windows Installer, and even my Wi-Fi not functioning like how it was supposed to.
This post documents how I identified the root cause, which is corrupted system permissions, that was likely caused by Microsoft’s SaRA (Support and Recovery Assistant) tool and how I fixed everything by manually restoring folder permission inheritance.
The Problems
Office Installation Failed
The trouble started when Office refused to install and threw this message: Error Code: 30015-4(5).

Clicking on the online help led me to this page, where it offers an “easy fix” tool, which turns out only to make thing worse.

The tool running successfully, but the same error persisted. At this point, I couldn’t install or uninstall any applications wrapped with Windows Installer (.msi) anymore. The problem then escalated to unrelated installers like Node.js or Visual Studio’s Windows SDK.

Side Effects: WiFi Gone Weird
Strangely, my WiFi started acting up:
- It stopped saving Wi-Fi profiles, so I had to re-enter passwords every time.
- Auto-connect and mobile hotspot features stopped working.
- The Forget and Properties options disappeared when right-clicking a network.
- And most bizarre was a stack-based buffer overrun error appeared when opening Wi-Fi settings.
Right-clicking a connected Wi-Fi network triggered the stack-based buffer overrun.

And as you can see below, the “Forget” and “Properties” options were gone completely.

At this point, it was clear this wasn’t just an Office issue anymore, my Windows system were messed up.
Identifying Root Cause
Searching for Error Code: 30015-4 (5) on Microsoft’s support site didn’t help much. So I looked into the windows system error codes list and found that (5) corresponds to:

That confirmed it was clear that these problems were related to the system permissions.
I started to investigate the folder where all application data is stored/created.
C:\Program Files\C:\Program Files (x86)\C:\ProgramData
While investigating all the folders under C:\ProgramData\ and C:\ProgramData\Microsoft, I noticed that some of the folders only had my user account listed in their security properties.

Normally, the folder permissions under C:\ProgramData should be configured similar to the image below (taken from VirtualBox folder).

With advanced permissions configured like this:

Now that I knew what proper permissions looked like, I could start fixing the broken ones.
Fixing Permissions
Office Installation Error Code: 30015-4 (5)
To fix this, I restored proper inheritance on the Office data folder:
Path:
C:\ProgramData\Microsoft\OFFICE
Fix steps
- Right-click the folder → Properties → Security → Advanced
- Remove any explicit entries for your user account (keep SYSTEM, Administrators, Users).
- Enable Inheritance (This allows the
OFFICEfolder to inherit permissions from its parentMicrosoftfolder).

If you’re not sure about this, do check the other folders’ permissions under the same parent folder. Using this case, then the parent folder is C:\ProgramData\Microsoft\, and the child are any folders under C:\ProgramData\Microsoft\[child].
After applying these changes, I retried the Office installer and it finally worked.

GetLastError:5
Next, I encountered the following error message from chocolatey and node.js:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs GetLastError: 5
Any GetLastError:5, can be resolved using the same method as above, by enabling the inheritance to the affected application folder.
To trace the problem:
- Check the permissions of each parent folder in sequence:
C:\ProgramData\MicrosoftC:\ProgramData\Microsoft\WindowsC:\ProgramData\Microsoft\Windows\Start MenuC:\ProgramData\Microsoft\Windows\Start Menu\Programs
- Identify where inheritance was broken.
- Reenable it, starting from the topmost broken folder.
In my case, the Windows folder had lost its inherited permissions, so I restored it first by enable the inheritance (See “Inherited from” column).

And then, I will revert the Start Menu folder permissions to default, see image below.

Finally inherit the Start Menu folder permissions to the Programs folder.

If you’re unsure what the default permissions should be, try install a clean Windows VM and compare them, it’s much safer than guessing.
Stack-based and WiFi error
If you’re seeing any of these symptoms:
- SystemSettings.exe – System Error (stack overrun message)
- Windows forgets Wi-Fi networks or passwords
- Missing Forget and Properties options in Wi-Fi menu
- Mobile hotspot won’t start
Then the culprit is probably the WLAN service profile folder. In Windows, all Wi-Fi profiles are stored in
C:\ProgramData\Microsoft\Wlansvc\Profiles
If the system doesn’t have write access, it can’t save or load them correctly.
The fix steps are the same
- Right-click
Wlansvcfolder > Properties > Security > Advanced - Remove any users account available
- Enable inheritance, so permissions flow down from
Microsoft - Apply and restart Windows

After that, everything worked again:
- Wi-Fi remembered passwords
- Auto-connect and hotspot worked
- No more stack-based buffer error
- It also fixed the missing options and auto-connect.

Lesson Learned
- Permission issues can cause weird system behavior, even unrelated things like Wi-Fi and installer errors.
- Always check folder inheritance settings before running automated repair tools.
- Use a virtual machine to inspect clean Windows defaults — it’s a great reference for fixing broken permissions.
- Tools like Microsoft SaRA can help in many cases, but sometimes they over-fix things.
End
In the end, restoring folder inheritance fixed all my issues, from Office installation errors to Wi-Fi crashes.
All that chaos just because I wanted to reinstall Office… 🙃. But at least now I understand Windows permissions better than ever.