Tips & Tricks: DebugDiag 1.2
A few years ago, I was lucky enough to have a very small hand in the birth of DebugDiag. In version 1.0, I got to do some work on the analysis scripts, as well as work on one of the debugger extensions it uses for analysis. As a result of the time I spent working on it, it’s still one of my favorite troubleshooting tools.
Since the original release of the tool, the team who owns it has done some great things with it, which I’m sure included fixing and/or replacing my hacky code. I freely admit that I’m no coder by any stretch, and have no real ambition to be one. I enjoy pulling code apart far more than I do writing it... Back on topic, one of the improvements that came with the release of v1.2 is something that doesn’t appear to have received much attention, yet can be incredibly useful for enterprise environments that have strict rules around full blown installation of tools on production servers. I’m specifically referring to the XCopy deployment feature mentioned at the bottom of the download page:
http://www.microsoft.com/download/en/details.aspx?id=26798
Enterprise deployment support using XCopy and Register.bat.
This means that you no longer have to run the installer on each server you want to install DebugDiag on. You can simply extract the package, copy the resulting files to your target server manually, run a simple batch file, and go!
To start, you need to extract the contents of the MSI, using a command similar to this:
msiexec /a PathToMSIFile /qb TARGETDIR=DirectoryToExtractTo
Using that example, let’s assume I’ve downloaded the x64 version of DebugDiag to a d:\debugdiag directory on my computer, and wanted to extract the contents to d:\debugdiag\flat. The command would look like this:
msiexec /a d:\debugdiag\debugdiagx64.msi /qb TARGETDIR=d:\debugdiag\flat
At that point, I should have the extracted files required for DebugDiag to run located under D:\DebugDiag\flat\DebugDiag. Now you should have all you need to deploy the tool to any server in your environment. You can simply store the files out on a common share on the network that your administrators can get to for use later.
Now, what if you need to actually deploy it out to a server to troubleshoot some sort of issue? Easy enough, just grab the folder with the extracted DebugDiag files, and copy it to a folder on your target server. Once you’ve copied it over, you can run the included register.bat file to set up the dbgsvc service and register the necessary files. Be sure to run this file from an elevated command prompt. Taking a quick look at what register.bat does:
(NOTE – This is from register.bat included in the x64 version of Debug Diag. The x86 version is shorter since it doesn’t register the x64 components)
1. Registration of the dbgsvc service and dbghost:
dbgsvc /service
dbghost /regserver
(Info on what dbgsvc and dbghost do is located here: http://support.microsoft.com/kb/931370)
2. Registration of the x64 debugger extensions used for the analysis piece:
regsvr32 /s exts\ComplusDDExt.dll
regsvr32 /s exts\ CrashHangExt.dll
regsvr32 /s exts\IISInfo.dll
regsvr32 /s exts\MemoryExt.dll
regsvr32 /s exts\SharePointExt.dll
3. Register dbghost x86 support:
x86support\dbghost /regserver
4. Registration of the x86 debugger extensions used for the analysis piece:
regsvr32 /s x86support\exts\ComplusDDExt.dll
regsvr32 /s x86support\exts\CrashHangExt.dll
regsvr32 /s x86support\exts\IISInfo.dll
regsvr32 /s x86support\exts\MemoryExt.dll
regsvr32 /s x86support\exts\SharePointExt.dll
So yes, even though you aren’t running the installer, running register.bat does make a few changes, but once you run the batch file, you’re ready to troubleshoot!
The nice thing about the XCopy deployment option is that it doesn’t have to be a permanent thing, you only need to leave DebugDiag on the box while you’re troubleshooting. Once you’re done with it, you can easily undo these changes by running unregister.bat and removing the DebugDiag files you copied over. The unregister.bat file should take care of everything from stopping dbgsvc to unregistering the service and debugger extensions without requiring a reboot.