dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

dx bundle fail on windows

Open pojoin opened this issue 1 year ago • 3 comments

ERROR Failed to bundle project: BundlerError

371.923s  INFO Copying app to output directory...
 375.582s ERROR Failed to bundle project: BundlerError(
    Error {
        context: "error running candle.exe",
        source: GenericError(
            "failed to run C:\\Users\\hcq\\AppData\\Local\\tauri\\WixTools314\\candle.exe",
        ),
    },
)
 375.594s ERROR err=BundleFailed(BundlerError(error running candle.exe

pojoin avatar Nov 18 '24 01:11 pojoin

The same error.

photino avatar Dec 11 '24 07:12 photino

I got it sort of working, after following workarounds:

  1. (seems like many have already done this) added icons/icon.ico

  2. I added to Dioxus.toml:

 [bundle]
publisher = "my example publisher"
identifier = "com.example.app"
  1. I renamed target/debug/<APPNAME>/bundle/windows/<APPNAME> to <APPNAME>.exe

  2. I manually ran WiX:

~\AppData\Local\tauri\WixTools314\light.exe -ext WixUIExtension -loc .\target/dx/<APPNAME>/bundle/windows\wix\x64\locale.wxl .\target\dx\<APPNAME>\bundle\windows\wix\x64\main.wixobj

This successfully generated a working installer, however, app lacked permission to create its WebView2 cache in the default installed location (C:\Program Files\<APPNAME>\). Installing, to a different location, under my user folder, worked fine.

dunkyl avatar Dec 12 '24 08:12 dunkyl

dx --version: dioxus 0.6.0 (ccf500c)

dunkyl avatar Dec 12 '24 08:12 dunkyl

The same error:

dx bundle --platform desktop

  17.829s  INFO Bundling app...
  17.852s  INFO Copying asset (0/3): C:\Users\liigo\tmp\hidx06\myhotdog\assets\header.svg
  17.852s  INFO Copying app to output directory...
  18.820s ERROR Failed to bundle project: BundlerError(
    Error {
        context: "error running candle.exe",
        source: GenericError(
            "failed to run C:\\Users\\liigo\\AppData\\Local\\tauri\\WixTools314\\candle.exe",
        ),
    },
)
  18.823s ERROR err=BundleFailed(BundlerError(error running candle.exe

Caused by:
    `failed to run C:\Users\liigo\AppData\Local\tauri\WixTools314\candle.exe`))

But tauri build works well (both tauri and dioxus use the same wix as i known):

cargo tauri build

    Running beforeBuildCommand `dx build --release`
   0. 1s  INFO Building project...
   ......
   5.461s  INFO Build completed successfully! 🚀 path="C:\\Users\\liigo\\tmp\\hi-tauri-dioxus\\target\\dx\\hi-tauri-dioxus-ui\\release\\web\\public"
   Compiling hi-tauri-dioxus v0.1.0 (C:\Users\liigo\tmp\hi-tauri-dioxus\src-tauri)
    Finished `release` profile [optimized] target(s) in 1m 12s
    Built application at: E:\tmp\RUST_DIR\CARGO_TARGET_DIR\release\hi-tauri-dioxus.exe
    Info Target: x64
    Running candle for "main.wxs"
    Running light to produce E:\tmp\RUST_DIR\CARGO_TARGET_DIR\release\bundle\msi\hi-tauri-dioxus_0.1.0_x64_en-US.msi
    Finished 1 bundle at:
        E:\tmp\RUST_DIR\CARGO_TARGET_DIR\release\bundle\msi\hi-tauri-dioxus_0.1.0_x64_en-US.msi

liigo avatar Dec 31 '24 01:12 liigo

still having this same error on 0.6.2

oletf avatar Feb 04 '25 16:02 oletf

during my exploration on #3688, I realized that the shortcut created by nsis (and probably msi as well) don't work anymore after #3482, since the shortcut created by the nsis bundler takes krate.bundled_app_name(), to which it adds .exe.

the resulting link targets appname.exe.exe

oletf avatar Feb 05 '25 12:02 oletf

alright ! I found the culprit for the shortcut problem, it was on the executable name here, #3482 helped a lot!

The shortcut, the uninstaller not deleting the executable, as well as WiX still not working on my first reply here, all now work on my side !

1 line PR incoming

oletf avatar Feb 05 '25 14:02 oletf