BetterJoy icon indicating copy to clipboard operation
BetterJoy copied to clipboard

Unhandled Exception when run as Admin first time

Open sanford opened this issue 6 years ago • 7 comments

The instructions are unclear (the docs show that you're supposed to run the old .bat as Admin) so a number of folks try running the main app as Admin.

If run as Admin the 1st time, the app gets confused about where settings is stored (tries to put them in system32).

If you then try to run the app again as a non Admin user, you get an "Unhandled Exception" alert trying to open system32.

Suggested fix: determine if being run as Admin and pop an Alert that says "This app will exit now. Please re-run without Admin privileges".

See this issue for full error details: https://github.com/Davidobot/BetterJoy/issues/310

sanford avatar May 07 '20 11:05 sanford

I'm assuming it keeps the location of settings in a registry key somewhere? Where can I change it?

sanford avatar May 07 '20 11:05 sanford

Ah yeah, sorry. I didn't update the new README to account for the new driver installation process.

It doesn't hold the locations of settings anywhere, it just refers to it as "settings", so when running as not admin it will just look into the current working directory.

Davidobot avatar May 07 '20 11:05 Davidobot

Here's the challenge. I'm now running it as a regular user (after I've run it once as Admin). Unfortunately I still get the system32 error.

Thoughts?

sanford avatar May 07 '20 11:05 sanford

Windows automatically remembers the new working directory perhaps? Does redownloading it and replacing the exe work?

Davidobot avatar May 07 '20 11:05 Davidobot

Ah, you have to manually re-navigate back to the install directory and re-run it. If you use the windows search bar it re-runs it as Admin.

sanford avatar May 07 '20 11:05 sanford

K, I'm going to close this one, but perhaps we can put a note in the install .txt that says "DO NOT RUN AS ADMINISTRATOR" :D. Thanks again for the awesome work (my Pro controller has a new life!)

sanford avatar May 07 '20 11:05 sanford

No worries! Glad you got it working.

I'll see if I can prevent this mixup from happening. Maybe prevent admin mode or something. Thanks for your help!

Davidobot avatar May 07 '20 11:05 Davidobot