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

[feat] add afterBuildCommand to execute command(s) before creating installer/package/bundle #4879

Closed
FibreFoX opened this issue Aug 7, 2022 · 2 comments
Labels
status: backlog Issue is ready and we can work on it type: feature request

Comments

@FibreFoX
Copy link

FibreFoX commented Aug 7, 2022

Describe the problem

The generated executable is quite large (I know about the Reducing App Size chapter), which results in a lot of disk space "wasted".

Out of the box on Windows the generated EXE-file results in nearly 7 MB. But when runtime-compressing the file with someting like https://github.com/upx/upx the generated EXE-file comes down to 2.2 MB (or 2 MB when running upx with -9 parameter), without some lost functionality (at least what I can tell of).

In addition to compressing the generated files with external tools, this even would open the ability to do other wonderful things with the generated executable (e.g. generating hashsum-files, executing system-tests or other special build-pipeline-like stuff).

Describe the solution you'd like

I would like to be able via the tauri.conf.json file to execute some single command or multiple commands after cargo did build the executable.

Alternatives considered

Re-executing only the "creating installer/package/bundle" part via Tauri-CLI command after manually executing UPX. Would be better to have this part of tauri, as it reduces manual steps.

Maybe some additional afterBundleCommand would be helpful which targets the phase after the installer/package/bundle was created. This could be used for auto-uploading the result to some server via custom-tailored scripts.

Additional context

Maybe I am totally missing some built-in cargo-magic, as I am new to the Rust ecosystem. Previous I used to built some application using React and Electron, so this is quite a fascinating way to get into Rust.

@nothingismagick
Copy link
Sponsor Member

Yes, we have been talking about making a tauri.conf flag that will attempt to run UPX, but there are caveats (doesn't seem to work ok M-series macs, possible virus flag on windows...)

@FibreFoX
Copy link
Author

FibreFoX commented Aug 7, 2022

@nothingismagick interesting, did not find anything in the issue-tracker here on Github (or I just was simply blind, as usual).

UPX is only one use-case ;) please do not focus on that. I might want to run a custom yarn special-task command which combines several tasks. This is mere just an idea to have the ability to run tasks "in between" the steps. Like having to distribute the binary to several VMs that are configured differently before "finally" packaging the executable file in the installer.

@amrbashir amrbashir added the status: backlog Issue is ready and we can work on it label Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: backlog Issue is ready and we can work on it type: feature request
Projects
None yet
Development

No branches or pull requests

3 participants