コード例 #1
0
 public UCIntro()
 {
     InitializeComponent();
     base.SetTitle("설치순서");
     base.UCType = UCType.Intro;
     FLog.Msg(string.Format("{0}", base.GetTitle()));
 }
コード例 #2
0
        /// <summary>
        /// 설치할 아이템 로드
        /// </summary>
        protected override bool LoadInstallItems()
        {
            base.ClearItems();

            string strMsg;
            string strItemPath = string.Format("{0}\\03.fax_driver\\", Application.StartupPath);

            if (!Directory.Exists(strItemPath))
            {
                strMsg = string.Format("필수 설치 항목 디렉터리가 존재하지 않습니다. \n{0}", strItemPath);
                MsgBox.Err(strMsg);
                FLog.Err(strMsg);
                return(false);
            }

            string[] arrFiles = Directory.GetFiles(strItemPath, "setup.exe");
            if (arrFiles.Length <= 0)
            {
                strMsg = string.Format("필수 설치 항목 아이템이 존재하지 않습니다. \n{0}", strItemPath);
                MsgBox.Err(strMsg);
                FLog.Err(strMsg);
                return(false);
            }

            FLog.Msg("설치항목 로드 시작");
            foreach (string strFile in arrFiles)
            {
                FileInfo fInfo = new FileInfo(strFile);
                FLog.Msg(fInfo.FullName);
                base.AddItem(fInfo.Name, fInfo.Directory.FullName, InstallState.Ready);
            }
            FLog.Msg("설치항목 로드 완료");

            return(base.LoadInstallItems());
        }
コード例 #3
0
 public UCFinish()
 {
     InitializeComponent();
     base.SetTitle("설치완료");
     base.UCType = UCType.Finish;
     FLog.Msg(string.Format("{0}", base.GetTitle()));
 }
コード例 #4
0
        protected override void ProgressInstall(object sender, DoWorkEventArgs e)
        {
            base.MenuBar.DisableAllButton();
            List <InstallItemInfo> items = base.GetInstallItems();

            foreach (InstallItemInfo item in items)
            {
                base.UpdateItem(item.nItemIdx, item.strName, item.strPath, InstallState.Processing, item.strMsg);
                System.Threading.Thread.Sleep(1000);
                base.ProgressBar.IncreaseVal(1);

                if (!ProcessHandler.StartProcess(item.strPath, item.strName))
                {
                    base.UpdateItem(item.nItemIdx, item.strName, item.strPath, InstallState.Failure, ProcessHandler.GetErrMsg());
                    FLog.Err(ProcessHandler.GetErrMsg());
                }
                else
                {
                    base.UpdateItem(item.nItemIdx, item.strName, item.strPath, InstallState.Success, item.strMsg);
                    FLog.Msg(string.Format("프로세스 실행 완료 ({0})", item.strName));
                }
            }

            base.ProgressInstall(sender, e);
        }
コード例 #5
0
        public UCPrerequisites()
        {
            InitializeComponent();

            base.UCType = UCType.Prerequisites;
            base.SetTitle("1. 서버환경 필수 설치 항목");
            base.VisibleSelector = false;

            FLog.Msg(string.Format("{0}", base.GetTitle()));
            this.LoadInstallItems();
        }
コード例 #6
0
        public UCFaxDriver()
        {
            InitializeComponent();

            base.UCType = UCType.FaxDriver;
            base.SetTitle("3. 팩스 드라이버(ImageMaker)");
            base.VisibleSelector = false;

            FLog.Msg(string.Format("{0}", base.GetTitle()));
            this.LoadInstallItems();
        }
コード例 #7
0
ファイル: UCPackage.cs プロジェクト: nicechangs/btfax4.server
        public UCPackage()
        {
            base.UCType = UCType.Package;
            base.SetTitle("4. 패키지 (Process, Web source, Tools, FaxStorage)");

            base.VisibleSelector = true;
            base.SelectorText    = "Install path ";
            base.SelectorPath    = "D:\\btfax4\\";

            FLog.Msg(string.Format("{0}", base.GetTitle()));
            this.LoadInstallItems();
        }
コード例 #8
0
        public UCBthmp()
        {
            InitializeComponent();

            base.UCType = UCType.Bthmp;
            base.SetTitle("2. BTHMP");
            base.SetDescription("설치위치 : C:\\BTFAX\\");

            base.VisibleSelector = true;
            base.SelectorText    = "license file (*.lic)";

            FLog.Msg(string.Format("{0}", base.GetTitle()));
            this.LoadInstallItems();
        }
