Windows Updates usually get installed to your PC without hassles. But there are occasions when it requires a bit of work, especially when it comes to compatibility and patches. If you come across such failed update errors, you first have to manually search the error code and then look for troubleshooting steps. All this consumes time. So, Microsoft has come up with a simple solution – SetupDiag.exe.
SetupDiag.exe is a standalone diagnostic tool for finding details about why a Windows 10 upgrade failed to install. If you know, the update process in Windows 10 has been thoroughly streamlined but that doesn’t mean it’s always problem-free and hence, the tool.
How SetupDiag works
SetupDiag.exe requires Microsoft .NET Framework 4 to be installed on your PC. The tool works by examining Windows Setup log files and parse them to find the root cause of a failure to update or upgrade the computer to Windows 10. SetupDiag can be run on the computer that failed to update, or you can export logs from the computer to another location and run SetupDiag in offline mode.
Once you have the tool up and running, it can be used for performing checks and analysis also. Whenever Windows comes across a situation that likely intends to compromise safe system operation, the system halts. This condition is called a bug check. It is also commonly referred to as a-
- System crash
- Kernel error
- Stop error or BSOD
The typical cause for this issue is either a hardware device, hardware driver, or some related software.
If the bug check occurs during an upgrade, Windows Setup extracts a minidump (setupmem.dmp) file.
To debug a setup related bug check, one must:
Specify the /Mode: Offline and /LogsPath parameters and try gathering the setup memory dump file (setupmem.dmp) from the failing system.
Please note: You cannot debug memory dumps in online mode.
You will find Setupmem.dmp under either
depending on when the bug check occurs.
Thereafter, you can install the Windows Debugging Tools on the computer that runs SetupDiag. If you chose to run the tool without parameters, it attempts to locate log files that Windows 10 creates during the upgrade process in the default folders on the device.
The program also creates a results.log file in its directory after the completion of the scanning process. Any upgrade issues encountered are rapidly detected in the log files during parsing.
Apart from the above, SetupDiag creates a zip archive of all log files that it processed and also saves Logs.zip file in the same directory as well.
Lastly, there’s an option to even run SetupDiag.exe in offline mode to parse folders copied from another device.
SetupDiag tool is now included with Windows Setup
In Windows 10 version 2004 and later, SetupDiag tool is included with Windows Setup.
During the upgrade process, Windows Setup will extract all its sources files to the
Now setupdiag.exe is also installed to this folder and in cas the upgrade fails, SetupDiag tool will automatically run to find out why it failed.
In this scenario, the following parameters are used:
The resulting SetupDiag analysis can be found at:
and in the Registry under
- If the upgrade process proceeds normally, the Sources directory including setupdiag.exe is moved under
- If the Windows.old directory is deleted later, setupdiag.exe will also be removed.
For full details on how to use SetupDiag.exe you can read this Microsoft Doc.