From 488ce5c32d4698dbdc5b71a9bbf38c5a888320e9 Mon Sep 17 00:00:00 2001 From: "Vladimir.Orlov" Date: Mon, 4 Mar 2019 11:19:59 +0300 Subject: [PATCH] IDEA-207608 [jbr11 windows installers] It is better to remove checkboxes related to win32 system from Setup dialog --- build/conf/nsis/idea.nsi | 12 ++++++++---- .../build/impl/WinExeInstallerBuilder.groovy | 8 +++++--- .../build/impl/WindowsDistributionBuilder.groovy | 4 ++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/build/conf/nsis/idea.nsi b/build/conf/nsis/idea.nsi index 3ec266cd6608..e8ba9ed46080 100644 --- a/build/conf/nsis/idea.nsi +++ b/build/conf/nsis/idea.nsi @@ -383,16 +383,19 @@ FunctionEnd Function ConfirmDesktopShortcut !insertmacro MUI_HEADER_TEXT "$(installation_options)" "$(installation_options_prompt)" + ; shortcut for 64-bit launcher. + StrCpy $R0 "${MUI_PRODUCT} launcher" + StrCpy $R1 "" + ; not suggest user to create shortcut for 32Bit launcher if bundled jre does not support 32Bit. + StrCmp "${JRE_32BIT_VERSION_SUPPORTED}" "null" getInstallationOptionsPositions 0 ${StrRep} $0 ${PRODUCT_EXE_FILE} "64.exe" ".exe" ${If} $0 == ${PRODUCT_EXE_FILE} + ; shortcuts for 32-bit and 64-bit. StrCpy $R0 "32-bit launcher" StrCpy $R1 "64-bit launcher" - ${Else} - ;there is only one launcher and it is 64-bit. - StrCpy $R0 "${MUI_PRODUCT} launcher" - StrCpy $R1 "" ${EndIf} +getInstallationOptionsPositions: Call getInstallationOptionsPositions !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field $launcherShortcut" "Text" $R0 @@ -411,6 +414,7 @@ Function ConfirmDesktopShortcut Pop $R0 ${EndIf} + StrCmp "${JRE_32BIT_VERSION_SUPPORTED}" "null" custom_pre_actions 0 ; if jre x86 for the build is available then add checkbox to Installation Options dialog StrCmp "${LINK_TO_JRE}" "null" custom_pre_actions 0 inetc::head /SILENT /TOSTACK /CONNECTTIMEOUT 2 ${LINK_TO_JRE} "" /END diff --git a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/WinExeInstallerBuilder.groovy b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/WinExeInstallerBuilder.groovy index 7579ce78efe4..4a03de716348 100644 --- a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/WinExeInstallerBuilder.groovy +++ b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/WinExeInstallerBuilder.groovy @@ -74,7 +74,8 @@ class WinExeInstallerBuilder { customizer.fileAssociations.collect { !it.startsWith(".") ? ".$it" : it} } - void buildInstaller(String winDistPath, String additionalDirectoryToInclude, String secondJreSuffix = null) { + void buildInstaller(String winDistPath, String additionalDirectoryToInclude, String secondJreSuffix = null, String jre32BitVersionSupported = null) { + if (!SystemInfoRt.isWindows && !SystemInfoRt.isLinux) { buildContext.messages.warning("Windows installer can be built only under Windows or Linux") return @@ -130,7 +131,7 @@ class WinExeInstallerBuilder { buildContext.messages.error("Failed to generated list of files for NSIS installer: $e") } - prepareConfigurationFiles(box, winDistPath) + prepareConfigurationFiles(box, winDistPath, jre32BitVersionSupported) customizer.customNsiConfigurationFiles.each { ant.copy(file: it, todir: "$box/nsiconf", overwrite: "true") } @@ -183,7 +184,7 @@ class WinExeInstallerBuilder { buildContext.notifyArtifactBuilt(installerPath) } - private void prepareConfigurationFiles(String box, String winDistPath) { + private void prepareConfigurationFiles(String box, String winDistPath, String jre32BitVersionSupported = null) { def productProperties = buildContext.productProperties def x64LauncherName = "${productProperties.baseFileName}64.exe" def mainExeLauncherName = customizer.include32BitLauncher ? "${productProperties.baseFileName}.exe" : x64LauncherName @@ -213,6 +214,7 @@ class WinExeInstallerBuilder { !define ASSOCIATION "$fileAssociations" !define UNINSTALL_WEB_PAGE "${customizer.getUninstallFeedbackPageUrl(buildContext.applicationInfo) ?: "feedback_web_page"}" !define LINK_TO_JRE "$linkToJre" +!define JRE_32BIT_VERSION_SUPPORTED "$jre32BitVersionSupported" ; if SHOULD_SET_DEFAULT_INSTDIR != 0 then default installation directory will be directory where highest-numbered IDE build has been installed ; set to 1 for release build diff --git a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/WindowsDistributionBuilder.groovy b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/WindowsDistributionBuilder.groovy index 41200936e81e..06d6e6e4e5c1 100644 --- a/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/WindowsDistributionBuilder.groovy +++ b/platform/build-scripts/groovy/org/jetbrains/intellij/build/impl/WindowsDistributionBuilder.groovy @@ -121,11 +121,11 @@ class WindowsDistributionBuilder extends OsSpecificDistributionBuilder { def productJsonDir = new File(buildContext.paths.temp, "win.dist.product-info.json.exe").absolutePath generateProductJson(productJsonDir, jreDirectoryPath64 != null) new ProductInfoValidator(buildContext).validateInDirectory(productJsonDir, "", [winDistPath, jreDirectoryPath64], []) - new WinExeInstallerBuilder(buildContext, customizer, jreDirectoryPath64).buildInstaller(winDistPath, productJsonDir) + new WinExeInstallerBuilder(buildContext, customizer, jreDirectoryPath64).buildInstaller(winDistPath, productJsonDir, null, buildContext.bundledJreManager.is32bitArchSupported() ? "32bitArchSupported" : null) if (secondJreDirectoryPath != null) { generateProductJson(productJsonDir, secondJreDirectoryPath != null) new ProductInfoValidator(buildContext).validateInDirectory(productJsonDir, "", [winDistPath, secondJreDirectoryPath], []) - new WinExeInstallerBuilder(buildContext, customizer, secondJreDirectoryPath).buildInstaller(winDistPath, productJsonDir, "-jbr${buildContext.bundledJreManager.getSecondJreVersion()}") + new WinExeInstallerBuilder(buildContext, customizer, secondJreDirectoryPath).buildInstaller(winDistPath, productJsonDir, "-jbr${buildContext.bundledJreManager.getSecondJreVersion()}", buildContext.bundledJreManager.getSecondJreVersion().toInteger() == 8 ? "32bitArchSupported" : null) } } }