Example #1
0
        public void Install(ProjectWidePackage pwPkg)
        {
            if (pwPkg == null)
            {
                throw new ArgumentNullException("pwPkg");
            }

            pwPkg.OnPackagePreparing();

            var targetProj = pwPkg.TargetProject;
            var pkgId      = pwPkg.PackageId;
            var pkgVer     = pwPkg.PackageVersion;

            if (!InstallerServices.IsPackageInstalledEx(targetProj, pkgId, pkgVer))
            {
                if (InstallerServices.IsPackageInstalled(targetProj, pkgId))
                {
                    Uninstaller.UninstallPackage(targetProj, pkgId, false);
                }
                InstallPackage(pwPkg, targetProj, pkgId, pkgVer);
            }
        }