Closed enchained closed 1 year ago
This is a bug in framework I'm using, see https://github.com/tauri-apps/tauri/issues/7295
Workaround for now is to manually run the installer with administrator privileges if you want to install it into protected folder like program files.
I'll put this info in release notes if there is no quick resolution.
There is no practical difference between .msi and .exe installers. NSIS (exe) installer support is fairly new so it may have some bugs like above but it is generally preferred over old .msi installers.
I also wonder, what is the proper way to update - with uninstall, or just rewrite is fine, since the installed app is packed into a single exe?
Rewrite is fine and probably a bit faster.
Looks like the behavior of the installer is intentional. I have an option to force privilege elevation in the installer but then it will be always required regardless if you install in a protected folder or user writable folder.
I think keeping it as is is best, I will add info about running with admin rights manually if needed.
I have an option to force privilege elevation in the installer but then it will be always required regardless
Yep, this solution is not the best, and looks like there's no on-demand option for it. Other options could be "show a note/text notification in the installer on condition", but not sure how viable it is. The release note probably will do.
Workaround for now is to manually run the installer with administrator privileges
Rewrite is fine and probably a bit faster.
It looks like manually launching installer elevated does not make the subsequent uninstaller auto-launch elevated (which is why it took me a bit to figure out it was a permission issue). Could you possibly default the selection to "Do not uninstall" option instead of "Uninstall before installing", if either is fine for updating?
I will see if uninstall option for update can be removed completely, it's not needed and is confusing.
When using the exe installer without the administrator rights, if the app was already installed to a protected folder like Program files:
If you choose the default option "Uninstall before installing", after uninstall it gives an error "Unable to uninstall" unless you manually launch uninstall from administrator beforehand instead (launching the installer itself from administrator did not help with this one). Not sure how best to solve it, maybe detect existing install folder permission and prompt to launch uninstaller with administrator rights?
If you choose "Do not uninstall", it gives the "Error opening file for writing" error. Similar solution with offering to relaunch the installer itself with administrator rights may be possible when a protected folder is detected.
Currently, looks like the only working way to update the app in the protected folder is:
This is not a critical issue and probably can be completely avoided by installing to AppData, but still worth mentioning at least.
I also wonder, what is the proper way to update - with uninstall, or just rewrite is fine, since the installed app is packed into a single exe?
If the solution is a hassle to implement, release notes could mention this moment (or a wiki with errors one can encounter), cause it might be confusing to some users with the current installer implementation. Also it might be worth mentioning the exe vs msi installer difference in the release notes.