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

dx bundle fail on windows #3233

Closed
pojoin opened this issue Nov 18, 2024 · 7 comments · Fixed by #3482
Closed

dx bundle fail on windows #3233

pojoin opened this issue Nov 18, 2024 · 7 comments · Fixed by #3482

Comments

@pojoin
Copy link

pojoin commented Nov 18, 2024

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
@photino
Copy link
Contributor

photino commented Dec 11, 2024

The same error.

@dunkyl
Copy link

dunkyl commented Dec 12, 2024

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
Copy link

dunkyl commented Dec 12, 2024

dx --version: dioxus 0.6.0 (ccf500c)

@liigo
Copy link
Contributor

liigo commented Dec 31, 2024

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

@oletf
Copy link
Contributor

oletf commented Feb 4, 2025

still having this same error on 0.6.2

@oletf
Copy link
Contributor

oletf commented Feb 5, 2025

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
Copy link
Contributor

oletf commented Feb 5, 2025

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

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

Successfully merging a pull request may close this issue.

5 participants