예제 #1
0
파일: wpfSetup.cs 프로젝트: dotnet/wpf-test
        //---------------------------------------------------------------------
        private int ShowStatus()
        {
            HostOS hostOS = Component.HostEnvironment.hostOS;

            foreach (Component comp in _components)
            {
                Console.Write("{0, -15}: ", comp.Name);
                if (comp.InstallOnThisOS(hostOS))
                {
                    bool isInstalled = comp.IsInstalled();
                    Console.WriteLine("Installed: {0}  Version: {1}",
                                      isInstalled ? "Y" : "N", isInstalled ? comp.GetVersion() : "-");
                }
                else
                {
                    Console.WriteLine("Skipped, not required on this OS: {0}", hostOS.ToString());
                    continue;
                }
            }
            return(0);
        }
예제 #2
0
파일: wpfSetup.cs 프로젝트: dotnet/wpf-test
        //---------------------------------------------------------------------
        private int ListComponents()
        {
            HostOS hostOS = Component.HostEnvironment.hostOS;

            foreach (Component comp in _components)
            {
                Console.Write("{0, -15}: ", comp.Name);
                if (comp.InstallOnThisOS(hostOS))
                {
                    Console.Write("File: ");
                    foreach (string file in comp.InstallerFiles)
                    {
                        Console.Write("{0} ", file);
                    }
                    Console.WriteLine();
                }
                else
                {
                    Console.WriteLine("Skipped, not required on this OS: {0}", hostOS.ToString());
                    continue;
                }
            }
            return(0);
        }
예제 #3
0
파일: wpfSetup.cs 프로젝트: dotnet/wpf-test
        //---------------------------------------------------------------------
        private int UninstallAll(bool removeSysPrereq)
        {
            HostOS           hostOS     = Component.HostEnvironment.hostOS;
            List <Component> components = _components;

            components.Reverse();
            foreach (Component comp in components)
            {
                if (comp.IsSystemPrerequisite && !removeSysPrereq)
                {
                    continue;   // skip this component if this is not a cleanup run
                }
                Console.WriteLine("Uninstalling {0} ...", comp.Name);
                if (!comp.InstallOnThisOS(hostOS))
                {
                    Console.WriteLine("component '{0}' is not necessary for this OS: {1}, uninstall skipped", comp.Name, hostOS.ToString());
                    continue;
                }

                if (!comp.IsInstalled() && !comp.ForceOperation)
                {
                    Console.WriteLine("component '{0}' already uninstalled", comp.Name);
                    continue;
                }
                // ignore failure exit codes when uninstalling
                comp.Uninstall();
            }
            return(0);
        }
예제 #4
0
파일: wpfSetup.cs 프로젝트: dotnet/wpf-test
        //---------------------------------------------------------------------
        private int InstallAll()
        {
            HostOS hostOS = Component.HostEnvironment.hostOS;

            foreach (Component comp in _components)
            {
                Console.WriteLine("Installing {0} ...", comp.Name);
                if (!comp.InstallOnThisOS(hostOS))
                {
                    Console.WriteLine("component '{0}' is not necessary for this OS: {1}, skipping install", comp.Name, hostOS.ToString());
                    continue;
                }

                if (comp.IsInstalled() && !_forceInstall && !comp.ForceOperation)
                {
                    Console.WriteLine("component '{0}' already installed; found version = {1}", comp.Name, comp.GetVersion());
                    continue;
                }
                int exitCode = comp.Install();
                if (exitCode != 0)
                {
                    Console.WriteLine("Component {0} failed to install, aborting!", comp.Name);
                    return(exitCode);
                }
            }
            return(0);
        }