Skip to content

Compress ubcp folder into zip during installer build #3

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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions _lib/nsis/ubDistBuild.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ Section "Install"
SetOutPath "C:\core\infrastructure\ubDistBuild"
File /r "..\..\..\ubDistBuild-accessories\parts\ubDistBuild\*"

SetOutPath "C:\core\infrastructure\ubDistBuild\_local\ubcp"
File /r "..\..\..\ubDistBuild-accessories\parts\ubcp\package_ubcp-core\ubcp\*"
SetOutPath "C:\core\infrastructure\ubDistBuild\_local"
File "..\..\..\ubDistBuild-accessories\parts\ubcp\package_ubcp-core\ubcp.zip"
nsisunz::UnzipToLog "$INSTDIR\_local\ubcp.zip" "$INSTDIR\_local"
Delete "$INSTDIR\_local\ubcp.zip"

;ATTENTION
Rename "C:\core\infrastructure\ubDistBuild-backup-uninstalled\_local\vm.img" "C:\core\infrastructure\ubDistBuild\_local\vm.img"
Expand Down
6 changes: 5 additions & 1 deletion _prog/build-special.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ _build_ubDistBuild-build() {

#! type makensis && _if_cygwin && _at_userMSW_probeCmd_discoverResource-cygwinNative-ProgramFiles 'makensis' 'NSIS/bin' false
_getMinimal-build_ubDistBuild


(
cd "$currentAccessoriesDir"/parts/ubcp/package_ubcp-core
7za a -tzip -mx=9 ubcp.zip ubcp
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 7za command should include error handling. If compression fails, the build should fail rather than continue with a potentially corrupted or missing archive.

Suggested change
7za a -tzip -mx=9 ubcp.zip ubcp
if ! 7za a -tzip -mx=9 ubcp.zip ubcp; then
echo "Error: Failed to create archive with 7za. Exiting build process." >&2
exit 1
fi

Copilot uses AI. Check for mistakes.

)

unix2dos "$scriptAbsoluteFolder"/license-installer.txt

Expand Down