tauri
tauri copied to clipboard
[bug] Custom actions aren't bundled from Wix fragments
Describe the bug
I have a <CustomAction />
and <InstallExecuteSequence />
in my wxs fragment but it doesn't run and isn't included in the msi file which I have confirmed with Orca. The wxs fragment is definitely being read because light
is catching errors in it.
Perhaps I'm misunderstanding how Fragments are supposed to work but I thought I could just include this CustomAction and it would be similar to including at the end of main.wxs. For now I have just copy and pasted main.wxs from tauri-bundler into my project with the CustomAction appended and set that as the template in tauri.conf.json and it works fine.
Reproduction
Make a .wxs fragment with a CustomAction and add it to fragmentPaths in tauri.conf.json.
An example I've been testing is an action that just launches notepad.
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<CustomAction Id="OpenNotepad" Directory="INSTALLDIR" Execute="immediate" ExeCommand="cmd.exe /c notepad.exe" Return="check" />
<InstallExecuteSequence>
<Custom Action="OpenNotepad" After="InstallInitialize" />
</InstallExecuteSequence>
</Fragment>
</Wix>
Expected behavior
The CustomAction runs with the specified installation sequence.
Platform and versions
Environment › OS: Windows 10.0.22000 X64 › Webview2: 108.0.1462.54 › MSVC: › Node.js: 16.14.2 › npm: 8.5.5 › pnpm: 7.2.1 › yarn: 1.22.19 › rustup: 1.25.1 › rustc: 1.65.0 › cargo: 1.65.0 › Rust toolchain: stable-x86_64-pc-windows-msvc
Packages WARNING: no lock files found, defaulting to npm › @tauri-apps/cli [NPM]: 1.2.1 (outdated, latest: 1.2.2) › @tauri-apps/api [NPM]: Not installed! › tauri [RUST]: 1.2.1, › tauri-build [RUST]: 1.2.1, › tao [RUST]: 0.15.6, › wry [RUST]: 0.22.5,
App › build-type: bundle › CSP: unset › distDir: [] › devPath: []
App directory structure ├─ .changes ├─ .devcontainer ├─ .docker ├─ .git ├─ .github ├─ .husky ├─ .scripts ├─ .vscode ├─ audits ├─ core ├─ examples ├─ target └─ tooling
Stack trace
No response
Additional context
No response
It turns out I missed something, you need a <CustomActionRef Id=".." />
to activate the Custom Action. I guess this is now more like a feature request for a customActionRefs
section for the wix config.
@amrbashir Have done anything with this feature? I am also facing this problem, how to add custom action to wix bundler.
I'm with tauri beta
In Tauri it's possible to use a specific WIX template ( tauri.bundle.windows.wix.template ). You could specify a new one starting from the default ( https://github.com/tauri-apps/tauri/blob/1.x/tooling/bundler/src/bundle/windows/templates/main.wxs ) and change it adding the customAction.
https://tauri.app/v1/guides/building/windows/#replacing-the-installer-code-with-a-custom-wix-file