cargo-bundle icon indicating copy to clipboard operation
cargo-bundle copied to clipboard

[Windows] Error msi bundle

Open mrdev023 opened this issue 5 years ago • 19 comments

I get this error

error: Failed to collect resource file information
  Caused by: Le fichier spécifié est introuvable. (os error 2)

mrdev023 avatar Jul 17 '19 18:07 mrdev023

jojobyte/cargo-bundle@ca33209

First time working working with Rust, there is no way this is the right solution for cross platform.

The error appears to be because its trying to bundle C:/whatever/your/path/hello instead of C:/whatever/your/path/hello.exe, fixing it inside the collect_resource_info function just gets it to fail later on inside the generate_resource_cabinets function.

Fixing it in settings solves both problems but then generates a MSI file that won't run/install, but someone else might need to figure out that part.

Think it needs some MSI tables/registry or something but its beyond my current understanding.

jojobyte avatar Jul 25 '19 07:07 jojobyte

As a workaround, you may try using cargo-wix instead.

slonopotamus avatar Sep 05 '19 11:09 slonopotamus

I just found this project but I could not get the provided example to work on windows either due to this same error. Is there any plans fix this in the near future? Thanks!

lobis avatar Aug 11 '22 18:08 lobis

Windows support in cargo-bundle is only half-implemented and doesn't work yet. It is waiting for a contributor who knows more about MSI packaging than I do and who has a Windows machine to test on. If that's you, PRs would be very welcome!

mdsteele avatar Aug 13 '22 14:08 mdsteele

I've managed to get the msi support working. It needs a small patch to rust-msi as well as changes to this crate to set the Word Count property to a suitable value. I'm really busy these days so will send the cleaned-up patches in a few days. Relevantly, I'd like to know if I should send changes in the same PR that implement a working UI for the msi or just those to make it work.

Note: I tested it on Wine's msiexec implementation.

aerkiaga avatar May 26 '23 13:05 aerkiaga

hi @aerkiaga

THat's really great! I would say a minimal UI as well. You might want to read #116 as there has been a long discussion there as well about MSI support

JessicaTegner avatar May 26 '23 19:05 JessicaTegner

@aerkiaga This is great news, thanks! A working UI would definitely be good to have, although if it makes sense to split it across multiple smaller PRs, that may be a little easier to review. Up to you.

mdsteele avatar May 26 '23 20:05 mdsteele

How is this coming along? I'm new to Windows MSI files and bundlers, but if there isn't much left to be done, I would be willing to take a stab.

landonwork avatar Jul 03 '23 02:07 landonwork

@landonwork I got basic msi working with https://github.com/burtonageo/cargo-bundle/pull/142, which has been merged. It lacks some features though. I've drawn a banner for the installer UI here if you need it.

Edit: handling menus, file associations etc. is still left to do. Thanks a lot if you're willing to help!

aerkiaga avatar Jul 03 '23 14:07 aerkiaga

Any way to fix it? I get the same error now

ihsan6133 avatar Jul 18 '23 08:07 ihsan6133

I get the same error. Is it solved yet??

Plycedes avatar Jan 18 '24 13:01 Plycedes

To clarify, are you having issues with cargo-bundle as built at HEAD, or using the version published on crates.io?

mdsteele avatar Jan 20 '24 19:01 mdsteele

To clarify, are you having issues with cargo-bundle as built at HEAD, or using the version published on crates.io?

I cloned from commit fd94ab531b4d7b0c9a8f029dd649156f0e733157, (latest master branch as of Jan 29, 24) and installed directly. I still get the error with running cargo bundle --target x86_64-pc-windows-msvc. I am only using the required configs - I'm on windows 11

Alexangelj avatar Jan 29 '24 16:01 Alexangelj

Same problem here, with cargo-bundle 0.6.0

jakobhansson avatar Feb 20 '24 19:02 jakobhansson

@ihsan6133 @Plycedes @Alexangelj @jakobhansson are you passing --format msi? Like this:

cargo bundle --target x86_64-pc-windows-gnu --format msi

aerkiaga avatar Feb 20 '24 19:02 aerkiaga

cargo bundle --target x86_64-pc-windows-msvc --format msi gives the same error. I do not have the x86_64-pc-windows-gnu toolchain, is this a requirement?

jakobhansson avatar Feb 20 '24 19:02 jakobhansson

@jakobhansson I see the fix has not yet made it into a new release. I suggest that you build from source (cargo install --path . from cargo-bundle master branch).

aerkiaga avatar Feb 20 '24 20:02 aerkiaga

I see, I compiled from source and now the cargo bundle --format msi command completes successfully, but the generated .msi file throws error upon running "This installation packaeg could not be opened..."

jakobhansson avatar Feb 20 '24 20:02 jakobhansson

Same issues here...

The crates.io version fails to bundle with a "Failed to collect resource file information" error when running cargo bundle --format msi.

Building from source (cloning and running cargo install --path .) succeeds with the bundle command and produces a .msi file but Windows Installer throws "This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package" when I try to open it.

AardhynLavender avatar Mar 12 '24 04:03 AardhynLavender