Crash on startup if write access is denied to the IE browser emulation registry key

Description

mRemoteNG tries to set a registry value in HKCU\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\mRemoteNG.exe which results in an Access Denied on my computer. The computer is in a domain and access to that registry key in denied by policy. I understand this affects the functionality of the browser emulation but now I get an error message and when I click "Continue" the mRemoteNG process just hangs without showing a user interface. I was using a previous version fine on this computer though. Can you change the code to check for access and continue on failure leaving the IE browser emulation disabled?

The exact error message is: "Unhandled exception has occured in your application. If you click continue. the appliction will ignore this errror and attempt to continue. If you click Quit. the application will close immediately. Attempted to perform an unauthorized operation.".

Details:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

  •  

    •  

      •  

        •  

          •  

            •  

              •  

                •  

                  •  

                    •  

                      •  

                        •  

                          •  

                            • Exception Text **************
                              System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
                              at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
                              at Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind)
                              at mRemoteNG.Tools.IeBrowserEmulation.Register() in C:\Users\Riley\Documents\Visual Studio 2010\Projects\mRemoteNG\mRemoteV1\Tools\IeBrowserEmulation.vb:line 17
                              at mRemoteNG.frmMain.frmMain_Load(Object sender, EventArgs e) in C:\Users\Riley\Documents\Visual Studio 2010\Projects\mRemoteNG\mRemoteV1\Forms\frmMain.vb:line 62
                              at System.EventHandler.Invoke(Object sender, EventArgs e)
                              at System.Windows.Forms.Form.OnLoad(EventArgs e)
                              at System.Windows.Forms.Form.OnCreateControl()
                              at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
                              at System.Windows.Forms.Control.CreateControl()
                              at System.Windows.Forms.Control.WmShowWindow(Message& m)
                              at System.Windows.Forms.Control.WndProc(Message& m)
                              at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
                              at System.Windows.Forms.ContainerControl.WndProc(Message& m)
                              at System.Windows.Forms.Form.WmShowWindow(Message& m)
                              at System.Windows.Forms.Form.WndProc(Message& m)
                              at mRemoteNG.frmMain.WndProc(Message& m) in C:\Users\Riley\Documents\Visual Studio 2010\Projects\mRemoteNG\mRemoteV1\Forms\frmMain.vb:line 859
                              at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
                              at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
                              at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

  •  

    •  

      •  

        •  

          •  

            •  

              •  

                •  

                  •  

                    •  

                      •  

                        •  

                          •  

                            • Loaded Assemblies **************
                              mscorlib
                              Assembly Version: 2.0.0.0
                              Win32 Version: 2.0.50727.3643 (GDR.050727-3600)
                              CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
                              ----------------------------------------
                              mRemoteNG
                              Assembly Version: 1.71.5050.2632
                              Win32 Version: 1.71.5050.2632
                              CodeBase: file:///c:/Program%20Files/mremoteng/mRemoteNG.exe
                              ----------------------------------------
                              Microsoft.VisualBasic
                              Assembly Version: 8.0.0.0
                              Win32 Version: 8.0.50727.3053 (netfxsp.050727-3000)
                              CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
                              ----------------------------------------
                              System
                              Assembly Version: 2.0.0.0
                              Win32 Version: 2.0.50727.3644 (GDR.050727-3600)
                              CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
                              ----------------------------------------
                              System.Windows.Forms
                              Assembly Version: 2.0.0.0
                              Win32 Version: 2.0.50727.3645 (GDR.050727-3600)
                              CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
                              ----------------------------------------
                              System.Drawing
                              Assembly Version: 2.0.0.0
                              Win32 Version: 2.0.50727.3644 (GDR.050727-3600)
                              CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
                              ----------------------------------------
                              System.Configuration
                              Assembly Version: 2.0.0.0
                              Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
                              CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
                              ----------------------------------------
                              System.Xml
                              Assembly Version: 2.0.0.0
                              Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
                              CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
                              ----------------------------------------
                              System.Runtime.Remoting
                              Assembly Version: 2.0.0.0
                              Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
                              CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
                              ----------------------------------------
                              WeifenLuo.WinFormsUI.Docking
                              Assembly Version: 2.5.0.15095
                              Win32 Version: 2.5.0.0
                              CodeBase: file:///c:/Program%20Files/mremoteng/WeifenLuo.WinFormsUI.Docking.DLL
                              ----------------------------------------
                              mRemoteNG.resources
                              Assembly Version: 1.71.5050.2632
                              Win32 Version: 1.71.5050.2632
                              CodeBase: file:///c:/Program%20Files/mremoteng/en-US/mRemoteNG.resources.DLL
                              ----------------------------------------
                              MagicLibrary
                              Assembly Version: 1.7.4.0
                              Win32 Version: 1.7.4.0
                              CodeBase: file:///c:/Program%20Files/mremoteng/MagicLibrary.DLL
                              ----------------------------------------
                              PSTaskDialog
                              Assembly Version: 1.0.0.0
                              Win32 Version: 1.0.0.0
                              CodeBase: file:///c:/Program%20Files/mremoteng/PSTaskDialog.DLL
                              ----------------------------------------
                              log4net
                              Assembly Version: 1.2.10.0
                              Win32 Version: 1.2.10.0
                              CodeBase: file:///c:/Program%20Files/mremoteng/log4net.DLL
                              ----------------------------------------
                              System.Management
                              Assembly Version: 2.0.0.0
                              Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
                              CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Management/2.0.0.0__b03f5f7f11d50a3a/System.Management.dll
                              ----------------------------------------
                              FilteredPropertyGrid
                              Assembly Version: 1.0.2258.31541
                              Win32 Version: 1.0.0.0
                              CodeBase: file:///c:/Program%20Files/mremoteng/FilteredPropertyGrid.DLL
                              ----------------------------------------

  •  

    •  

      •  

        •  

          •  

            •  

              •  

                •  

                  •  

                    •  

                      •  

                        •  

                          •  

                            • JIT Debugging **************
                              To enable just-in-time (JIT) debugging, the .config file for this
                              application or computer (machine.config) must have the
                              jitDebugging value set in the system.windows.forms section.
                              The application must also be compiled with debugging
                              enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Environment

Windows XP pro SP3

Status

Assignee

Unassigned

Reporter

Mark Moses

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure