//Instalação do Import Service public void ProgressImportInstalation() { if (InvokeRequired) { this.Invoke(new MethodInvoker(ProgressImportInstalation)); return; } import.CreateFolderImport(); //Move progress ProgressBarUpdate(); //Se não for Update, cria o serviço if (!ControllerClass.isUpdate) { lblProImport.Text = "Criando chaves de registro..."; lblProImport.Refresh(); import.CreateConferencingRegKeys(); import.CreateNDDigitalRegKeys(); lblProImport.Text = "Criando Serviço do Cold Import..."; lblProImport.Refresh(); //Move progress ProgressBarUpdate(); Services.CreateService(ControllerClass.PathFolder + @"\Connector\Import Service\NDDigital.eForms.ColdImport.Service.exe", "NDDigitaleFormsImportService", "Serviço responsável pela importação de documentos NF-e e CT-e para armazenamento em Cold.", "NDDigital e-Forms Cold Import Service"); //Move progress ProgressBarUpdate(); ExtractResources(); //Move progress ProgressBarUpdate(); MoveDLLs(@"C:\Inst\ImportService"); } //Caso seja Update, para o serviço para atualizar as DLLs else { lblProImport.Text = "Parando Serviço do Cold Import..."; lblProImport.Refresh(); //Move progress ProgressBarUpdate(); //Parando os Serviços Services.ServiceStop(); Thread.Sleep(2000); lblProImport.Text = "Deletando arquivos antigos..."; lblProImport.Refresh(); removeFiles.DeleteFilesFrom(ControllerClass.PathFolder + @"\Connector\Import Service"); //Move progress ProgressBarUpdate(); //Extrai DLLs ExtractResources(); //Move progress ProgressBarUpdate(); lblProImport.Text = "Movendo DLLS para a pasta de destino..."; lblProImport.Refresh(); //Move DLLs para o caminho de destino MoveDLLs(@"C:\Inst\ImportService"); lblProImport.Text = "Finalizando..."; lblProImport.Refresh(); } lblProImport.Text = "Iniciando o Serviço do Cold Import..."; lblProImport.Refresh(); //Inicia Serviço Services.ServiceStart(); //Move progress ProgressBarUpdate(); lblProImport.Font = new Font(lblProImport.Font, FontStyle.Bold); lblProImport.ForeColor = Color.Green; lblProImport.Text = "Concluido"; PctImport.Visible = true; BtnNext.Enabled = true; lblCopy.Text = "Todos os arquivos foram copiados"; lblFile.Text = ""; }