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:

  1. Re-enable permission inheritance on affected folders under C:\ProgramData\Microsoft\.
  2. Remove any custom user entries (keep SYSTEM, Administrators, Users).
  3. Reboot and retry the installer.

Common folders to check:

  • C:\ProgramData\Microsoft\OFFICE
  • C:\ProgramData\Microsoft\Windows
  • C:\ProgramData\Microsoft\Wlansvc

Symptoms this resolves:

  • Office install error 30015-4 (5)
  • GetLastError:5 during 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).

image-20210721040950497

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.

image-20210721041358098

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.

image-20210718024015408

Side Effects: WiFi Gone Weird

Strangely, my WiFi started acting up:

  1. It stopped saving Wi-Fi profiles, so I had to re-enter passwords every time.
  2. Auto-connect and mobile hotspot features stopped working.
  3. The Forget and Properties options disappeared when right-clicking a network.
  4. 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.

image-20210721050915867

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

image-20210721054401662

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:

image-20210721043547662

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.

image-20210721044802348

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

image-20210721045334784

With advanced permissions configured like this:

image-20210721045624596

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

  1. Right-click the folder → PropertiesSecurityAdvanced
  2. Remove any explicit entries for your user account (keep SYSTEM, Administrators, Users).
  3. Enable Inheritance (This allows the OFFICE folder to inherit permissions from its parent Microsoft folder).

image-20210721051824838

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.

image-20210721053920106

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:

  1. Check the permissions of each parent folder in sequence:
    • C:\ProgramData\Microsoft
    • C:\ProgramData\Microsoft\Windows
    • C:\ProgramData\Microsoft\Windows\Start Menu
    • C:\ProgramData\Microsoft\Windows\Start Menu\Programs
  2. Identify where inheritance was broken.
  3. 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).

image-20210721114505028

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

image-20210721114911619

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

image-20210721115022365

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

  1. Right-click Wlansvc folder > Properties > Security > Advanced
  2. Remove any users account available
  3. Enable inheritance, so permissions flow down from Microsoft
  4. Apply and restart Windows

image-20210721055011183

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.

image-20210721055107535

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.

Reference