Exemplo n.º 1
0
        private static void InstallLicenses()
        {
            UnNgen.ProgressArgs userState = new UnNgen.ProgressArgs(1, "正在安装版本号...");
            Console.WriteLine($"{userState.ProgressText}【进度:{userState.PercentComplete}】");
            List <Version> list = new List <Version>();

            for (int i = 7; i <= 19; i++)
            {
                for (int j = 0; j < 10; j++)
                {
                    list.Add(new Version(i, j));
                }
            }
            for (int k = 0; k < list.Count; k++)
            {
                Licenses.InstallLicense(GetUserName(), list[k]);
                userState = new UnNgen.ProgressArgs(100 * k / list.Count, "正在安装版本号...");
                Console.WriteLine($"{userState.ProgressText}【进度:{userState.PercentComplete}】");
            }
        }
Exemplo n.º 2
0
        private static void InstallAddIn()
        {
            UnNgen.ProgressArgs userState = new UnNgen.ProgressArgs(10, "正在安装补丁...");
            string text = Path.Combine(Path.GetTempPath(), "DevExpress.Patch.Common.dll");

            using (FileStream fileStream = new FileStream(text, FileMode.Create, FileAccess.Write))
            {
                byte[] commonLib = Resources.DevExpress_Patch_Common;
                fileStream.Write(commonLib, 0, commonLib.Length);
                fileStream.Close();
            }
            new Publish().GacInstall(text);
            Thread.Sleep(1000);
            File.Delete(text);
            userState = new UnNgen.ProgressArgs(20, "正在安装补丁...");
            Console.WriteLine($"{userState.ProgressText}【进度:{userState.PercentComplete}】");
            if (VsUnit.IsVisualStudioInstalled(VsVersion.Vs2005))
            {
                VsUnit.InstallAddIn(VsVersion.Vs2005);
            }
            userState = new UnNgen.ProgressArgs(30, "正在安装补丁...");
            Console.WriteLine($"{userState.ProgressText}【进度:{userState.PercentComplete}】");
            if (VsUnit.IsVisualStudioInstalled(VsVersion.Vs2008))
            {
                VsUnit.InstallAddIn(VsVersion.Vs2008);
            }
            userState = new UnNgen.ProgressArgs(40, "正在安装补丁...");
            Console.WriteLine($"{userState.ProgressText}【进度:{userState.PercentComplete}】");
            if (VsUnit.IsVisualStudioInstalled(VsVersion.Vs2010))
            {
                VsUnit.InstallAddIn(VsVersion.Vs2010);
            }
            userState = new UnNgen.ProgressArgs(50, "正在安装补丁...");
            Console.WriteLine($"{userState.ProgressText}【进度:{userState.PercentComplete}】");
            if (VsUnit.IsVisualStudioInstalled(VsVersion.Vs2012))
            {
                VsUnit.InstallAddIn(VsVersion.Vs2012);
            }
            userState = new UnNgen.ProgressArgs(60, "正在安装补丁...");
            Console.WriteLine($"{userState.ProgressText}【进度:{userState.PercentComplete}】");
            if (VsUnit.IsVisualStudioInstalled(VsVersion.Vs2013))
            {
                VsUnit.InstallAddIn(VsVersion.Vs2013);
            }
            userState = new UnNgen.ProgressArgs(70, "正在安装补丁...");
            Console.WriteLine($"{userState.ProgressText}【进度:{userState.PercentComplete}】");
            if (VsUnit.IsVisualStudioInstalled(VsVersion.Vs2015))
            {
                VsUnit.InstallAddIn(VsVersion.Vs2015);
            }
            userState = new UnNgen.ProgressArgs(80, "正在安装补丁...");
            Console.WriteLine($"{userState.ProgressText}【进度:{userState.PercentComplete}】");
            if (VsUnit.IsVisualStudioInstalled(VsVersion.Vs2017))
            {
                VsUnit.InstallAddIn(VsVersion.Vs2017);
            }
            userState = new UnNgen.ProgressArgs(90, "正在安装补丁...");
            Console.WriteLine($"{userState.ProgressText}【进度:{userState.PercentComplete}】");
            if (VsUnit.IsVisualStudioInstalled(VsVersion.Vs2019))
            {
                VsUnit.InstallAddIn(VsVersion.Vs2019);
            }
            userState = new UnNgen.ProgressArgs(100, "安装补丁完成...");
            Console.WriteLine($"{userState.ProgressText}【进度:{userState.PercentComplete}】");
        }
Exemplo n.º 3
0
 private static void UnNgen_ProgressChanged(object sender, UnNgen.ProgressArgs e)
 {
     Console.WriteLine($"{e.ProgressText}【进度:{e.PercentComplete}】");
 }