Description:
Unhandled exception on Workbench starting on Windows Server 2003.
Error appear before main window appear.
"Unable to load DLL 'dwmapi.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"
Stack Trace:
"
at MySQL.Utilities.SysUtils.Win32.DwmIsCompositionEnabled()
at MySQL.Utilities.ControlUtilities.IsCompositionEnabled()
at MySQL.GUI.Workbench.MainForm.AdjustGlassFrame(Int32 toolbarHeight)
at MySQL.GUI.Workbench.MainForm.DockDocument(ITabDocument document, Boolean main, Boolean activate)
at MySQL.GUI.Workbench.MainForm.ApplicationCommand(AppCommand command, AppViewImpl view, String str)
at MySQL.Forms.AppImpl.app_command_wrapper(basic_string<char\,std::char_traits<char>\,std::allocator<char> >* , AppCommand command, AppView* view, basic_string<char\,std::char_traits<char>\,std::allocator<char> >* str)
at MySQL.Forms.AppImpl.dock_view(App* app, AppView* view, basic_string<char\,std::char_traits<char>\,std::allocator<char> >* position)
at MySQL.MCallback3<void\,mforms::App \*\,mforms::AppView \*\,std::basic_string<char\,std::char_traits<char>\,std::allocator<char> > const \&>.cpp_callback(App* a1, AppView* a2, basic_string<char\,std::char_traits<char>\,std::allocator<char> >* a3)
at wb.WBContextUI.init(WBContextUI* , WBFrontendCallbacks* , WBOptions* )
at MySQL.Workbench.WbContext.init(AppImpl application, WbOptions options, VoidStrUIFormDelegate create_main_form_view)
at MySQL.GUI.Workbench.Program.Main(String[] Args)
"
How to repeat:
Install on Windows Server 2003 and try to run.
Suggested fix:
Look at code:
"
static public bool IsCompositionEnabled()
{
if (!IsVistaOrAbove())
return false;
return Win32.DwmIsCompositionEnabled();
}
static public bool IsVistaOrAbove()
{
OperatingSystem system = Environment.OSVersion;
if (system.Platform != PlatformID.Win32NT)
return false;
return (system.Version.Major > 5) || (system.Version.Major == 5 && system.Version.Minor > 1);
}
"
Problem is in that Windows Server 2003 has version (Major.Minor): 5.2:
"OS Name Microsoft(R) Windows(R) Server 2003, Enterprise Edition"
"Version 5.2.3790 Service Pack 2 Build 3790"
Also need to say that this bug can be avoided by setting Application Compatibility to "Windows XP"