コード例 #9
0
        protected override void CompleteInstall(object sender, RunWorkerCompletedEventArgs e)
        {
            string licFilePath = string.Format("{0}\\cfg\\", BTMP_HOME_PATH);
            string strMsg;

            try
            {
                if (string.IsNullOrEmpty(base.SelectorPath) || !File.Exists(base.SelectorPath))
                {
                    strMsg = string.Format("BTMP 라이센스 파일(btfax.lic)을 선택하지 않았습니다.\n 추후 라이센스파일을 해당위치 ({0})에 복사하여 주십시요.", licFilePath);
                    MsgBox.Info(strMsg);
                    FLog.Wrn(strMsg);
                    base.MenuBar.EnableAllButton();
                    base.CompleteInstall(sender, e);
                }
                else
                {
                    string strDestFileFullName = string.Format("{0}\\btfax.lic", licFilePath);
                    File.Copy(base.SelectorPath, strDestFileFullName, true);
                    FLog.Msg(string.Format("라이센스 복사 완료 ({0}) -> ({1})", base.SelectorPath, strDestFileFullName));
                }
            }
            catch (Exception ex)
            {
                MsgBox.Info(string.Format("BTMP 라이센스 파일복사중 오류가 발생하였습니다.\n ({0}).\n 추후 라이센스파일을 해당위치 ({1})에 복사하여 주십시요.", ex.Message, licFilePath));
                FLog.Msg(ex.Message);
            }

            // btmp_pm.exe install
            string strRedirectMsg = "";
            string strBtfaxPmPath = string.Format("{0}\\bin\\", BTMP_HOME_PATH);

            if (!ProcessHandler.StartProcess(strBtfaxPmPath, "btfax_pm.exe", out strRedirectMsg, " install"))
            {
                strMsg = string.Format("btfax_pm.exe install 실행을 실패하였습니다.\n {0}", ProcessHandler.GetErrMsg());
                MsgBox.Info(strMsg);
                FLog.Err(strMsg);
            }

            if (!string.IsNullOrEmpty(strRedirectMsg))
            {
                strMsg = strRedirectMsg;
                MsgBox.Info(string.Format("{0}", strRedirectMsg));
                FLog.Msg(strMsg);
            }

            base.MenuBar.EnableAllButton();
            base.CompleteInstall(sender, e);
        }
