Skip to content

Instantly share code, notes, and snippets.

@UCyborg
Created July 28, 2019 11:22
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save UCyborg/1a26de2a49bbc247f8c54edd6aef5528 to your computer and use it in GitHub Desktop.
Save UCyborg/1a26de2a49bbc247f8c54edd6aef5528 to your computer and use it in GitHub Desktop.
Downloads debug symbols required by Aero Glass if it doesn't have the latest information about internal DWM functions.
Const WindowsFolder = 0
Const SystemFolder = 1
Const TempFolder = 2
Dim objShell, regPath
Set objShell = WScript.CreateObject("WScript.Shell")
regPath = Array("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\WindowsDebuggersRoot10",_
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\WindowsDebuggersRoot10",_
"HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\WindowsDebuggersRoot81",_
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\WindowsDebuggersRoot81",_
"HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\WindowsDebuggersRoot8",_
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\WindowsDebuggersRoot8",_
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{277BA0F1-D0BB-4D73-A2DF-6B60C91E1533}_is1\InstallLocation",_
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Aero Glass for Win8.1+_is1\InstallLocation")
Dim num, dbgPath
num = 0
On Error Resume Next
Do While (num < 6)
dbgPath = objShell.RegRead(regPath(num))
If Not IsEmpty(dbgPath) Then
Exit Do
Else
dbgPath = objShell.RegRead(regPath(num + 1))
If Not IsEmpty(dbgPath) Then
Exit Do
End If
End If
num = num + 2
Loop
On Error GoTo 0
If IsEmpty(dbgPath) Then
MsgBox "Path to Debugging Tools not found.", 16, "Error"
WScript.Quit 0
End If
Dim strArch
If objShell.ExpandEnvironmentStrings("%PROCESSOR_ARCHITECTURE%") = "AMD64" Then
strArch = "x64"
Else
strArch = "x86"
End If
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
If Not objFSO.FileExists(dbgPath & strArch & "\symchk.exe") Then
MsgBox "symchk.exe not found.", 16, "Error"
WScript.Quit 0
End If
Dim AGPath
On Error Resume Next
AGPath = objShell.RegRead(regPath(6))
If IsEmpty(AGPath) Then
AGPath = objShell.RegRead(regPath(7))
End If
If IsEmpty(AGPath) Then
Dim objApp, objFolder
Set objApp = CreateObject("Shell.Application")
Set objFolder = objApp.BrowseForFolder(0, "Please select AeroGlass installation folder.", 513, 17)
If Not (objFolder Is Nothing) Then
AGPath = objFolder.Self.path & "\"
Else
WScript.Quit 0
End If
End If
On Error GoTo 0
Dim tempPath, systemPath
tempPath = objFSO.GetSpecialFolder(TempFolder) & "\DWMDlls"
On Error Resume Next
objFSO.CreateFolder tempPath
systemPath = objFSO.GetSpecialFolder(SystemFolder)
objFSO.CopyFile systemPath & "\ApplicationFrame.dll", tempPath & "\"
On Error GoTo 0
objFSO.CopyFile systemPath & "\dwmcore.dll", tempPath & "\"
objFSO.CopyFile systemPath & "\uDWM.dll", tempPath & "\"
objShell.Run """" & dbgPath & strArch & "\symchk.exe"_
& """" & " " & """" & tempPath & """"_
& " /s SRV*" & """" & AGPath & "symbols\" & "*http://msdl.microsoft.com/download/symbols" & """", 1, True
objFSO.DeleteFolder tempPath
@uso007
Copy link

uso007 commented Feb 27, 2020

good

@RichardMcKee
Copy link

good 2thx

@Coldblackice
Copy link

Thanks!

@Waterverse-SYS32
Copy link

Help me with the "Path to debugging tools not found"

@hedgehxg
Copy link

I keep getting "Path of debugging tools not found"!! Please help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment