Skip to content

Commit 3000b87

Browse files
committed
fix error when running light command (msi/msm generation)
1 parent 00dee20 commit 3000b87

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

src/main/java/io/github/fvarrui/javapackager/model/Arch.java

+9
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,14 @@ public Architecture toRpmArchitecture() {
4747
default: return null;
4848
}
4949
}
50+
51+
public String toMsiArchitecture() {
52+
switch (this) {
53+
case aarch64: return "arm64";
54+
case x64: return "x64";
55+
case x86: return "x86";
56+
default: return null;
57+
}
58+
}
5059

5160
}

src/main/java/io/github/fvarrui/javapackager/packagers/GenerateMsi.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected File doApply(WindowsPackager packager) throws Exception {
6363
// lighting wxs file
6464
Logger.info("Linking file " + wixobjFile);
6565
File msiFile = new File(outputDirectory, name + "_" + version + ".msi");
66-
execute("light", "-spdb", "-out", msiFile, wixobjFile);
66+
execute("light", "-sw1076", "-spdb", "-out", msiFile, wixobjFile);
6767

6868
// setup file
6969
if (!msiFile.exists()) {

src/main/java/io/github/fvarrui/javapackager/packagers/GenerateMsm.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected File doApply(WindowsPackager packager) throws Exception {
6262
// lighting wxs file
6363
Logger.info("Linking file " + wixobjFile);
6464
File msmFile = new File(outputDirectory, name + "_" + version + ".msm");
65-
CommandUtils.execute("light", "-spdb", "-out", msmFile, wixobjFile);
65+
CommandUtils.execute("light", "-sw1076", "-spdb", "-out", msmFile, wixobjFile);
6666

6767
// setup file
6868
if (!msmFile.exists()) {

src/main/resources/windows/msm.wxs.vtl

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
#set ($name = $info.name.replaceAll("[^A-Za-z0-9_.]", "_"))
2+
#if ($info.arch.toMsiArchitecture() == "arm64")
3+
#set ($installedVersion = "500")
4+
#else
5+
#set ($installedVersion = "200")
6+
#end
27
#set ($id = 0)
38
#macro(list $file)
49
#set($guid = $GUID.randomUUID())
@@ -30,7 +35,7 @@
3035
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3136
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3237
<Module Id="${name}_Module" Codepage="1252" Language="1033" Version="${info.winConfig.productVersion}">
33-
<Package Id="${GUID.randomUUID()}" Manufacturer="${info.organizationName}" InstallerVersion="200" Languages="1033" Platform="x64" SummaryCodepage="1252" Description="${info.description}"/>
38+
<Package Id="${GUID.randomUUID()}" Manufacturer="${info.organizationName}" InstallerVersion="${installedVersion}" Languages="1033" Platform="${info.arch.toMsiArchitecture()}" SummaryCodepage="1252" Description="${info.description}"/>
3439
<Directory Id="TARGETDIR" Name="SourceDir">
3540
#list(${info.appFolder})
3641
<Directory Id="ProgramMenuFolder" />

0 commit comments

Comments
 (0)