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

Best way to "package" the binaries to let users run it without installing Rust on their machine? #240

Open
belluzj opened this issue Apr 8, 2021 · 2 comments

Comments

@belluzj
Copy link
Contributor

belluzj commented Apr 8, 2021

I'm going to show the UI to a few people at Dalton Maag, and the way we've managed to distribute the binary on Windows is:

  • package together the .exe, the resources and druid-theme-loader folders
  • make an MSI that upon installation creates a shortcut to the .exe, specifying that the current working directory must be set to the folder that contains resources and druid-theme-loader (otherwise the .exe crashes because it can't access them).

With that setup, it's possible to drag-and-drop a UFO onto the shortcut, and it opens in Runebender.

Are there any other things to consider that we didn't see here? Is there interest to automate that MSI thing on the repository here? Or is there maybe a better way using Rust-specific tools or conventions?

@alerque
Copy link

alerque commented Apr 8, 2021

Shipping packages for apps using Rust is an underdeveloped part of the ecosystem. For some reason the developers got it in their head that all apps compile to a single binary and left it at that: cargo works great for collecting libraries and compiling the source, but it is terrible as an packager. They also didn't make it easy to place inside of a packaging system, although it can be done.

I'm not familiar with Windows packaging, but what you did sounds very close to what I did to setup Runebender packaging on Arch Linux: runebender-git. During the build() phase I exported a variable that says where the theme files are going to end up (being a distro specific package recipe and not a general purpose installer, I know where that is going to be). Then in the package() phase I placed the binary in the system PATH and the theme files in the shared resources folder I'd tipped the builder off about previously.

For my own Rust projects I typically wrap them in an GNU Autotools based build system. This is more useful for POSIX systems than Windows, but it does make it easy to both build the binary and packages supporting files with an install system that detects proper locations for things, bundles man pages, and so forth. For example this is how fontship is packaged.

I think having an automated CI job that built an MSI installer for Runebender would be great. For now just attaching it as an artifact to the CI runner would be fine, later when releases get tagged they could be attached to the releases.

If interested I could do the same for the *nix end of things so that a more standard ./configure; make; make install from a source package gets the job done.

@cmyr
Copy link
Member

cmyr commented Apr 16, 2021

This is definitely a current headache, and one of the things I hope to improve 'soon'. In the more immediate term, when this gets closer to ready for initial preview I will hack together something to distribute simple executables.

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

No branches or pull requests

3 participants