HASS.Agent icon indicating copy to clipboard operation
HASS.Agent copied to clipboard

Bug: installer uses admin path instead of the initial user's after uac prompt

Open JvdMaat opened this issue 2 years ago • 2 comments

This is probably a fringe scenario, but I added this to my work laptop on which I am not an Administrator. So the UAC pops up for admin credentials, in which I enter a local Admin account, and then the next screen will attempt to install HASS.Agent in: C:\Users\localadmin\AppData\Roaming\LAB02 Research\HASS.Agent\

And after install, I (as regular user) do not have access to that folder. So install needs to happen in a "logged in user", not in the UAC prompted user context. (Not sure if the logged in user is exposed to the installer after it's UAC'd into the admin account)

(And yes, once I figured this out, I removed it, and re-installed it and updated the install path after the UAC prompt. Easy workaround, but could bug others)

JvdMaat avatar May 25 '22 13:05 JvdMaat

~~The easiest solution (for now) is to manually change localadmin in the install path to your username.~~

I just read you already figured that out. You're right, and the installation process is on the list to be improved!

[hassagent-100]

LAB02-Admin avatar May 25 '22 13:05 LAB02-Admin

This is an issue for me. I know that some installers can have issues when UAC is involved. I think this is because the installer tries to install to the running user, so if UAC is enabled it will change to administrator.

geiseri avatar Aug 23 '22 14:08 geiseri

Ahh this is the issue I am having as well:

image

joydashy avatar Oct 07 '22 06:10 joydashy

It's being worked on, sorry for the inconvenience!

LAB02-Admin avatar Oct 11 '22 08:10 LAB02-Admin

This is probably a fringe scenario, but I added this to my work laptop on which I am not an Administrator. So the UAC pops up for admin credentials, in which I enter a local Admin account, and then the next screen will attempt to install HASS.Agent in: C:\Users\localadmin\AppData\Roaming\LAB02 Research\HASS.Agent\

And after install, I (as regular user) do not have access to that folder. So install needs to happen in a "logged in user", not in the UAC prompted user context. (Not sure if the logged in user is exposed to the installer after it's UAC'd into the admin account)

(And yes, once I figured this out, I removed it, and re-installed it and updated the install path after the UAC prompt. Easy workaround, but could bug others)

Can you explain this workaround, as I don't understand it. When I reinstall it and decline the UAC prompt, it wont install.

joydashy avatar Oct 18 '22 16:10 joydashy

Run the install on your non-privileged account, enter admin credentials on UAC, and then update the destination folder in the installer. It will show: C:\Users\localadmin\AppData\Roaming\LAB02 Research\HASS.Agent
And you need to replace the localadmin part with your username's folder.

JvdMaat avatar Oct 18 '22 16:10 JvdMaat

First of all, a Huge THANKS to the dev(s)... This is awesome!

I too had this problem while installing it on 2 computers where the users are not admins. The workaround does work for most things, however, it would seem in my case at least that there was an issue configuring the Local API port to work. When I did the: "Execute Port Reservation" it asks for admin creds, then proceeds to execute and appears to be successful, however, when launching HASS.Agent, I get a message that there may be another instance of HASS.Agent running, or the port config isn't correct. I disabled the local API in the config, and no longer get the error when starting it. I'm not 100% sure what the local API does yet, and haven't noticed (yet) any missing functionality.

StumblingGamer avatar Oct 21 '22 19:10 StumblingGamer

Hi @StumblingGamer, sorry for the late reply.

The local API was used for the old integrations to provide notifications and mediaplayer support, but the new all-in-one integration uses MQTT as the default instead. So if you're not missing anything, feel free to keep it disabled :)

LAB02-Admin avatar Nov 10 '22 09:11 LAB02-Admin