Skip to content

Commit 8328733

Browse files
committed
feat(build): build Windows .msi bundle
1 parent 81fdaaf commit 8328733

4 files changed

Lines changed: 71 additions & 6 deletions

File tree

.github/workflows/build-artifacts.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build Artifacts
22

33
on:
44
push:
5-
branches: [ master, build-test ]
5+
branches: [ master, build-test, build-artifacts ]
66

77
jobs:
88
build:
@@ -88,6 +88,31 @@ jobs:
8888
retention-days: 14
8989
archive: false
9090

91+
# Prepare build for 'msi' bundle
92+
- name: Setup .NET
93+
uses: actions/setup-dotnet@v5
94+
with:
95+
dotnet-version: '8.0.x'
96+
97+
- name: Install WiX Toolset
98+
run: dotnet tool install wix --global --version 3.14.1
99+
100+
- name: Verify WiX
101+
run: wix.exe --version
102+
103+
- name: Build msi
104+
run: ./gradlew :jadx-gui:jpackage
105+
106+
- name: Save msi artifact
107+
uses: actions/upload-artifact@v7
108+
with:
109+
name: ${{ format('jadx-gui-{0}.msi', env.JADX_VERSION) }}
110+
path: jadx-gui/build/jpackage/jadx-gui-*.msi
111+
if-no-files-found: error
112+
retention-days: 14
113+
# nightly.link support only '.zip' artifacts, issue: https://github.com/oprypin/nightly.link/issues/88
114+
# archive: false
115+
91116
build-mac-bundle:
92117
strategy:
93118
matrix:

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
with:
2121
release: 25
2222

23+
2324
- name: Set jadx version
2425
uses: actions/github-script@v9
2526
with:
@@ -41,6 +42,29 @@ jobs:
4142
if-no-files-found: error
4243
retention-days: 1
4344

45+
# Prepare build for 'msi' bundle
46+
- name: Setup .NET
47+
uses: actions/setup-dotnet@v5
48+
with:
49+
dotnet-version: '8.0.x'
50+
51+
- name: Install WiX Toolset
52+
run: dotnet tool install wix --global --version 3.14.1
53+
54+
- name: Verify WiX
55+
run: wix.exe --version
56+
57+
- name: Build msi
58+
run: ./gradlew :jadx-gui:jpackage
59+
60+
- name: Save msi artifact
61+
uses: actions/upload-artifact@v7
62+
with:
63+
name: ${{ format('jadx-gui-{0}.msi', env.JADX_VERSION) }}
64+
path: jadx-gui/build/jpackage/jadx-gui-*.msi
65+
if-no-files-found: error
66+
retention-days: 1
67+
4468
build-release-mac-bundle:
4569
strategy:
4670
matrix:

jadx-gui/build.gradle.kts

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ launch4j {
148148
mainClassName.set(application.mainClass.get())
149149
copyConfigurable.set(listOf<Any>())
150150
dontWrapJar.set(true)
151-
icon.set("$projectDir/src/main/resources/logos/jadx-logo.ico")
151+
icon.set("$projectDir/dist/windows/jadx-logo.ico")
152152
outfile.set("jadx-gui-$jadxVersion.exe")
153153
version.set(jadxVersion)
154154
copyright.set("Skylot")
@@ -191,7 +191,8 @@ runtime {
191191
"jdk.accessibility",
192192
)
193193
jpackage {
194-
if (DefaultNativePlatform.getCurrentOperatingSystem().isMacOsX) {
194+
val os = DefaultNativePlatform.getCurrentOperatingSystem()
195+
if (os.isMacOsX) {
195196
imageName = "jadx-gui"
196197
val fileAssociations =
197198
fileTree("$projectDir/dist/macos/jpackage-file-associations") { include("*.properties") }
@@ -210,10 +211,25 @@ runtime {
210211
installerType = "dmg"
211212
installerName = "jadx-gui"
212213
skipInstaller = false
214+
} else if (os.isWindows) {
215+
// WiX Toolset required, install using: winget install WixToolset.WixToolset
216+
appVersion = if (jadxVersion.matches(Regex("\\d+(\\.\\d+){0,2}"))) jadxVersion else "0.0.1"
217+
imageOptions = listOf("--icon", "$projectDir/dist/windows/jadx-logo.ico")
218+
skipInstaller = false
219+
installerType = "msi"
220+
installerOptions =
221+
listOf(
222+
"--win-menu",
223+
"--win-shortcut",
224+
"--win-dir-chooser",
225+
"--win-upgrade-uuid",
226+
"3d479468-383f-49fc-b374-53f64559dd9b",
227+
)
228+
} else if (os.isLinux) {
229+
appVersion = if (jadxVersion.matches(Regex("\\d+(\\.\\d+){0,2}"))) jadxVersion else "0.0.1"
230+
// TODO: setup linux packages, need to include jadx cli
213231
} else {
214-
imageOptions = listOf("--icon", "$projectDir/src/main/resources/logos/jadx-logo.ico")
215-
skipInstaller = true
216-
targetPlatformName = "win"
232+
throw RuntimeException("Unexpected OS: " + os)
217233
}
218234
}
219235
launcher {
File renamed without changes.

0 commit comments

Comments
 (0)