You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the ant build script (build.xml) and the GitHub build action (.github/workflows/build.yaml).
Construct and add appropriate Windows icon file (icon.ico).
Add explanation and instructions to readme file (README.md).
Copy file name to clipboardExpand all lines: README.md
+20-4Lines changed: 20 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# NativeJavaApp
2
2
Scaffold for creating double-clickable apps using Java
3
3
4
-
This project uses Apache Ant and JDK 25 to compile, bundle, and package a Java application into native installers (.dmg for macOS and .deb for Ubuntu).
4
+
This project uses Apache Ant and JDK 25 to compile, bundle, and package a Java application into native installers (.dmg for macOS, .deb for Ubuntu, and .msi for Windows).
5
5
6
6
## Common Requirements (All Systems)
7
7
Before running the build, ensure the following are installed and configured:
@@ -27,6 +27,16 @@ sudo apt install ant fakeroot dpkg-dev
27
27
- fakeroot: Allows the package to be built with correct file permissions without requiring root access.
28
28
- dpkg-dev: Provides the core utilities to create Debian packages.
29
29
- Icon Asset: A file named icon.png (512x512 recommended) must be in the project root.
30
+
## Windows Setup
31
+
To build the .msi installer on Windows, ensure the following:
32
+
- JDK 21 or 25: Must be installed with JAVA_HOME configured.
33
+
- Apache Ant: Installed and available in your PATH.
34
+
- WiX Toolset: Required by jpackage to create MSI installers.
35
+
- Download and install from: https://wixtoolset.org/releases/
36
+
- Version 3.11 or higher is recommended.
37
+
- After installation, verify WiX is in your PATH by running: `candle -?`
38
+
- Icon Asset: A file named icon.ico must be in the project root.
39
+
- Note on Security: Windows may show a SmartScreen warning for unsigned installers. Users will need to click "More info" > "Run anyway" to install the app.
30
40
## Project Directory Structure
31
41
Ensure your project looks like this for the build.xml to find all resources:
32
42
@@ -36,6 +46,7 @@ MyAppName/
36
46
│ └── Main.java # Your source code
37
47
├── icon.icns # Required for macOS DMG
38
48
├── icon.png # Required for Ubuntu DEB
49
+
├── icon.ico # Required for Windows MSI
39
50
└── build.xml # The Ant build script
40
51
```
41
52
## Usage Commands
@@ -44,7 +55,7 @@ Open your terminal in the project root and use the following targets:
44
55
| Command | Description |
45
56
|-----|-----|
46
57
| ant | The default; runs the package target. |
47
-
| ant package | Automatically detects OS and builds .dmg (Mac) or .deb (Linux). |
58
+
| ant package | Automatically detects OS and builds .dmg (Mac), .deb (Linux), or .msi (Windows). |
48
59
| ant run | Compiles and launches the app immediately for testing. |
49
60
| ant clean | Deletes the build/ and dist/ folders to start fresh. |
50
61
| ant -p | Displays a help menu of all available targets. |
@@ -58,6 +69,10 @@ Open your terminal in the project root and use the following targets:
58
69
<td>Linux Icon Error: </td>
59
70
<td>If the Linux build fails, ensure icon.png is not just a renamed .icns or .jpg. It must be a valid PNG file.</td>
60
71
</tr>
72
+
<tr>
73
+
<td>Windows "candle.exe not found": </td>
74
+
<td>Install WiX Toolset 3.11+ and ensure it's in your PATH. jpackage uses WiX to create MSI installers on Windows.</td>
75
+
</tr>
61
76
<tr>
62
77
<td>Permissions: </td>
63
78
<td>If the generated .app or .deb won't execute, ensure you have the necessary write permissions in the dist/ directory.</td>
@@ -69,8 +84,8 @@ This project uses GitHub Actions to automatically build and distribute native in
69
84
70
85
### The Build Phase (Continuous Integration)
71
86
Every time you push code to the main branch or open a Pull Request:
72
-
- GitHub starts a macOS runner and an Ubuntu runner.
73
-
-Both systems compile the code and create their respective installers (.dmgand .deb).
87
+
- GitHub starts a macOS runner, an Ubuntu runner, and a Windows runner.
88
+
-All systems compile the code and create their respective installers (.dmg, .deb, and .msi).
74
89
- The installers are saved as Artifacts in the GitHub Actions run summary for 90 days.
75
90
### The Release Phase (Continuous Deployment)
76
91
A formal GitHub Release is only triggered when you push a version tag.
@@ -92,6 +107,7 @@ git push origin v1.0.1
92
107
- Under Assets, you will find:
93
108
- MyAntApp-Installer.dmg (for macOS)
94
109
- MyAntApp-Linux.deb (for Ubuntu/Debian)
110
+
- MyAntApp-Windows.msi (for Windows)
95
111
96
112
### Changing the Version Number
97
113
When ready to bump the version, remember to update the version number in **two** places to keep everything in sync:
0 commit comments