/// <summary>
        /// Removes an application's recovery registration.
        /// </summary>
        /// <exception cref="Microsoft.WindowsAPICodePack.ApplicationServices.ApplicationRecoveryException">
        /// The attempt to unregister for recovery failed.</exception>
        public static void UnregisterApplicationRecovery()
        {
            CoreHelpers.ThrowIfNotVista();

            HResult hr = AppRestartRecoveryNativeMethods.UnregisterApplicationRecoveryCallback();

            if (!CoreErrorHelper.Succeeded(hr))
            {
                throw new ApplicationRecoveryException(LocalizedMessages.ApplicationRecoveryFailedToUnregister);
            }
        }
        /// <summary>
        /// Removes an application's recovery registration.
        /// </summary>
        /// <exception cref="System.ComponentModel.Win32Exception">
        /// The attempt to unregister for recovery failed.</exception>
        public static void UnregisterApplicationRecovery()
        {
            // Throw PlatformNotSupportedException if the user is not running Vista or beyond
            CoreHelpers.ThrowIfNotVista();

            HRESULT hr = AppRestartRecoveryNativeMethods.UnregisterApplicationRecoveryCallback();

            if (hr == HRESULT.E_FAIL)
            {
                throw new ExternalException("Unregister for recovery failed.");
            }
        }