GoomiiV2 / Meldii

Melder V2
MIT License
11 stars 7 forks source link

Addon library location redirect #28

Closed theunkn0wn1 closed 8 years ago

theunkn0wn1 commented 8 years ago

I have a User setup as described below: I have a root admin account x I am logged in as a standard user y

I run Meldii as user y and grant it via UAC the admin privileges from x as requested. When using the UI button on Meldii's main interface to open the library location the program incorrectly calls to C:\users\y\Appdata\Local\Melder\addons\ even though its library is actually located in C:\users\x\Appdata\Local\Melder\addons\ and thus the below occurs.

image

Testing against 3b19cdb27e45bbc8aa69e127934c1b6c61646530

GoomiiV2 commented 8 years ago

That is very odd, that button uses what ever path is set in the "Addon Library Location" setting. :/

theunkn0wn1 commented 8 years ago

Yeah.. I even tried hard-coding the function call in MainWindow.xaml.cs at line 187 to the correct path and rebuilding.. still called to the incorrect address :/

Also: I verified that the var MeldiiSettings.Self.AddonLibaryPath points to the correct location

eXpl0it3r commented 8 years ago

Once you grant UAC with x aren't you start acting as x, thus the user directory is x and not y?

theunkn0wn1 commented 8 years ago

Yes. therein lies the problem. When attempting to open the library path via the UI button the program calls to the wrong directory, that of user y's path and not than userx's I have cloned this repo and built it in my dev env and, when looking at the vars involved discover that MeldiiSettings.Self.AddonLibaryPath, the var that holds the path in question, correctly points to the path of user x image

yet, when the line that is highlighted in red (because break point) is executed, the result is image

please note that I have stripped the actual User Names and replaced them with hypothetical names x and y as described in my OP.

GoomiiV2 commented 8 years ago

Ok it seems windows will "correct" the path automatically if explorer is not launched as an admin, commit 03e413e should now launch it with admin privileges so as long as your user account has permissions to access that folder it should work as expected.

If you could test it out and let me know if this fixes it for you that would be great :>

theunkn0wn1 commented 8 years ago

Built c2fa741a and it goes to the right path now but now throws an "Access is denied" error... Right.. my standard user cannot access that folder.... That is what you mean right when you state

so as long as your user account has permissions to access that folder it should work as expected.

Right? image

GoomiiV2 commented 8 years ago

Yea, once I give my account access rights it works as expected now.

theunkn0wn1 commented 8 years ago

OK. this particular issue can now be considered resolved. Thanks for the assistance!