Skip to content
Permalink
Browse files
8258755: jpackage: Invalid 32-bit exe when building app-image
Reviewed-by: asemenyuk, almatvee, kizune
  • Loading branch information
Andy Herrick committed Jan 16, 2021
1 parent c3bdbf9 commit da4cf05dc6f602bcde1ff142e15463ce4a8295d2
@@ -33,6 +33,11 @@
#include "Toolbox.h"
#include "ErrorHandling.h"

#if defined(_WIN32) && !defined(_WIN64)
#define LAUNCH_FUNC "_JLI_Launch@56"
#else
#define LAUNCH_FUNC "JLI_Launch"
#endif

Jvm& Jvm::initFromConfigFile(const CfgFile& cfgFile) {
const CfgFile::Properties& appOptions = cfgFile.getProperties(
@@ -204,7 +209,7 @@ void Jvm::launch() {

LOG_TRACE(tstrings::any() << "JVM library: \"" << jvmPath << "\"");

DllFunction<LaunchFuncType> func(Dll(jvmPath), "JLI_Launch");
DllFunction<LaunchFuncType> func(Dll(jvmPath), LAUNCH_FUNC);
int exitStatus = func(argc, argv.data(),
0, 0,
0, 0,
@@ -112,7 +112,7 @@ private Path compile(WixSource wixSource) throws IOException {
"-nologo",
adjustPath.apply(wixSource.source).toString(),
"-ext", "WixUtilExtension",
"-arch", "x64",
"-arch", WixSourcesBuilder.is64Bit() ? "x64" : "x86",
"-out", wixObj.toAbsolutePath().toString()
));

@@ -157,6 +157,10 @@ void logWixFeatures() {
}
}

static boolean is64Bit() {
return !("x86".equals(System.getProperty("os.arch")));
}

private void normalizeFileAssociation(FileAssociation fa) {
fa.launcherPath = addExeSuffixToPath(
installedAppImage.launchersDirectory().resolve(fa.launcherPath));
@@ -301,7 +305,7 @@ boolean isFile() {
static void startElement(XMLStreamWriter xml, String componentId,
String componentGuid) throws XMLStreamException, IOException {
xml.writeStartElement("Component");
xml.writeAttribute("Win64", "yes");
xml.writeAttribute("Win64", is64Bit() ? "yes" : "no");
xml.writeAttribute("Id", componentId);
xml.writeAttribute("Guid", componentGuid);
}
@@ -823,7 +827,8 @@ Path getPath(WixSourcesBuilder outer) {

private final static Path DESKTOP_PATH = TARGETDIR.resolve("DesktopFolder");

private final static Path PROGRAM_FILES = TARGETDIR.resolve("ProgramFiles64Folder");
private final static Path PROGRAM_FILES = TARGETDIR.resolve(
is64Bit() ? "ProgramFiles64Folder" : "ProgramFilesFolder");

private final static Path LOCAL_PROGRAM_FILES = TARGETDIR.resolve("LocalAppDataFolder");

1 comment on commit da4cf05

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on da4cf05 Jan 16, 2021

Please sign in to comment.