コード例 #1
0
        public async Task UninstallsClickOnceApp()
        {
            var installer = new ClickOnceInstaller();
            await installer.InstallClickOnceApp(new Uri(IntegrationTestHelper.ClickOnceTestAppPath));

            UninstallInfo theApp = UninstallInfo.Find(IntegrationTestHelper.ClickOnceAppName);

            Assert.NotNull(theApp);

            var uninstaller = new Uninstaller();

            uninstaller.Uninstall(theApp);

            UninstallInfo shouldBeNull = UninstallInfo.Find(IntegrationTestHelper.ClickOnceAppName);

            Assert.Null(shouldBeNull);
        }
コード例 #2
0
        public static IDisposable WithClickOnceApp()
        {
            string clickOnceApp = Path.Combine(new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory).Parent.Parent.FullName, "ClickOnceApp/ClickOnceApp.application"); // omg
            var    installer    = new ClickOnceInstaller();

            installer.InstallClickOnceApp(new Uri(clickOnceApp)).Wait();

            return(Disposable.Create(() =>
            {
                UninstallInfo theApp = UninstallInfo.Find(ClickOnceAppName);

                if (theApp == null)
                {
                    return;
                }

                var uninstaller = new Uninstaller();
                uninstaller.Uninstall(theApp);
            }));
        }
コード例 #3
0
        public async Task UninstallsClickOnceApp()
        {
            var installer = new ClickOnceInstaller();
            await installer.InstallClickOnceApp(new Uri(IntegrationTestHelper.ClickOnceTestAppPath));

            UninstallInfo theApp = UninstallInfo.Find(IntegrationTestHelper.ClickOnceAppName);

            Assert.NotNull(theApp);

            var uninstaller = new Uninstaller();
            uninstaller.Uninstall(theApp);

            UninstallInfo shouldBeNull = UninstallInfo.Find(IntegrationTestHelper.ClickOnceAppName);

            Assert.Null(shouldBeNull);
        }