private void TabsExtractOrPack_Selected(object sender, TabControlEventArgs e) { if (e.Action == TabControlAction.Selected && e.TabPage == tabSettings) { txtCoreTools.Text = CoreToolsDownloader.GetSolutionPackagerVersion()?.ToString() ?? Resources.SOLUTIONPACKAGER_MISSING; } }
private void TabsExtractOrPack_Selected(object sender, TabControlEventArgs e) { if (e.Action == TabControlAction.Selected && e.TabPage == tabSettings) { pluginViewModel.SolutionPackagerVersion = CoreToolsDownloader.GetSolutionPackagerVersion()?.ToString(); } }
private void BtnPack_Click(object sender, EventArgs e) { errorProvider.Clear(); int nrErrors = 0; if (txtInputPack.Text.Length == 0) { errorProvider.SetError(txtInputPack, Resources.INPUT_FOLDER_NOT_SPECIFIED); nrErrors += 1; } if (CoreToolsDownloader.GetSolutionPackagerVersion() == null) { errorProvider.SetError(chkImportSolution, Resources.SOLUTIONPACKAGER_MISSING); nrErrors += 1; } if (txtOutputPack.Text.Length == 0) { errorProvider.SetError(txtOutputPack, Resources.ZIP_FILE_NOT_SPECIFIED); nrErrors += 1; } if (nrErrors > 0) { errorProvider.SetError(btnPack, nrErrors == 1 ? Resources.EXPORT_ERROR : string.Format(CultureInfo.InvariantCulture, Resources.EXPORT_ERRORS, nrErrors)); return; } var parameters = new SolutionPackagerCaller.Parameters() { Action = "Pack", ZipFile = txtOutputPack.Text, OutputFolder = txtInputPack.Text, PackageType = packageTypes[cmbPackageTypePack.SelectedIndex], ErrorLevel = errorLevels[cmbErrorLevelPack.SelectedIndex], MapFile = txtMapPack.Text, NoLogo = chkNoLogoPack.Checked, LogFile = txtLogPack.Text, Arguments = txtArgumentsPack.Text }; if (chkImportSolution.Checked) { parameters.ImportSolutionParams = new CrmSolutionImporter.Parameters() { ImportDependencies = chkImportDependencies.Checked, ImportManaged = chkImportManaged.Checked, ImportOverwrite = chkImportOverwrite.Checked, ImportPublishWorkflows = chkImportPublishWorkflows.Checked, HoldingSolution = chkImportHoldingSolution.Checked, PreferManaged = cmbPackageTypePack.SelectedIndex == 3 && radPreferManaged.Checked }; } solutionPackagerCaller.ManageSolution(parameters); }
private void btnPack_Click(object sender, EventArgs e) { int nrErrors = 0; if (txtInputPack.Text.Length == 0) { errorProvider.SetError(txtInputPack, Resources.INPUT_FOLDER_NOT_SPECIFIED); nrErrors += 1; } if (CoreToolsDownloader.GetSolutionPackagerVersion() == null) { errorProvider.SetError(localOrCrm, Resources.SOLUTIONPACKAGER_MISSING); nrErrors += 1; } if (txtOutputPack.Text.Length == 0) { errorProvider.SetError(txtOutputPack, Resources.ZIP_FILE_NOT_SPECIFIED); nrErrors += 1; } if (nrErrors > 0) { errorProvider.SetError(btnPack, nrErrors == 1 ? Resources.EXPORT_ERROR : string.Format(CultureInfo.InvariantCulture, Resources.EXPORT_ERRORS, nrErrors)); return; } var parameters = new SolutionPackagerCaller.Parameters() { Action = "Pack", ZipFile = txtOutputPack.Text, OutputFolder = txtInputPack.Text, PackageType = packageTypes[cmbPackageTypePack.SelectedIndex], ErrorLevel = errorLevels[cmbErrorLevelPack.SelectedIndex], MapFile = txtMapPack.Text, NoLogo = chkNoLogoPack.Checked, LogFile = txtLogPack.Text, Arguments = txtArgumentsPack.Text }; solutionPackagerCaller.ManageSolution(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); } }