How to fix Error 1627 on Windows 11

Troubleshooting Guide: Error 1627 — Function Failed During Execution

Why This Error Happens

Error 1627 typically occurs when a Windows Installer function or scripted custom action fails mid-execution, often due to corrupted installer cache files, insufficient user permissions on system directories, or a conflict with a custom action embedded in an MSI package. This can also be triggered when antivirus or endpoint protection software blocks a function call before it completes, or when the underlying .NET Framework or Windows Installer service is outdated or corrupted.

Step-by-Step Resolution Guide

Step 1: Run the Process with Elevated Permissions

  • Right-click the application or installer executable and select “Run as administrator.”
  • Ensure your Windows 11 user account has full Read/Write access to C:\Windows\Installer and C:\Windows\Temp.
  • If prompted by User Account Control (UAC), select “Yes” to allow the function to execute with elevated rights.

Step 2: Repair the Windows Installer Service

  • Open Command Prompt as Administrator and stop the service using: net stop msiserver
  • Restart the service with: net start msiserver
  • If the issue persists, re-register the installer engine using: msiexec /unregister followed by msiexec /regserver

Step 3: Clear the Corrupted Installer Cache

  • Navigate to C:\Windows\Installer and back up the folder (do not delete it, as this can break other installed apps).
  • Use the Microsoft Program Install and Uninstall Troubleshooter to detect and clear “stuck” or corrupted installer entries automatically.
  • Restart your PC and attempt the function or installation again.

Step 4: Temporarily Disable Third-Party Antivirus

  • Open Windows Security or your third-party AV dashboard and disable “Real-Time Protection” temporarily.
  • Attempt to run the function again to see if the security software was intercepting the executable.
  • Re-enable your antivirus immediately after testing, regardless of the outcome.

Alternative or Verification Steps

  • Verify the Fix: Open the Event Viewer (eventvwr.msc), navigate to Windows Logs > Application, and confirm that Event ID 1627 no longer appears after retrying the function.
  • Alternative Solution: If the error persists, run the System File Checker by typing sfc /scannow in an elevated Command Prompt to repair underlying corrupted system files that might be causing the function to fail.