[bug] Can't add vc_redist_x64 to wix
Describe the bug
My application requires vc_redist_x64 to run app and I'm trying to add it to WIX.
Error failed to bundle project: error running candle.exe: error running candle.exe: failed to run C:\Users\usernamedir\AppData\Local\tauri/WixTools\candle.exe
Reproduction
Create src-tauri\install_vc_redist_64.wxs
<Fragment>
<util:RegistrySearch Root="HKLM"
Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\X64"
Variable="CPP14RedistBld"
Value="Bld"
Result="value"
Win64="yes"/>
<WixVariable Id="CPP14DetectCondition" Overridable="yes" Value="CPP14RedistBld >= 30040" />
<PackageGroup Id="redist_vc15to19">
<ExePackage Id="vc14" Cache="no" PerMachine="yes" Vital="yes" Compressed="no" Permanent="yes"
Name="vc_redist.x64.exe"
DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/888b4c07-c602-499a-9efb-411188496ce7/F3A86393234099BEDD558FD35AB538A6E4D9D4F99AD5ADFA13F603D4FF8A42DC/VC_redist.x86.exe"
InstallCommand="/quiet /norestart"
DetectCondition="!(wix.CPP14DetectCondition)">
<RemotePayload
Size="25169400"
Version="14.29.30040.0"
ProductName="Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.28.29914"
Description="Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.28.29914"
Hash="9ADE54D322BE27BFF05D5AFEC8ED44F9B2D9306E" />
<ExitCode Value="1638" Behavior="success"/> <!-- Don't fail if newer version is installed -->
</ExePackage>
</PackageGroup>
</Fragment>
Update tauri.config.json
"wix": {
"fragmentPaths": ["install_vc_redist_64.wxs"]
}
yarn tauri build
Expected behavior
Build successful
Platform and versions
MSVC: - Visual Studio Build Tools 2022 › Node.js: 16.14.0 › npm: 8.3.1 › pnpm: Not installed! › yarn: 1.14.0 › rustup: 1.25.1 › rustc: 1.63.0 › cargo: 1.63.0 › Rust toolchain: stable-x86_64-pc-windows-msvc Packages › @tauri-apps/cli [NPM]: 1.1.1 › @tauri-apps/api [NPM]: 1.1.0 › tauri [RUST]: 1.1.1, › wry [RUST]: 0.21.1,
App › build-type: bundle › CSP: unset › distDir: ../dist › devPath: http://localhost:3000/ › framework: Vue.js (Nuxt) › bundler: Webpack
App directory structure ├─ .git ├─ .nuxt ├─ .output ├─ .vscode ├─ dev ├─ dist ├─ icons ├─ node_modules ├─ src └─ src-tauri
Stack trace
Compiling lite-server v0.1.0 (D:\projects\nuxt-tauri\src-tauri)
Finished release [optimized] target(s) in 2m 15s
Info Target: x64
Downloading https://go.microsoft.com/fwlink/p/?LinkId=2124703
Running candle for "main.wxs"
Running candle for "D:\\projects\\nuxt-tauri\\src-tauri\\install_vc_redist_64.wxs"
Error failed to bundle project: error running candle.exe: error running candle.exe: `failed to run C:\Users\usernamedir\AppData\Local\tauri/WixTools\candle.exe`
error Command failed with exit code 1.
Additional context
No response
@canhkieu can you try running yarn tauri build --verbose so we can get a better log?
Running [tauri_bundler::bundle::windows::msi::wix] candle for "main.wxs"
Running [tauri_bundler::bundle::common] Command `C:\Users\Tnze\AppData\Local\tauri/WixTools\candle.exe -arch x64 main.wxs -dSourceDir=C:\Projects\tauri\ffxiv-crafting-assistant\src-tauri\target\release\BestCraft.exe`
Windows Installer XML Toolset Compiler version 3.11.2.4516
Copyright (c) .NET Foundation and contributors. All rights reserved.
main.wxs
C:\Projects\tauri\ffxiv-crafting-assistant\src-tauri\target\release\wix\x64\main.wxs(101) : error CNDL0107 : Schema validation failed with the following error at line 1, column 6789: Ԫ�� �����ռ䡰http://schemas.microsoft.com/wix/2006/wi���еġ�DirectoryRef���� ���ܰ����ı���ӦΪ����Ԫ�ص��б�: 'Component Directory Merge ##other:*'��
Error [tauri_cli] failed to bundle project: error running candle.exe
> cargo tauri info
[✔] Environment
- OS: Windows 10.0.22621 X64
✔ WebView2: 112.0.1722.68
✔ MSVC: Visual Studio Community 2022
✔ rustc: 1.71.0-nightly (7908a1d65 2023-04-17)
✔ Cargo: 1.71.0-nightly (d0a4cbcee 2023-04-16)
✔ rustup: 1.25.2 (17db695f1 2023-02-01)
✔ Rust toolchain: nightly-x86_64-pc-windows-msvc (environment override by RUSTUP_TOOLCHAIN)
- node: 18.16.0
- yarn: 1.22.19
- npm: 8.3.0
[-] Packages
- tauri [RUST]: 1.3.0
- tauri-build [RUST]: 1.3.0
- wry [RUST]: 0.24.3
- tao [RUST]: 0.16.1
- @tauri-apps/api [NPM]: 1.3.0
- @tauri-apps/cli [NPM]: 1.3.0
[-] App
- build-type: bundle
- CSP: unset
- distDir: ../dist
- devPath: http://localhost:5173/
- framework: React (Next.js)
- bundler: Vite
@Tnze Could you try using tauri's cli from git?
cargo install tauri-cli --debug --git https://github.com/tauri-apps/tauri
cargo tauri build --verbose
@Tnze Could you try using tauri's cli from git?
cargo install tauri-cli --debug --git https://github.com/tauri-apps/tauri cargo tauri build --verbose
Sure, I tried and it succeeded. Do I still need to paste the log here?
Nope, if it worked then it's all good and likely unrelated to OP's issue. Thanks though :)