Skip to content

Fix NSIS packaging crash with ubcp #4

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mirage335
Copy link
Member

Summary

  • avoid NSIS segfault by packaging ubcp as an archive
  • unpack ubcp at install time using 7zip
  • fetch standalone 7zip binary during build

Testing

  • ./compile.sh (fails: _generate_lean-python: command not found)

https://chatgpt.com/codex/tasks/task_e_687b62bf77c8832c85eae0f3959bc915

@Copilot Copilot AI review requested due to automatic review settings July 19, 2025 09:41
Copy link

@Copilot 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 fixes an NSIS packaging crash related to ubcp by changing the packaging approach from direct file installation to archive-based installation. The solution involves packaging ubcp as a 7z archive, fetching the 7zip standalone binary during build time, and unpacking the archive during installation.

  • Downloads standalone 7zip binary (7zr.exe) during build process if not already present
  • Modifies NSIS installer to copy the 7z archive and 7zip binary instead of extracting ubcp files directly
  • Adds installation-time extraction of ubcp using 7zip and cleanup of the temporary archive

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
_prog/build-special.sh Adds logic to download standalone 7zip binary (7zr.exe) for archive extraction
_lib/nsis/ubDistBuild.nsi Changes ubcp installation from direct file copy to archive-based extraction using 7zip

if [[ ! -e "$currentAccessoriesDir"/integrations/7zip/7zr.exe ]]
then
wget -O "$currentAccessoriesDir"/integrations/7zip/7zr.exe \
'https://www.7-zip.org/a/7zr.exe'
Copy link
Preview

Copilot AI Jul 19, 2025

Choose a reason for hiding this comment

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

The wget command lacks error handling. If the download fails, the script will continue and the subsequent NSIS installation will fail. Consider adding error checking after the wget command.

Suggested change
'https://www.7-zip.org/a/7zr.exe'
'https://www.7-zip.org/a/7zr.exe' || { echo "Error: Failed to download 7zr.exe"; exit 1; }

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant