Bug #60555 Bug in starting Workbench
Submitted: 20 Mar 2011 21:00 Modified: 13 Apr 2011 2:37
Reporter: Lev Shisterov Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.2.33 CE Revision 7508 OS:Windows (Windows Server 2003)
Assigned to: CPU Architecture:Any
Tags: dwmapi.dll, start, Unhandled exception, Windows Server 2003

[20 Mar 2011 21:00] Lev Shisterov
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"
[5 Apr 2011 4:07] Jonathan Liu
This bug also occurs on Microsoft Windows XP Professional x64 Edition.
[13 Apr 2011 2:37] Alfredo Kojima
This is a duplicate of bug #60412
[18 Apr 2011 16:42] Mr No
This VERY BUG not resolved now . Work preveous release my find this http://download.softagency.net/mysql/Downloads/MySQLGUITools/