Skip to content

windows-msi: Replace build.wsf and build-and-package.ps1 with CMake#1295

Open
flichtenheld wants to merge 1 commit intomasterfrom
msi-cmake-build
Open

windows-msi: Replace build.wsf and build-and-package.ps1 with CMake#1295
flichtenheld wants to merge 1 commit intomasterfrom
msi-cmake-build

Conversation

@flichtenheld
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.m4 with version.cmake and 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.

@lstipakov
Copy link
Copy Markdown
Member

Wow, amazing! I'll have a look.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +242 to +254
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()
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.

file(WRITE "${OUTPUT}" "")
foreach(_file ${INPUTS})
file(READ "${_file}" _content)
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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}")

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

We should get rid of build.wsf

3 participants