示例#1
0
        public ClsStatusContainer(string AppName)
        {
            Product = AppName;
            Driver  = AppName + " Driver";
            string status;

            ClsInstall.isDriverInstalled(AppName, out status);
            Status   = status;
            MoreInfo = "";
        }
示例#2
0
        public static void LoadProgressBar(ProgressBar prgs, Label lblPb)
        {
            int count    = 3;
            int lblCount = 0;

            foreach (string strAppname in AppNames)
            {
                bool isInstalled = ClsInstall.isDriverInstalled(strAppname);
                if (isInstalled == true)
                {
                    prgs.Value = (int)(100 / count);
                    lblPb.Text = (lblCount + 1).ToString() + " / 3";
                    lblCount++;
                    count--;
                }
            }
        }
示例#3
0
 private void btnInstall_Click(object sender, EventArgs e)
 {
     if (chkFoxPro.Checked)
     {
         bool isInstalled = ClsInstall.isDriverInstalled("Microsoft Visual FoxPro OLE DB Provider");
         if (isInstalled)
         {
             MessageBox.Show("Microsoft Visual FoxPro OLE DB Provider is Already Installed", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
         else
         {
             InstallFile(GFoxProFilePath);
             ClsStatusContainer.FillStatusContainer(lstStatus);
             ClsStatusContainer.LoadProgressBar(prgbStatus, lblProgress);
         }
     }
     if (chkMySQLODBC.Checked == true)
     {
         bool isInstalled = ClsInstall.isDriverInstalled("MySQL Connector/ODBC 5.1");
         if (isInstalled == true)
         {
             MessageBox.Show("MySQL Connector/ODBC 5.1 is Already Installed", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
         else
         {
             InstallFile(GMysqlPath);
             ClsStatusContainer.FillStatusContainer(lstStatus);
             ClsStatusContainer.LoadProgressBar(prgbStatus, lblProgress);
         }
     }
     if (chkFirebirdODBC.Checked == true)
     {
         bool isInstalled = ClsInstall.isDriverInstalled("Firebird/InterBase(r) ODBC driver 2.0.1.152");
         if (isInstalled == true)
         {
             MessageBox.Show("Firebird/InterBase(r) ODBC driver 2.0.1.152 is Already Installed", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
         else
         {
             InstallFile(GFirebirdPath);
             ClsStatusContainer.FillStatusContainer(lstStatus);
             ClsStatusContainer.LoadProgressBar(prgbStatus, lblProgress);
         }
     }
 }
示例#4
0
        private void InstallFile(string filepath)
        {
            InstallationFileInfo obj = new InstallationFileInfo(filepath);

            switch (obj.FileType.ToString())
            {
            case "EXE":
                ClsInstall.installEXE(filepath);
                break;

            case "MSI":
                ClsInstall.installMSI(filepath);
                break;

            default:
                MessageBox.Show("Not Supported File Type", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); break;
            }
        }