async Task <bool> Prepare()
        {
            bool enabled = WinServiceUtils.TrySetStartupType(WinUpdatesManager.WUA_SERVICE_NAME, true);

            if (!enabled)
            {
                return(false);
            }
            return(await WinServiceUtils.StartServiceAsync(WinUpdatesManager.WUA_SERVICE_NAME, 60000).ConfigureAwait(false));
        }
        async Task Cleanup()
        {
            //unregister all events
            //todo is this really necessary: considering that
            //this reference lives here in the Page only
            if (winUpdateManager != null)
            {
                winUpdateManager.CheckCompleted        -= WinUpdateManager_CheckCompleted;
                winUpdateManager.DownloadCompleted     -= WinUpdateManager_DownloadCompleted;
                winUpdateManager.InstallationCompleted -= WinUpdateManager_InstallationCompleted;
                winUpdateManager.ProgressChanged       -= WinUpdateManager_ProgressChanged;

                //in case there is still somehting going on at the moment
                //todo can this cause problems?
                //winUpdateManager.AbortAll();

                winUpdateManager.CleanUp();

                winUpdateManager = null;
            }
            await WinServiceUtils.StopServiceAsync(WinUpdatesManager.WUA_SERVICE_NAME, 60000).ConfigureAwait(false);

            WinServiceUtils.TrySetStartupType(WinUpdatesManager.WUA_SERVICE_NAME, false);
        }