コード例 #1
0
        /// <summary>
        /// Uninstalls the ClickOnce version of your application.
        ///
        /// Call this method from the Squirrel version of your application.
        /// </summary>
        /// <remarks>
        /// After this method completes, you may want to set a flag somewhere, so you don't call
        /// this method the next time your Squirrel app starts.
        /// </remarks>
        public async Task Execute()
        {
            UninstallInfo uninstallInfo = await Task.Run(() => UninstallInfo.Find(this.clickOnceAppName));

            if (uninstallInfo == null)
            {
                this.Log().Info("Couldn't find the ClickOnce deployment, bailing...");
                return;
            }

            var uninstaller = new Uninstaller();
            await Task.Run(() => uninstaller.Uninstall(uninstallInfo));
        }
        /// <summary>
        /// Uninstalls the ClickOnce version of your application.
        /// 
        /// Call this method from the Squirrel version of your application.
        /// </summary>
        /// <remarks>
        /// After this method completes, you may want to set a flag somewhere, so you don't call
        /// this method the next time your Squirrel app starts.
        /// </remarks>
        public async Task Execute()
        {
            UninstallInfo uninstallInfo = await Task.Run(() => UninstallInfo.Find(this.clickOnceAppName));

            if (uninstallInfo == null)
            {
                this.Log().Info("Couldn't find the ClickOnce deployment, bailing...");
                return;
            }

            var uninstaller = new Uninstaller();
            await Task.Run(() => uninstaller.Uninstall(uninstallInfo));
        }