Author Topic: VA Path Error - Solved  (Read 3499 times)

Lee

  • Newbie
  • *
  • Posts: 4
VA Path Error - Solved
« on: March 31, 2022, 06:38:57 PM »
I have an interesting error that hasn't been resolved by deinstalling and reinstalling VA and voice packs. I'm receiving the following red square icon error messages:

VA's path = C:\Users\Lee\Documents
Error unable to retrieve documents local path, setting path to VA's instead.

Running VA ver 1.8.9 64-bit with ED and Aviator voice packs. VA with App and Sound directories are in the normal C:\Programs (x86) VA folders. Voice packs and profile commands work OK, however I keep receiving a steady stream of these error messages. I can run VA but these errors are bothersome.

I think it might be due to my default Windows Documents directory is on my Synology NAS S: drive. I've tried VA with and without a C:\Users\Lee\Documents directory but it doesn't seem to change the errors. I see no way to set a document path in VA and I've peeked in the registry for a default VA documents variable but none was found.

Very puzzling issue...  Any suggestions?

« Last Edit: April 02, 2022, 07:08:36 PM by Lee »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: VA Path Error
« Reply #1 on: March 31, 2022, 06:43:12 PM »
Are you running VoiceAttack as administrator?

If S:\ is a mapped network drive on your account, it won't be available to applications running as administrator (this is not specific to VoiceAttack).


VoiceAttack generally does not need to run as administrator, unless you have a specific need to have it interact with applications that are running as administrator, or otherwise require VoiceAttack to run as administrator to allow interaction (which is rare).

Lee

  • Newbie
  • *
  • Posts: 4
Re: VA Path Error
« Reply #2 on: March 31, 2022, 06:47:29 PM »
Good question.  Unfortunately, I've tried running normal and as Administrator with same results.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: VA Path Error
« Reply #3 on: March 31, 2022, 06:50:40 PM »
When do these messages appear? (E.G. after the profile loads, each time you execute a command, periodically even when not executing commands, ...)

If you disable plugin support and create a new, empty profile, do they still appear?


They don't look like messages I have personally seen generated by VoiceAttack itself, so they may actually be generated by the third-party profile and/or plugin you are using.

VoiceAttack itself does not use the Documents directory by default, either.


Note that if VoiceAttack is not running as administrator, a log message with an orange icon should appear on startup, noting "VoiceAttack privileges not elevated.  Pro Tip - If you are having trouble with key presses being recognized, try running as an administrator.", unless you have previously chosen "Stop showing this message" in the context menu for that log entry.

Lee

  • Newbie
  • *
  • Posts: 4
Re: VA Path Error
« Reply #4 on: March 31, 2022, 07:40:24 PM »
Error always appear when the ED or Aviator profile is loaded and sometimes while using the profiles. Haven't correlated if the error displays for any particular command.

Path error only appears when using the ED or Aviator profiles with or without voice packs installed.

Path error does not appear if the HCS plugin v3.8.1 is disabled.

Path error does not appear with an empty profile with or without the plugin disabled. Nor does the error appear when using my own created gaming profiles.


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: VA Path Error
« Reply #5 on: March 31, 2022, 09:05:03 PM »
Then it does indeed appear that the messages you mentioned are generated by that third-party plugin.

You'll want to contact the authors of said plugin about this via their forum, or their Discord



One thing I would still recommend doing regardless is to double-check that VoiceAttack is not running as administrator.

Paste the following into an "Inline Function - C# Code" action (replacing the example code), and click the "Test Run" button:
Code: [Select]
using System.Security.Principal;

public class VAInline
{
public void main()
{
var identity = WindowsIdentity.GetCurrent();
var principal = new WindowsPrincipal(identity);
VA.WriteToLog("Running as administrator: " + principal.IsInRole(WindowsBuiltInRole.Administrator));
}
}

If it comes up "False", VoiceAttack is indeed not running as administrator, and the mapped drive should presumably be accessible. If it comes up as "True", VoiceAttack is still running as administrator, and the mapped drive will most likely not be accessible.


In addition, if you open a dialog that allows you to browse for files, E.G. by clicking the button on VoiceAttack's main window and choosing "Import Profile", if the mapped drive is not shown within that dialog, it will not be available to the plugin either.

Lee

  • Newbie
  • *
  • Posts: 4
Re: VA Path Error
« Reply #6 on: March 31, 2022, 10:07:31 PM »
Yep, found it. Running VA as Administrator was the problem. I didn't think I was running VA in an elevated mode, but running the recommended C# code inline function showed I was. Brilliant troubleshooting, sir.

Looks like there are three separate ways that VA can be run as Administrator, 1) right-click the VA icon and select Run as Administrator, 2) enabling the VA menu > System/Advanced > Run VA as an Administrator, and 3) the tricky one I didn't uncover until just now - right click the VA icon > Properties > Compatibility >  Run this program as Administrator. 

I indeed was running VA as an Administrator and the mapped S: drive local document path was hidden from VA as a result. I unchecked the option in Compatibility mode and the pathing error has disappeared. I also now see the orange warning message about privileges not elevated and VA can finally see my mapped S: drive.

Nice work, Pfeil. I think this issue can be marked as solved or moved to the ex-issues area.

Thank you very much!