コード例 #10
0
ファイル: Program.cs プロジェクト: nicechangs/btfax4.server
        static void Main()
        {
            // get version
            string        strCfgFile = string.Format("{0}\\Installer.cfg", Application.StartupPath);
            string        strVersion = "";
            StringBuilder sb         = new StringBuilder(32);
            int           len        = Win32API.GetPrivateProfileString("INSTALL", "Version", "", sb, 32, strCfgFile);

            if (len <= 0 || sb.ToString() == "")
            {
                strVersion = "Unknown";
            }
            else
            {
                strVersion = sb.ToString();
            }

            // log init..
            FLog.Init(Application.StartupPath, "installer");
            FLog.Msg(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
            FLog.Msg(string.Format(">> Btfax4 package(v{0}) installer start !!", strVersion));
            FLog.Msg(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            MainForm mainForm = new MainForm();

            mainForm.PackageVersion = strVersion;

            Application.Run(mainForm);

            FLog.Msg(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
            FLog.Msg(string.Format(">> Btfax4 package(v{0}) installer Exit !!", strVersion));
            FLog.Msg(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
        }
コード例 #11
0
ファイル: UCPackage.cs プロジェクト: nicechangs/btfax4.server
        protected override void ProgressInstall(object sender, DoWorkEventArgs e)
        {
            PACKAGE_HOME_PATH = base.SelectorPath;

            base.MenuBar.DisableAllButton();
            string strItemPath = string.Format("{0}\\04.package\\", Application.StartupPath);

            string strDestPath = "";

            // 디렉터리 생성
            FLog.Msg("디렉터리 생성 시작");
            string[] dirs = Directory.GetDirectories(strItemPath, "*.*", SearchOption.AllDirectories);
            foreach (string strDir in dirs)
            {
                try
                {
                    System.Threading.Thread.Sleep(10);
                    strDestPath = string.Format("{0}\\{1}", PACKAGE_HOME_PATH, strDir.Replace(strItemPath, ""));
                    if (!Directory.Exists(strDestPath))
                    {
                        Directory.CreateDirectory(strDestPath);
                    }
                    FLog.Msg(strDestPath);
                }
                catch
                {
                    continue;
                }
            }
            FLog.Msg("디렉터리 생성 완료");

            // 파일복사
            FLog.Msg("파일복사 시작");
            List <InstallItemInfo> items = base.GetInstallItems();

            foreach (InstallItemInfo item in items)
            {
                base.UpdateItem(item.nItemIdx, item.strName, item.strPath, InstallState.Processing, item.strMsg);
                System.Threading.Thread.Sleep(5);

                base.ProgressBar.IncreaseVal(1);

                try
                {
                    string fileFullName = string.Format("{0}\\{1}", item.strPath, item.strName);
                    if (!File.Exists(fileFullName))
                    {
                        FLog.Wrn(string.Format("파일이 존재하지 않습니다. ({0})", fileFullName));
                        continue;
                    }

                    FileInfo fInfo = new FileInfo(fileFullName);
                    strDestPath = string.Format("{0}\\{1}", PACKAGE_HOME_PATH, fInfo.Directory.FullName.Replace(strItemPath, ""));
                    if (!Directory.Exists(strDestPath))
                    {
                        Directory.CreateDirectory(strDestPath);
                    }

                    string destFileFullName = string.Format("{0}\\{1}", strDestPath, fInfo.Name);
                    File.Copy(fInfo.FullName, destFileFullName, true);
                    FLog.Msg(string.Format("{0} -> {1}", fInfo.FullName, destFileFullName));

                    base.UpdateItem(item.nItemIdx, item.strName, item.strPath, InstallState.Success, item.strMsg);
                }
                catch (Exception ex)
                {
                    FLog.Err(ex.Message);
                    base.UpdateItem(item.nItemIdx, item.strName, item.strPath, InstallState.Failure, ex.Message);
                }
            }

            FLog.Msg("파일복사 완료");
            base.ProgressInstall(sender, e);
        }
コード例 #12
0
ファイル: UCPackage.cs プロジェクト: nicechangs/btfax4.server
        protected override void CompleteInstall(object sender, RunWorkerCompletedEventArgs e)
        {
            string strMsg;

            try
            {
                // watcher cfg 파일 조절
                FLog.Msg("Watcher.cfg 프로세스 위치 조정");
                string strIoaCfgPath = string.Format("{0}\\server\\bin_ioa\\cfg\\watcher.cfg", PACKAGE_HOME_PATH);
                if (!File.Exists(strIoaCfgPath))
                {
                    strMsg = string.Format("프로세스 환경설정 파일({0})이 존재하지 않습니다", strIoaCfgPath);
                    MsgBox.Err(strMsg);
                    FLog.Err(strMsg);

                    base.MenuBar.EnableAllButton();
                    base.CompleteInstall(sender, e);
                    return;
                }

                StringBuilder sb  = new StringBuilder(256);
                int           len = Win32API.GetPrivateProfileString("Watch", "list", "", sb, 256, strIoaCfgPath);
                if (len <= 0 || sb.ToString() == "")
                {
                    strMsg = "프로세스 목록 데이터가 존재하지 않습니다";
                    FLog.Err(strMsg);

                    base.MenuBar.EnableAllButton();
                    base.CompleteInstall(sender, e);
                    return;
                }

                string   strSections  = sb.ToString().Trim();
                string[] arrProcsInfo = strSections.Split(',');
                if (arrProcsInfo.Length <= 0)
                {
                    strMsg = "프로세스 목록 데이터가 존재하지 않습니다 (Split)";
                    MsgBox.Err(strMsg);
                    FLog.Err(strMsg);

                    base.MenuBar.EnableAllButton();
                    base.CompleteInstall(sender, e);
                    return;
                }

                strMsg = string.Format("LIST={0}", strSections);
                FLog.Msg(strMsg);

                string        strReplace = string.Format("{0}\\server", PACKAGE_HOME_PATH);
                DirectoryInfo dirInfo    = new DirectoryInfo(strReplace);

                foreach (string strProcSection in arrProcsInfo)
                {
                    // Path 정보 변경
                    len = Win32API.GetPrivateProfileString(strProcSection, "Path", "", sb, 256, strIoaCfgPath);
                    if (len <= 0 || sb.ToString() == "")
                    {
                        continue;
                    }

                    string strValue = sb.ToString();
                    strValue = strValue.Replace("[INSTALL_PATH]", dirInfo.FullName);
                    len      = Win32API.WritePrivateProfileString(strProcSection, "Path", strValue, strIoaCfgPath);
                    FLog.Msg(string.Format("section:{0}, filed:Path, value:{1}", strProcSection, strValue));


                    // Pattern 정보 변경
                    len = Win32API.GetPrivateProfileString(strProcSection, "Pattern", "", sb, 256, strIoaCfgPath);
                    if (len <= 0 || sb.ToString() == "")
                    {
                        continue;
                    }

                    strValue = sb.ToString();
                    strValue = strValue.Replace("[INSTALL_PATH]", dirInfo.FullName);
                    len      = Win32API.WritePrivateProfileString(strProcSection, "Pattern", strValue, strIoaCfgPath);
                    FLog.Msg(string.Format("section:{0}, filed:Pattern, value:{1}", strProcSection, strValue));

                    System.Threading.Thread.Sleep(5);
                }

                strMsg = string.Format("패키지 설치를 완료 하였습니다. \n({0})", PACKAGE_HOME_PATH);
                MsgBox.Info(strMsg);
                FLog.Msg(strMsg);
            }
            catch (Exception ex)
            {
                MsgBox.Info(ex.Message);
            }

            base.MenuBar.EnableAllButton();
            base.CompleteInstall(sender, e);
        }