# Cross-platform bundling

**URL:** <https://internals.rust-lang.org/t/cross-platform-bundling/16773>\
**Category:** tools and infrastructure\
**Created:** [June 8, 2022, 7:52pm UTC](https://internals.rust-lang.org/t/cross-platform-bundling/16773 "2022-06-08T19:52:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Nagle](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/john_nagle/32/9464_2.png) [@John\_Nagle](https://internals.rust-lang.org/u/John_Nagle)\
**Post date:** [June 8, 2022, 7:52pm UTC](https://internals.rust-lang.org/t/cross-platform-bundling/16773/1 "2022-06-08T19:52:07Z")

</div>

It's impressive that Rust can build a working Microsoft Windows executable under Linux. Even at the game level, with full 3D capabilities. Here's an [example of mine](https://github.com/John-Nagle/ui-mock) to show it all working. That's using the Rend3/Egui-\>WGPU graphics systems, and they're now all portable enough that cross-compiling works. That's a remarkable achievement. Game devs need this.

But once you have a **.exe** file, you need to build an installer, a **.msi** or **.msix** file, to ship. This is not, unfortunately, a standard **cargo** function. I'd like to see that added.

All the parts exist, but they don't connect and don't work cross-platform. Here's what's available to build upon.

- [cargo-bundle](https://github.com/age-rs/cargo-bundle) Now, this does exactly the right thing. It's integrated with the Rust ecosystem. It gets the data it needs from the **Cargo.toml** file. It's installed with `cargo install cargo-bundle.` The only problem is that it doesn't work for Windows targets. The Windows target part is unimplemented. Only Mac targets are implemented. So, what I'm asking for is that this be completed and made a part of the Rust tooling.
- [WiX](https://wixtoolset.org/) This toolset has, internally, the code to create **.msi** files. It only runs on Windows, and has many of non-Rust dependencies. But that's a source of open-source code for making **.msi** files. Internally, Wix had two Windows executables, **candle.exe** and **flame.exe** , which did all the work. They took in XML and other files and emitted .msi files. So that's where to look for code to do this.
- [Tauri](https://tauri.studio) This is a full toolset, an alternative to **cargo**. It's mostly intended for web apps. It used to have a standalone executable called **tauri-bundler** , which was a based on **cargo-bundle.** That could successfully make .msi files. But inside, it was calling **candle.exe** and **flame.exe**. The Tauri developers made the bundler into a library, which is useful if you want to integrate it into something else. But you still need to be able to run **candle.exe** and **flame.exe** , which are Windows-only.

So, is there interest in this? All the necessary parts seem to exist. This needs someone who lives in Windows land, and understands Windows installers, which I do not.

It seems a lack that the Rust system can cross-compile all the way to a Windows executable, but not do the last step needed to make a usable application.

---

<div class="post-metadata">

**Author:** ![CAD97](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/cad97/32/3460_2.png) [@CAD97](https://internals.rust-lang.org/u/CAD97)\
**Post date:** [June 8, 2022, 8:11pm UTC](https://internals.rust-lang.org/t/cross-platform-bundling/16773/2 "2022-06-08T20:11:08Z")

</div>

> [@John\_Nagle](#):
>
> But once you have a **.exe** file, you need to build an installer, a **.msi** or **.msix** file, to ship.

This is not necessarily the case: a decent amount of software offers "portable" installations which are just an exe or a folder that you place wherever on your PC. If all you have is a single exe and you don't need support files, then you can be done here with a probable executable!

That said, yes, the general expectation of Windows consumers is to download an installer — a single _something_ file that they can double click to visually walk through installing software to a standard or custom location. (It's worth noting that it actually being in msi/msix format isn't important; much software ships an installer exe. It's just "an executable" to anyone who doesn't care about the benefits of an msi installer over adhoc executables.)

Additionally, if shipping via a platform distribution like Steam, you _don't_ want an installer file; instead you tell steamcmd that it should copy these files into this relative location in an install, and assign the files to a depot.

---

<div class="post-metadata">

**Author:** ![John\_Nagle](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/john_nagle/32/9464_2.png) [@John\_Nagle](https://internals.rust-lang.org/u/John_Nagle)\
**Post date:** [June 8, 2022, 8:11pm UTC](https://internals.rust-lang.org/t/cross-platform-bundling/16773/3 "2022-06-08T20:11:28Z")

</div>

More assets: there's a [rust-msi](https://github.com/mdsteele/rust-msi/) crate for reading and writing .msi files entirely from Rust. The author wrote, back in 2018, that this was intended to help make **cargo-bundle** work for Windows targets. But that was never done.

---

<div class="post-metadata">

**Author:** ![John\_Nagle](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/john_nagle/32/9464_2.png) [@John\_Nagle](https://internals.rust-lang.org/u/John_Nagle)\
**Post date:** [June 8, 2022, 8:27pm UTC](https://internals.rust-lang.org/t/cross-platform-bundling/16773/4 "2022-06-08T20:27:29Z")

</div>

![Windows warning](https://websiteforstudents.com/wp-content/uploads/2021/08/windows-11-turning-on-developer-mode.webp)

**Microsoft "discourages" that.**

The jaws are closing on raw .exe files. Microsoft wants an installer. And code signing. And Microsoft Play Store approval. That's mandatory for locked-down Windows 10 S systems, or enterprise systems.

So, Rust needs signable bundling if Rust is to be used by non-developers.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [September 6, 2022, 8:27pm UTC](https://internals.rust-lang.org/t/cross-platform-bundling/16773/5 "2022-09-06T20:27:45Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
