Releasing ‐ Windows - NetLogo/NetLogo GitHub Wiki
Protips
The Windows build has been tested on Windows 10 and 11, but will probably work on other Windows platforms as well.
On Windows, there are two PATH variables that get used for locating executables, a System PATH and a User PATH. One common source of problems is for executables to be on one PATH, but not on the other. So, whenever an executable is mentioned here, if your system tells you that it's unfindable, try adding it to the PATH variable(s) that it's not currently on and then restarting that terminal window.
At some point, you might end up with some script errors about line endings. If you do, you need to convert the CRLFs to mere LFs. If you are using VS Code, you can change this by opening the problematic script, clicking the CRLF text in the bottom right, and selecting LF instead. Another way to do this is to open WSL, run sudo apt install dos2unix, and then run dos2unix on the offending files. The problematic ones will be netlogo-gui/colorpicker/stage.sh, helio/scripts/.*, helio/**/*.sh, helio/apps/docs/.env, and helio/apps/docs/scripts/generate-manual/.help.
Note that jpackage can generate warnings about being interfered with by Windows Defender. These can safely be ignored.
Tooling
Next, make sure you have Git for Windows, which can be obtained here. After installing it, you'll need to get sh.exe onto your PATH. To do that:
- Press Windows key
- Type "environment variables"
- Select "Edit System Environment Variables"
- Click the "Environment Variables..." button
- Select
Pathunder "System variables" - Click the "Edit..." button
- Click "New"
- Enter the name of the folder that contains
sh.exe(by default:C:\Program Files\Git\bin) - Click "OK"
- Click "OK"
- Click "OK"
You'll also need NPM. Windows seems to come with NPM, but maybe not the version that you need. Check the package.json of the color picker for which version is needed, but, if it's still v10.8, you can install that on Windows by running npm install -g [email protected].
The color picker build relies on a symlink that does not work on Windows by default, so before building for the first time, execute the following steps:
- Delete the default symlink, located at
netlogo-gui/resources/colorpickerrelative to the root of the repository. - Open the Command Prompt (not PowerShell!) (and you probably need admin privileges) and navigate to the root of the repository.
- Run the following command:
mklink /D netlogo-gui\resources\colorpicker ..\colorpicker\out
You will also need to install the WiX toolset. The build has been tested to use WiX 5.0.2, but will probably work with any 5.x or 4.x version. It will no longer work with any 3.x versions due to lack of backwards compatibility between version 3 and version 4. To install WiX, run:
dotnet tool install --global wix --version 5.0.2
wix extension add --global WixToolset.UI.wixext/5.0.2
The NetLogo build looks for WiX in Program Files, so find it (usually at ~\.dotnet\tools\), and copy .store and wix.exe into Program Files\WiX\.
You'll also need JDKs. You can get a 64-bit JDK from OpenJDK, and a 32-bit JDK from Liberica. When it comes to Liberica, be certain that you're downloading the option titled "Full JDK", which is not the default option in the dropdown. Without the full JDK, you won't have JavaFX, and the NetLogo installation won't be able to launch.
Once you have JDKs downloaded, make sure to get the appropriate JDK (probably the 64-bit one) onto your PATH (or PATHs), so SBT will use it. And then make sure you have SBT downloaded and installed.
Instructions
With the JDKs in place, modify the .jdks.yaml file at the root of the NetLogo repository to add in listings for your JDKs. When doing so, make sure to use / as the directory separator instead of the normal (for Windows) \ separator.
Eventually, once everything's set up, you can run sbt followed by dist/buildNetLogo and then something like dist/packageWinAggregate OpenJDK_17.0.2_64. You should build both 32- and 64-bit packages. At the end of it all, if everything went well, you'll be able to find the .msi files in dist/target/downloadPages/.
Obtained the generated Windows .properties file, and check it into version control. See this commit for an example.