Fixing Tauri MSI installer restoring deleted desktop shortcuts on each update
In Tauri v2, the MSI installer recreated a desktop shortcut that the user had deleted, each time the app was updated through a new MSI or through tauri-plugin-updater. The NSIS installer does not do this, because it skips creating the shortcut in update mode. The fix in tauri-bundler was merged into the dev branch on 12 November.
The cause is that the shortcut component in the WiX 3 template has no condition, and a major upgrade first uninstalls the old version and then installs all components again. The fix adds a DESKTOPSHORTCUTEXISTS property, found by AppSearch, and a condition on the component: the shortcut is created on a new install, or during an update if the shortcut is still there. The property is marked Secure="yes", so it passes from the UI sequence to the elevated execute sequence.
Testing on Windows 11 with three builds of a minimal Tauri v2 app covered both silent and full-interface updates. The position of a remaining shortcut on the desktop still resets, because the old file is deleted and created again; a reviewer raised this and the pull request does not solve it. A unit test that only checked a string in the template was removed, because it did not test the installer's behavior.
Sources
-
JPZenn JA
Tauri の MSI インストーラーが更新のたびに削除済みデスクトップショートカットを復活させる問題を直した話
Terms
- MSI — The package format used by Windows Installer to install, update and remove software on Windows.
- NSIS — A tool for building Windows installers, used here as the alternative installer type for Tauri apps.
- WiX — A toolset that builds MSI packages from XML descriptions.
- AppSearch — A standard Windows Installer action that searches the computer for files or folders and stores the result in a property.


