tauri icon indicating copy to clipboard operation
tauri copied to clipboard

perUser InstallScope

Open richardmward opened this issue 2 years ago • 16 comments

Is your feature request related to a problem? Please describe. I am unsure if there are technical reasons for this not being possible, but wish to raise it to see if it is a possibility.

Describe the solution you'd like Could the windows installer support the perUser InstallScope (and I think maybe it'd need the limited InstallPrivileges) wix settings so that a Tauri app would not require admin privileges to install?

Describe alternatives you've considered I appreciate WebView2 will have it's own limitations, but if that were already installed, could the app itself be less restricted in installation options?

Additional context N/A

richardmward avatar Jul 29 '21 12:07 richardmward

To quote @FabianLars "The webview installer doesn't need admin anymore", so that hindrance is out of the way.

Yuca965 seems to have had some degree of success getting it running though it required replacing the entire template. Conversation in link.

Seemingly <Property Id="ALLUSERS" Value="2"/> <Property Id="MSIINSTALLPERUSER" Value="1"/> was most effective.

philipborg avatar Mar 31 '22 10:03 philipborg

This feels like a fairly common use case and would be nice to have as an option in the tauri-conf.

It would simplify the installation phase if the user only needed to run the installer in a invisible mode and be done with it. No dialogs or prompts.

ottosson avatar Jun 28 '22 11:06 ottosson

Fairly new to Tauri; I just happened to stumble upon this thread looking for the same issue and I saw a solution was committed fairly recently. Will this be in the next Tauri release or should I try my hand at modifying my own installation to get this functionality sooner?

drwhorx avatar Jul 05 '22 13:07 drwhorx

We did open a PR for it but it's not complete yet, there's some issues to fix. If your app does not use resources or sidecars, I think it might be easy to get that PR changes and throw it in a custom template. We're also working on NSIS.

lucasfernog avatar Jul 05 '22 13:07 lucasfernog

I did just try my hand at a custom template that implemented those changes and assumes per_machine is false, but alas I'm getting bundle errors, presumably from the aforementioned issues to fix. I'll go ahead and wait for your update, since my use case isn't urgent, but if I get my custom template working I'll go ahead and upload it here for anybody else who's curious.

drwhorx avatar Jul 05 '22 13:07 drwhorx

Keep in mind I have no idea what I'm doing and my use case is very basic, so mileage may vary, but the bundle issue was with respect to Line 94 of main.wxs. It didn't like that the GUID was not explicitly defined, so I generated a random GUID and threw it in there and it worked. Someone smarter than I can explain why that works but I just bundled my project and installed it without Admin and it worked.

I'm uploading my main.wxs here; keep in mind my version assumes per_machine is false, install_scope is per_user, and registry_root is HKCU, since all I was after was making a template, not messing with your bundler. This is a very dumb fix since I don't know what I'm doing.

main.wxs

drwhorx avatar Jul 05 '22 14:07 drwhorx

It'll probably take some time for it to land in Tauri itself since we'll need to audit it. Good that it's working for you already though :)

lucasfernog avatar Jul 05 '22 14:07 lucasfernog

@drwhorx Your file does not work with a non-admin user.

Uzaaft avatar Jul 05 '22 19:07 Uzaaft

@lucasfernog Do you have the link to the PR?

Uzaaft avatar Jul 11 '22 11:07 Uzaaft

@Uzaaft https://github.com/tauri-apps/tauri/pull/4509

FabianLars avatar Jul 11 '22 11:07 FabianLars

Thanks. Seems like that PR is closed, so I assume that you guys aren't working with it ATM?

Uzaaft avatar Jul 11 '22 11:07 Uzaaft

I got things working without an admin install using a .wxs template with minimal changes from the default one. If it makes sense for the devs, perhaps I could go ahead and add a new example, in the example folder, with a custom template that can guide people in the future?

Uzaaft avatar Jul 11 '22 13:07 Uzaaft

Seems like that PR is closed, so I assume that you guys aren't working with it ATM?

afaik we aren't. If i got that right we'll probably implement this feature only with NSIS.

If it makes sense for the devs, perhaps I could go ahead and add a new example, in the example folder, with a custom template that can guide people in the future?

Can you post it first here? i'm not sure if we should add an example just for this. Maybe we can integrate it into the docs instead for now (either as an example or in the FAQ section with a link to this issue or something), or add it to an existing example 🤔

FabianLars avatar Jul 11 '22 16:07 FabianLars

Yeah sure thing. Here is a gist of it.

Uzaaft avatar Jul 11 '22 17:07 Uzaaft

A workaround for us was to edit the created .msi file with Windows Orca and change/add the following values:

Property -> ALLUSERS = 2
Property -> MSIINSTALLPERUSER = 1

The first test was successful, but more must follow.

schachzug avatar Jul 13 '22 07:07 schachzug

My app can't work in C:\Programe files. I tried above solutions but it's doesn't work.

kieuminhcanh avatar Sep 30 '22 23:09 kieuminhcanh