windows-msi: Replace build.wsf and build-and-package.ps1 with CMake#1295
windows-msi: Replace build.wsf and build-and-package.ps1 with CMake#1295flichtenheld wants to merge 1 commit intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the windows-msi/ packaging workflow from a custom WSH/JavaScript “make”-like system (build.wsf, helper JS, and wrapper PowerShell scripts) to a CMake-driven build that also downloads required merge modules/binaries during configuration.
Changes:
- Replaces
build.wsf+ JS helper build rules with a new CMake-based build/packaging pipeline (windows-msi/CMakeLists.txt). - Replaces
version.m4withversion.cmakeand updates version bumping + Renovate + release/CI automation accordingly. - Updates documentation and CI/release scripts to use
cmake -B build/cmake --build build, including signing-related env var handling.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| windows-msi/CMakeLists.txt | New CMake build that builds OpenVPN/OpenVPN-GUI, downloads dependencies, preprocesses docs, and runs WiX to produce MSIs. |
| windows-msi/version.cmake | CMake variable replacement for former version.m4 values (dependencies + MSI metadata). |
| windows-msi/README.rst | Documentation updated to reflect CMake-based workflow and signing env vars. |
| windows-msi/bump-version.sh | Updated to edit version.cmake instead of version.m4. |
| windows-msi/bump-version.ps1 | Updated to edit version.cmake instead of version.m4. |
| renovate.json | Regex manager updated to track versions in version.cmake. |
| release/windows-installer-build.sh | Updated release build flow to use CMake and a generated build-env.bat. |
| release/version-and-tags.sh | Updated to bump version.cmake and run the updated bump script. |
| .github/workflows/build.yaml | CI updated to configure/build via CMake and to bump version.cmake. |
| .gitignore | Updates ignored env file name for signing build. |
| windows-msi/build.wsf / windows-msi/build-and-package.ps1 / windows-msi/script/* | Removes the legacy WSH/JS build system and wrapper scripts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Wow, amazing! I'll have a look. |
8c16280 to
0bf2f2e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 21 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0bf2f2e to
cf8272f
Compare
The JavaScript code had a limited implementation of a make system. So instead replace it by using an actual make system. File dependencies are downloaded in the configuration phase. Also replace version.m4 with a version.cmake since I could find no indication that it was used with m4 currently (maybe it was useful in the distant past, but not today). Github: Closes #1111 Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
cf8272f to
5471587
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 25 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function(download_file url dest) | ||
| if(NOT EXISTS "${dest}") | ||
| message(STATUS "Downloading ${url}") | ||
| file(DOWNLOAD "${url}" "${dest}" | ||
| STATUS _dl_status | ||
| ) | ||
| list(GET _dl_status 0 _dl_code) | ||
| if(NOT _dl_code EQUAL 0) | ||
| file(REMOVE "${dest}") | ||
| message(FATAL_ERROR "Failed to download ${url}: ${_dl_status}") | ||
| endif() | ||
| endif() | ||
| endfunction() |
There was a problem hiding this comment.
download_file() only checks whether the destination path exists, so changing a version in version.cmake can silently keep using an older cached artifact (e.g., openvpnserv2.exe, tap-windows6.msm, ovpn-dco.msm) unless the user manually deletes the build/tmp directory. This can produce MSIs with mismatched dependency versions. Consider versioned destination filenames and/or a stamp file that records the URL/version and forces a re-download when it changes (or add an explicit clean/refresh target).
|
|
||
| file(WRITE "${OUTPUT}" "") | ||
| foreach(_file ${INPUTS}) | ||
| file(READ "${_file}" _content) |
There was a problem hiding this comment.
concat_files.cmake concatenates inputs verbatim and doesn't normalize line endings. Previously license.txt was generated with CRLF, but this script will preserve whatever line endings the source files have (often LF), which can lead to inconsistent formatting in the installed Windows text files. Consider normalizing \n to \r\n (similar to convert_to_crlf.cmake) or running the concatenated output through the CRLF conversion step.
| file(READ "${_file}" _content) | |
| file(READ "${_file}" _content) | |
| # Normalize line endings to CRLF so Windows-installed text files are consistent. | |
| # First collapse any existing CRLF sequences to LF, then convert LF back to CRLF. | |
| string(REPLACE "\r\n" "\n" _content "${_content}") | |
| string(REPLACE "\n" "\r\n" _content "${_content}") |
The JavaScript code had a limited implementation of a make system. So instead replace it by using an actual make system.
File dependencies are downloaded in the configuration phase.
Also replace version.m4 with a version.cmake since I could find no indication that it was used with m4 currently (maybe it was useful in the distant past, but not today).
Github: Closes #1111