private void BtnExtract_Click(object sender, EventArgs e) { int nrErrors = 0; if (txtOutputFolder.Text.Length == 0) { errorProvider.SetError(txtOutputFolder, Resources.OUTPUT_FOLDER_NOT_SPECIFIED); nrErrors += 1; } if (localOrCrm.Checked) { if (cmbCrmSolutions.SelectedIndex < 0) { errorProvider.SetError(cmbCrmSolutions, Resources.NO_SOLUTION_SELECTED); nrErrors += 1; } } else { if (!File.Exists(txtZipPath.Text)) { errorProvider.SetError(txtZipPath, Resources.ZIP_FILE_DOES_NOT_EXIST); nrErrors += 1; } } if (nrErrors > 0) { errorProvider.SetError(btnExtract, nrErrors == 1 ? Resources.EXPORT_ERROR : string.Format(CultureInfo.InvariantCulture, Resources.EXPORT_ERRORS, nrErrors)); return; } var parameters = new SolutionPackagerCaller.Parameters() { ZipFile = txtZipPath.Text, OutputFolder = txtOutputFolder.Text, AllowWrite = chkAllowWrite.Checked, AllowDelete = radAllowDeleteYes.Checked ? true : (radAllowDeleteNo.Checked ? false : default(bool?)) }; if (localOrCrm.Checked) { crmSolutionManager.DownloadSolution( new CrmSolutionManager.DownloadSolutionParams( cmbCrmSolutions.SelectedItem as Models.Solution, zipDirectory: txtZipPath.Text, solutionPackagerParameters: parameters, managed: radManaged.Checked, exportAutoNumberingSettings: chkExportAutoNumbering.Checked, exportCalendarSettings: chkExportCalendar.Checked, exportCustomizationSettings: chkExportCustomization.Checked, exportEmailTrackingSettings: chkExportEmailTracking.Checked, exportExternalApplications: chkExportExternalApplications.Checked, exportGeneralSettings: chkExportGeneralSettings.Checked, exportIsvConfig: chkExportISVConfig.Checked, exportMarketingSettings: chkExportMarketing.Checked, exportOutlookSynchronizationSettings: chkExportOutlookSynchronization.Checked, exportRelationshipRoles: chkExportRelationshipRoles.Checked, exportSales: chkExportSales.Checked)); } else { solutionPackagerCaller.ExtractSolution(parameters); } }
private void BtnExtract_Click(object sender, EventArgs e) { int nrErrors = 0; if (txtOutputExtract.Text.Length == 0) { errorProvider.SetError(txtOutputExtract, Resources.OUTPUT_FOLDER_NOT_SPECIFIED); nrErrors += 1; } if (CoreToolsDownloader.GetSolutionPackagerVersion() == null) { errorProvider.SetError(localOrCrm, Resources.SOLUTIONPACKAGER_MISSING); nrErrors += 1; } if (localOrCrm.Checked) { if (cmbCrmSolutions.SelectedIndex < 0) { errorProvider.SetError(cmbCrmSolutions, Resources.NO_SOLUTION_SELECTED); nrErrors += 1; } } else { if (!File.Exists(txtInputExtract.Text)) { errorProvider.SetError(txtInputExtract, Resources.ZIP_FILE_DOES_NOT_EXIST); nrErrors += 1; } } if (nrErrors > 0) { errorProvider.SetError(btnExtract, nrErrors == 1 ? Resources.EXPORT_ERROR : string.Format(CultureInfo.InvariantCulture, Resources.EXPORT_ERRORS, nrErrors)); return; } var parameters = new SolutionPackagerCaller.Parameters() { Action = "Extract", ZipFile = txtInputExtract.Text, OutputFolder = txtOutputExtract.Text, PackageType = packageTypes[cmbPackageTypeExtract.SelectedIndex], AllowWrite = chkAllowWriteExtract.Checked, AllowDelete = radAllowDeleteYes.Checked ? true : (radAllowDeleteNo.Checked ? false : default(bool?)), Clobber = chkClobberExtract.Checked, ErrorLevel = errorLevels[cmbErrorLevelExtract.SelectedIndex], MapFile = txtMapExtract.Text, NoLogo = chkNoLogoExtract.Checked, LogFile = txtLogExtract.Text, Arguments = txtArgumentsExtract.Text, SourceLocale = languageCodes[cmbSourceLocaleExtract.SelectedIndex], Localize = chkLocalizeExtract.Checked, FormatXml = chkFormatDocumentExtract.Checked }; if (localOrCrm.Checked) { crmSolutionManager.DownloadSolution( new CrmSolutionManager.DownloadSolutionParams( cmbCrmSolutions.SelectedItem as Models.Solution, zipDirectory: txtInputExtract.Text, solutionPackagerParameters: parameters, managed: parameters.PackageType == "Both" ? new bool[] { true, false } : new bool[] { radManaged.Checked }, exportAutoNumberingSettings: chkExportAutoNumbering.Checked, exportCalendarSettings: chkExportCalendar.Checked, exportCustomizationSettings: chkExportCustomization.Checked, exportEmailTrackingSettings: chkExportEmailTracking.Checked, exportExternalApplications: chkExportExternalApplications.Checked, exportGeneralSettings: chkExportGeneralSettings.Checked, exportIsvConfig: chkExportISVConfig.Checked, exportMarketingSettings: chkExportMarketing.Checked, exportOutlookSynchronizationSettings: chkExportOutlookSynchronization.Checked, exportRelationshipRoles: chkExportRelationshipRoles.Checked, exportSales: chkExportSales.Checked)); } else { solutionPackagerCaller.ManageSolution(parameters); } }