Пример #1
0
        private void AppSet(InstallProgress.SetShow setShow)
        {
            this.Invoke(setShow, new object[] { "生成配置", 6 });
            writeLog("生成配置");
            int numStart = 6;
            int numMax   = 7;

            Common.setXml xml = new Common.setXml();
            xml.addCopyFileXML(Tools.getConfigFolder(), Tools.getConfigTemplateFolder(), configName, "copyPath");

            Apps apps = QuickConfig.Common.setXml.getConfig(configName).Apps;


            Common.setConfig setconfig = new Common.setConfig();
            List <string[]>  checkApp  = new List <string[]>();

            foreach (ServiceApp sa in set.Apps.ServiceAppList)
            {
                string[] configFolder = new string[2];
                configFolder[0] = sa.ConfigFolder;
                configFolder[1] = sa.Path;
                checkApp.Add(configFolder);
            }
            foreach (WebApp sa in set.Apps.WebAppList)
            {
                string[] configFolder = new string[2];
                configFolder[0] = sa.ConfigFolder;
                configFolder[1] = sa.Path;
                checkApp.Add(configFolder);
            }
            foreach (App sa in set.Apps.AppList)
            {
                string[] configFolder = new string[2];
                configFolder[0] = sa.ConfigFolder;
                configFolder[1] = sa.Path;
                checkApp.Add(configFolder);
            }

            setconfig.config(Tools.getConfigTemplateFolder(), Tools.getConfigTemplateTempFolder(), configName, checkApp);

            if (numStart != numMax)
            {
                this.Invoke(setShow, new object[] { "配置程序完成", numStart });
                writeLog("配置程序完成");
                numStart++;
            }
        }
Пример #2
0
        private void CopyFile(InstallProgress.SetShow setShow)
        {
            this.Invoke(setShow, new object[] { "复制文件", 1 });
            writeLog("复制文件");
            int numStart = 1;
            int numMax   = 15;

            Common.setConfig setconfig = new Common.setConfig();

            Common.setXml setxml = new Common.setXml();

            DataTable dt = setxml.readInstallXML(Tools.getInstallConfigFolder());

            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string type    = dt.Rows[i]["type"].ToString();
                    string name    = dt.Rows[i]["name"].ToString();
                    string xmlname = dt.Rows[i]["xmlname"].ToString();

                    string packagefilepath = Tools.getInstallPackagesFolder() + "\\" + name + ".7z";
                    string targetFolder    = "";
                    string label           = "";
                    if (type == "serviceapp")
                    {
                        ServiceApp sa = set.Apps.ServiceAppList.Find((ServiceApp du) => du.Name == xmlname);
                        targetFolder = set.Apps.Path + "\\" + sa.Relativepath;
                        label        = sa.Label;
                    }
                    else if (type == "webapp")
                    {
                        WebApp sa = set.Apps.WebAppList.Find((WebApp du) => du.Name == xmlname);
                        targetFolder = set.Apps.Path + "\\" + sa.Relativepath;
                        label        = sa.Label;
                    }
                    else if (type == "app")
                    {
                        App sa = set.Apps.AppList.Find((App du) => du.Name == xmlname);
                        targetFolder = set.Apps.Path + "\\" + sa.Relativepath;
                        label        = sa.Label;
                    }
                    else if (type == "dmp")
                    {
                        DbUser sa = set.Db.DbUserList.Find((DbUser du) => du.Name == xmlname);
                        targetFolder = set.Apps.Path + "\\" + set.Db.Relativepath;
                        label        = sa.Label;
                    }
                    else if (type == "gdb")
                    {
                        DbSdeUser sa = set.Db.DbSdeUserList.Find((DbSdeUser du) => du.Name == xmlname);
                        targetFolder = set.Apps.Path + "\\" + sa.Relativepath;
                        label        = sa.Label;
                    }

                    if (!Directory.Exists(targetFolder))
                    {
                        Directory.CreateDirectory(targetFolder);
                    }

                    Common.setBAT.FileExtract(Tools.getToolsFolder(), Tools.getToolsTempFolder(), label, packagefilepath, targetFolder, false);

                    if (numStart != numMax)
                    {
                        this.Invoke(setShow, new object[] { type + "文件:" + label + "复制完成", numStart });
                        writeLog(type + "文件:" + label + "复制完成");
                        numStart++;
                    }
                }
            }
        }