Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add otp_win.zip to releases #8729

Closed
wants to merge 3 commits into from
Closed

Conversation

wojtekmach
Copy link
Contributor

@wojtekmach wojtekmach commented Aug 16, 2024

I'd like to propose including Windows .zip release besides the .exe installer in GitHub releases.

I'm building a CLI tool that allows easily installing multiple OTP versions. I'd prefer not to use the installers for the following reasons:

  • They write to Windows registry. While most registry entries are nicely namespaced so there would not be any conflicts, I'd prefer not to leave things behind. Worth mentioning there are global entries for windows features like the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Erlang OTP and HKCR ".erl".
  • At the moment, installers require admin permissions (Windows installer without admin privileges #8531)

After downloading the .zip, users can manually run the included Install.exe.

Btw, the release requires vc_redist.x64.exe (also mentioned in #8531) so if this proposal is accepted, the question is whether it should be included in the .zip.

FWIW, in my tool I'm downloading and running it myself:

ensure_vcredist() {
  if [ -f /c/windows/system32/vcruntime140.dll ]; then
    return
  fi

  url="https://aka.ms/vs/17/release/vc_redist.x64.exe"
  file="vc_redist.x64.exe"

  echo "downloading VC++ Redistributable $url..."
  curl --retry 3 --fail -L -o "$file" "$url"
  echo "installing VC++ Redistributable $url..."
  ./"$file" /quiet /norestart
}

Another idea for not writing to windows registry would be to add a flag to generated installer, we can allegedly read it with ${GetParameters} $R0, something it would perhaps be something like otp_win64_27.1.exe /NOWINREG.

cc @tsloughter

@wojtekmach wojtekmach changed the base branch from master to maint August 16, 2024 12:17
Copy link
Contributor

github-actions bot commented Aug 16, 2024

CT Test Results

  1 files   11 suites   4m 34s ⏱️
 93 tests  91 ✅ 2 💤 0 ❌
109 runs  107 ✅ 2 💤 0 ❌

Results for commit da2159f.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@@ -614,7 +626,7 @@ jobs:
run: |
shopt -s nullglob
cd artifacts
FILES=$(ls {*.tar.gz,*.txt})
FILES=$(ls {*.tar.gz,*.zip,*.txt})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

at the moment the .zip is not yet included in the release, I'm not sure how .exe ends up here. I assume it's via some actions/download-artifact but I couldn't figure it out. Any help would be appreciated.

@garazdawi
Copy link
Contributor

The windows .exe and .dll files attached to each release are not created by GitHub actions, but our internal scripts. This because they need to be signed with our certificate and we cannot do that using GitHub actions. So if we want to have .zip for windows we either need to re-package the installer added by the sync releases GitHub action, or add the appropriate scripts to our internal ci that uploads it to erlang.org/downloads.

I’ll try to get back to you next week to see if/how we can solve this.

@tsloughter
Copy link
Contributor

Yea, I have the same use case as @wojtekmach. I plan to support Windows in https://github.com/tsloughter/beamup/ and use the binary releases and being able to just unzip the release would be nice.

@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Aug 19, 2024
@garazdawi garazdawi self-assigned this Aug 19, 2024
@garazdawi
Copy link
Contributor

garazdawi commented Aug 20, 2024

We don't mind having this functionality so would welcome a PR that adds it.

I suggest that it is done by creating a new github workflow that triggers on release creation+edit that downloads the windows installers (32 and 64-bit), installs them and then creates .zip files from what is installed.

The same workflow could also be triggered on dispatch to create .zip files for any release that has already been released.

@garazdawi garazdawi added the waiting waiting for changes/input from author label Aug 20, 2024
@wojtekmach
Copy link
Contributor Author

@garazdawi my understanding is UNIX installations are relocatable since a few releases but windows aren't. In my testing, after I moved the installation directory, I couldn't run bin/erl anymore, it complained it couldn't find erlexec.dll anymore, it was looking at prior path.

Perhaps making it relocatable is a first step towards this?

@garazdawi
Copy link
Contributor

There is a file called erl.ini located in %ERL_INSTALL_PATH%\bin that messes with the start of Erlang. If you remove it then Erlang should be relocatable.

We will create a PR that removes this file from the installer. From what we can tell it is no longer needed and just causes problems.

@wojtekmach
Copy link
Contributor Author

@garazdawi oh, perfect, I just removed erl.ini and it fixed the issue. Thanks!

I'll open up a new PR per your instructions.

@wojtekmach
Copy link
Contributor Author

I created a follow-up PR: #8787

@wojtekmach wojtekmach deleted the wm-win-zip branch September 15, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM waiting waiting for changes/input from author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants