//Instalação do Import Service
        public void ProgressImportInstalation()
        {
            if (InvokeRequired)
            {
                this.Invoke(new MethodInvoker(ProgressImportInstalation));
                return;
            }

            //Se não for Update, cria o serviço
            if (!ControllerClass.isUpdate)
            {
                lblProConnector.Text = "Copiando Componentes...";
                lblProConnector.Refresh();

                //Copia DBMGR
                Components();

                //Copia o SQLCMD para a ferramenta DBMGR
                CopySQLCMD();

                lblProConnector.Text = "Criando chaves de registro...";
                lblProConnector.Refresh();

                //Move progress
                ProgressBarUpdate();

                //Cria Chaves de registro NDDigital
                eConnector.CreateNDDigitalRegKeys();

                lblProConnector.Text = "Criando Banco de Dados...";
                lblProConnector.Refresh();

                //Move progress
                ProgressBarUpdate();

                /*if (!ControllerClass.Oracle && !ControllerClass.Informix)
                 * {
                 *  DBMGR = new CreateDataBase();
                 *
                 *  if (!ControllerClass.SGBDCreated || !ControllerClass.SGBDCreatedCold)
                 *  {
                 *      if (!eConnector.VerifyDBMGRResult())
                 *      {
                 *          MessageBox.Show("Não foi possível acessar o banco de dados, verifique os eventos do Windows para maiores informações!", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 *          StartPage.ActiveForm.Close();
                 *      }
                 *  }
                 * }*/

                //Move progress
                ProgressBarUpdate();

                lblProConnector.Text = "Criando Pastas de destino...";
                lblProConnector.Refresh();

                //Cria as pastas de destino para as DLLS
                eConnector.CreateFolderConnector();

                //Move progress
                ProgressBarUpdate();

                lblProConnector.Text = "Criando Serviços...";
                lblProConnector.Refresh();

                //Move progress
                ProgressBarUpdate();

                //Cria serviço Connector Service
                Services.CreateService(ControllerClass.PathFolder + @"\Connector\Connector Service\NDDigital.eForms.ConnectorService.exe", "NDDigitaleFormsConnectorService",
                                       "Serviço responsável pela captura e processamento de documentos enviados à solução e-Forms.", "NDDigital e-Forms Connector Service");

                //Move progress
                ProgressBarUpdate();

                //Estraindo DLLs
                ExtractResources("Settings");
                ExtractResources("Service");
                ExtractResources("Services");
                ExtractResources("B2B");
                ExtractResources("DPEC");

                CalculateFileQuantity();

                //Movendo as DLLs para o caminho de destino
                MoveDLLs(@"C:\Inst\ConnectorSettings", "Connector Settings");
                Thread.Sleep(500);

                MoveDLLs(@"C:\Inst\ConnectorService", "Connector Service");
                Thread.Sleep(500);

                MoveDLLs(@"C:\Inst\ConnectorServices", "Connector Services");
                Thread.Sleep(500);

                MoveDLLs(@"C:\Inst\B2B", "B2B Service");
                Thread.Sleep(500);

                MoveDLLs(@"C:\Inst\DPEC", "DPEC Server");
                Thread.Sleep(500);
            }

            //Caso seja Update, para o serviço para atualizar as DLLs
            else
            {
                lblProConnector.Text = "Verificando update...";
                lblProConnector.Refresh();

                ControllerClass.VerifyRegKeysIFUpdate();

                //Move progress
                ProgressBarUpdate();

                lblProConnector.Text = "Verificando pastas existentes...";
                lblProConnector.Refresh();

                eConnector.CreateFolderConnector();

                //Move progress
                ProgressBarUpdate();


                lblProConnector.Text = "Parando os Serviços...";
                lblProConnector.Refresh();

                Services.ConnectorServiceStop();
                Thread.Sleep(3500);

                //Move progress
                ProgressBarUpdate();


                lblProConnector.Text = "Deletando arquivo antigos...";
                lblProConnector.Refresh();

                removeFiles.DeleteSchemasFrom(ControllerClass.PathFolder + @"\Connector\Connector Service\Schemas");
                removeFiles.DeleteFilesFrom(ControllerClass.PathFolder + @"\Connector\Connector Settings");
                removeFiles.DeleteFilesFrom(ControllerClass.PathFolder + @"\Connector\Connector Service");
                removeFiles.DeleteFilesFrom(ControllerClass.PathFolder + @"\Connector\Connector Services");
                removeFiles.DeleteFilesFrom(ControllerClass.PathFolder + @"\Connector\B2B Service");
                removeFiles.DeleteFilesFrom(ControllerClass.PathFolder + @"\Connector\DPEC Server");

                //Move progress
                ProgressBarUpdate();

                //Estraindo DLLs
                ExtractResources("Settings");
                ExtractResources("Service");
                ExtractResources("Services");
                ExtractResources("B2B");
                ExtractResources("DPEC");

                //Move progress
                ProgressBarUpdate();

                //Calcula a quantidade de arquivos para definir o tamanho da barra de progresso
                CalculateFileQuantity();

                MoveDLLs(@"C:\Inst\ConnectorSettings", "Connector Settings");
                Thread.Sleep(500);

                MoveDLLs(@"C:\Inst\ConnectorService", "Connector Service");
                Thread.Sleep(500);

                MoveDLLs(@"C:\Inst\ConnectorServices", "Connector Services");
                Thread.Sleep(500);

                MoveDLLs(@"C:\Inst\B2B", "B2B Service");
                Thread.Sleep(500);

                MoveDLLs(@"C:\Inst\DPEC", "DPEC Server");
                Thread.Sleep(500);

                //Move progress
                ProgressBarUpdate();

                lblProConnector.Text = "Finalizando...";
                lblProConnector.Refresh();
            }


            lblProConnector.Text = "Atualizando atalhos...";
            lblProConnector.Refresh();

            ShortcutConnector(ControllerClass.PathFolder);
            //ShortcutMonitor(ControllerClass.RootFolder);

            lblProConnector.Text = "Iniciando os Serviços...";
            lblProConnector.Refresh();

            //Inicia Serviço
            Services.ConnectorServiceStart();

            //Move progress
            ProgressBarUpdate();

            lblProConnector.Font      = new Font(lblProConnector.Font, FontStyle.Bold);
            lblProConnector.ForeColor = Color.Green;
            lblProConnector.Text      = "Concluido";
            PctImport.Visible         = true;
            BtnNext.Enabled           = true;
            lblCopy.Text = "Todos os arquivos foram copiados";
            lblFile.Text = "";
            groupGeneral.Refresh();
        }
        //Instalação do Entry Service
        public void ProgressEntryInstalation()
        {
            if (InvokeRequired)
            {
                this.Invoke(new MethodInvoker(ProgressEntryInstalation));
                return;
            }

            entry.CreateFolderEntry();

            //Move progress
            ProgressBarUpdate();

            //Se não for Update, cria o serviço
            if (!ControllerClass.isUpdate)
            {
                lblProEntry.Text = "Criando chaves de registro...";
                lblProEntry.Refresh();

                entry.CreateNDDigitalRegKeys();

                lblProEntry.Text = "Criando Serviço do Entry Documents...";
                lblProEntry.Refresh();

                //Move progress
                ProgressBarUpdate();

                Services.CreateService(ControllerClass.PathFolder + @"\Connector\Entry Documents Service\NDDigital.eForms.EntryDocumentsService.exe", "NDDigitaleFormsEntryDocumentsService",
                                       "Serviço responsável pela captura e processamento de arquivos de notas de entrada.", "NDDigital e-Forms Entry Document Service");

                //Move progress
                ProgressBarUpdate();

                ExtractResources();

                //Move progress
                ProgressBarUpdate();

                MoveDLLs(@"C:\Inst\EntryDocuments");
            }

            //Caso seja Update, para o serviço para atualizar as DLLs
            else
            {
                lblProEntry.Text = "Parando Serviço do Entry Documents...";
                lblProEntry.Refresh();

                //Move progress
                ProgressBarUpdate();

                //Parando os Serviços
                Services.ServiceStop();

                Thread.Sleep(2000);

                lblProEntry.Text = "Deletando arquivos antigos...";
                lblProEntry.Refresh();

                removeFiles.DeleteSchemasFrom(ControllerClass.PathFolder + @"\Connector\Entry Documents Service\Schemas");
                removeFiles.DeleteFilesFrom(ControllerClass.PathFolder + @"\Connector\Entry Documents Service");

                //Move progress
                ProgressBarUpdate();

                //Extrai DLLs
                ExtractResources();

                //Move progress
                ProgressBarUpdate();

                lblProEntry.Text = "Movendo DLLS para a pasta de destino...";
                lblProEntry.Refresh();

                //Move DLLs para o caminho de destino
                MoveDLLs(@"C:\Inst\EntryDocuments");

                lblProEntry.Text = "Finalizando...";
                lblProEntry.Refresh();
            }

            lblProEntry.Text = "Iniciando o Serviço do Entry Documents...";
            lblProEntry.Refresh();

            //Inicia Serviço
            Services.ServiceStart();

            //Move progress
            ProgressBarUpdate();

            lblProEntry.Font      = new Font(lblProEntry.Font, FontStyle.Bold);
            lblProEntry.ForeColor = Color.Green;
            lblProEntry.Text      = "Concluido";
            PctEntry.Visible      = true;
            BtnNext.Enabled       = true;
            lblCopy.Text          = "Todos os arquivos foram copiados";
            lblFile.Text          = "";
        }