Esempio n. 1
0
        public void Uninstall()
        {
            if (!Exists)
            {
                throw new InvalidOperationException("Uninstall operation failed. There is no version installed.");
            }

            WindowsInstaller.Uninstall(_productCode);
        }
        public void Install(InstallationSettings settings)
        {
            using (var tempDirectory = new TempDirectory(_directoryPath))
            {
                var installerPackagePath = Path.Combine(_directoryPath, GetInstallerPackageFileName(settings));

                ZipFile.ExtractToDirectory(installerPackagePath, tempDirectory.Path);

                var installerPath = Path.Combine(tempDirectory.Path, settings.InstallerFileName);
                WindowsInstaller.Install(installerPath, settings.AdditionalParameters);
            }
        }