|
3 | 3 | This is a CMake project to build a Windows installer for [Apache |
4 | 4 | JMeter](https://jmeter.apache.org/). The installer will be used to create a |
5 | 5 | [winget](https://learn.microsoft.com/windows/package-manager/) package. |
| 6 | + |
| 7 | +## Prerequisites |
| 8 | + |
| 9 | +- [CMake](https://cmake.org/) |
| 10 | +- [Ninja](https://ninja-build.org/) |
| 11 | +- [WiX v3](https://wixtoolset.org/docs/wix3/) (if packaging on Windows) |
| 12 | + |
| 13 | +You can install the first two components with the following |
| 14 | +[winget](https://learn.microsoft.com/windows/package-manager/winget/) commands: |
| 15 | + |
| 16 | +```powershell |
| 17 | +winget install --id Kitware.CMake |
| 18 | +winget install --id Ninja-build.Ninja |
| 19 | +``` |
| 20 | + |
| 21 | +WiX v3 is available at <https://github.com/wixtoolset/wix3/releases/>. It |
| 22 | +requires .NET Framework 3.5, which can be installed with the following command: |
| 23 | + |
| 24 | +```powershell |
| 25 | +Start-Process ` |
| 26 | + -FilePath pwsh ` |
| 27 | + -ArgumentList "-Command `"& {Enable-WindowsOptionalFeature -Online -FeatureName NetFx3}`"" ` |
| 28 | + -Wait ` |
| 29 | + -Verb RunAs |
| 30 | +``` |
| 31 | + |
| 32 | +Update your path environment with `setx` (supposing you installed the tools in |
| 33 | +their default directories): |
| 34 | + |
| 35 | +```powershell |
| 36 | +setx PATH ($(Get-ItemProperty -Path HKCU:\Environment -Name Path).Path + "${env:ProgramFiles(x86)}\WiX Toolset v3.11\bin") |
| 37 | +``` |
| 38 | + |
| 39 | +Check if `PATH` was set correctly: |
| 40 | + |
| 41 | +``` |
| 42 | +Get-Command cmake |
| 43 | +Get-Command ninja |
| 44 | +Get-Command candle |
| 45 | +``` |
| 46 | + |
| 47 | +You may need to restart your Windows session if you can't find `ninja` even |
| 48 | +after restarting your terminal. |
| 49 | + |
| 50 | +## Build |
| 51 | + |
| 52 | +Use the following commands to generate the installation package: |
| 53 | + |
| 54 | +```powershell |
| 55 | +cmake -B build -G Ninja |
| 56 | +cmake --build build --target package |
| 57 | +``` |
| 58 | + |
| 59 | +You need Internet access to execute the build process to download the Apache |
| 60 | +JMeter binaries. |
| 61 | + |
| 62 | +If successful, the MSI file will be available in the `build` directory. |
0 commit comments