TheCheatsrichter / Gw2_Launchbuddy

Custom launcher generator for the video game Guild Wars 2.
MIT License
201 stars 44 forks source link

1.8.5 triggers user account control when launching #112

Closed jacob-keller closed 1 year ago

jacob-keller commented 5 years ago

Not sure what changed, but the new version of LaunchBuddy now pops the User Account Control setting dialog whenever i start it. I imagine this is due to the way that it sets up local.dat now...

I'd rather not disable UAC entirely, but it's very annoying to have to accept it every time I start launch buddy.. Any ideas how to work around this?

Throne3d commented 5 years ago

This also impacts things like Discord's overlay and push-to-talk: because Guild Wars 2 is loaded in administrator mode, you now need to also launch Discord in administrator mode to be able to use them.

Is there something about the new changes that requires administrator mode for whatever reason?

jacob-keller commented 5 years ago

Add Gw2TacO to that list.

TheCheatsrichter commented 5 years ago

In order to bypass the local.dat filelock LB uses symlinks pointing to the local.dat which should be used for each account. Win Vista and onwoards sadly made symlink creation a admin only thing (SeCreateSymbolicLinkPrivilege), which got reverted in Win 10 (Windows 10 Insiders build 14972). So if you allready have newer version running you could run it without admin, however LB would miss out all Win7 and outdated Win 10 users.

jacob-keller commented 5 years ago

So if I have the most recent Win 10 build, 14972, will it automatically reduce to not needing administrator mode? That's fine with me, I can work around this until I I'm on that release. Otherwise, is there some way we could get a version which does that for new Windows 10?

TheCheatsrichter commented 5 years ago

This might be an option in the future. However I currently want to focus on a stable Local.dat management and therefore want to minimize error sources like admin rights.

However if you want to try it simply download the code delte the app.manifest file and compile it. Then Launchbuddy should no longer ask for elevation.

Presac commented 5 years ago

I compiled it and was able to start without administrator, but get the following error when trying to start any account, either one or multiple. image Running Windows 10 Version 1809 (OS Build 17763.379)

I checked a bit and found this blog post https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/ . Enabling Developer mode didn't change anything though.

I checked the Group Policy Editor, and it seems like only admin can do it. image

Any ideas where to go from here?

Presac commented 5 years ago

Got it to work. I tried following this guide to add a user account to the policy https://www.howtogeek.com/253745/how-to-allow-a-standard-windows-10-user-to-change-the-time-and-date/ Didn't work before I logged off and on again. Though I don't whether it was the developer mode or the policy edit that made it work after login off/on.

Lego6245 commented 5 years ago

Yes, from reading the documentation, Symlinks are still considered privileged, and the user's operating system must be set to developer mode for no UAC propmpt. You'd need to change...

if (!CreateSymbolicLink( EnviromentManager.GwLocaldatPath, sourcefile, 0x0))

to

if (!CreateSymbolicLink( EnviromentManager.GwLocaldatPath, sourcefile, 0x2))

in LocalDatManager.cs, delete the app manifest, and re-compile. According to the blogpost, that flag should be a no-op in all other cases other than developer mode enabled machines.

Lego6245 commented 5 years ago

Sorry, one additional change, you have to modify the SymbolicLink enum to include 0x2 as a valid value. The debug build I cut is working great with no elevated privileges, but having people enable developer mode is a non-starter.

jacob-keller commented 5 years ago

Changing the permissions and removing the app manifest file worked for me. I honestly do not mind asking people to enable developer mode, as long as they don't have to go through the weird local policy group editor thing.

I do think we should use SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE, since it's a no-op unless in developer mode anyways.

Lego6245 commented 5 years ago

At least it's a simple procedure, though it is a security risk to the average user. Are you able to JIT ask for elevated privileges? I know some applications are able to do that. Would be a nice compromise.

jacob-keller commented 5 years ago

Sure, that's what UAC does ... The problem is that many of us don't like having to click that box every single time we open the program.

On Wed, May 29, 2019, 5:07 PM William Saulnier notifications@github.com wrote:

At least it's a simple procedure, though it is a security risk to the average user. Are you able to JIT ask for elevated privileges? I know some applications are able to do that. Would be a nice compromise.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TheCheatsrichter/Gw2_Launchbuddy/issues/112?email_source=notifications&email_token=AAGVRX46AE3R73D3LCZWQ2DPX4LFNA5CNFSM4GTV35Q2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWQ7BOA#issuecomment-497152184, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGVRXYCKD3OERY2HBQQAZDPX4LFNANCNFSM4GTV35QQ .

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 200 days with no activity. Remove stale label or comment or this will be closed in 7 days