Valorant-Ultrawide-Fix icon indicating copy to clipboard operation
Valorant-Ultrawide-Fix copied to clipboard

Multiple accounts or old installations of Valorant causes the install script to fail.

Open crocokyle opened this issue 4 years ago • 3 comments

Get-Content : Access to the path 
'C:\Users\<user>\AppData\Local\VALORANT\Saved\Config\2d1c7717-2939-5a37-9c3f-88697b734759\Windows' is denied.
At C:\Users\<user>\Downloads\Valorant-Ultrawide-Fix-main\SysSetup.ps1:53 char:29
+     $existingSettingsfile = Get-Content $ExistingSettings
+                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (C:\Users\qeeyo\...b734759\Windows:String) [Get-Content], 
UnauthorizedAccessException
    + FullyQualifiedErrorId : GetContentReaderUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetContentCommand
Get-Content : Access to the path 'C:\Users\<user>\AppData\Local\VALORANT\Saved\Config\2d1c7717-2939-5a37-9c3f-88697b734759\Windows' is denied.
At C:\Users\<user>\Downloads\Valorant-Ultrawide-Fix-main\SysSetup.ps1:53 char:29
+     $existingSettingsfile = Get-Content $ExistingSettings
+                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (C:\Users\<user>\...b734759\Windows:String) [Get-Content], UnauthorizedAccessException
    + FullyQualifiedErrorId : GetContentReaderUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetContentCommand

crocokyle avatar Jan 25 '21 02:01 crocokyle

  • Added self-elevating UAC prompt. This did not solve the issue.
  • The error message is misleading since Get-Content is looking for a path. It has nothing to do with permissions.
  • Added Debug output for all path variables to find out why path strings aren't being concatenated properly.
  • Moved $script:MyInvocation.MyCommand.Path to run before the UAC prompt to avoid getting assigned C:\

crocokyle avatar Jan 25 '21 02:01 crocokyle

This issue occurs when users have multiple accounts or old installations of Valorant. It causes the script to fail because there are multiple tokenized folders in AppData\Local\VALORANT\Saved\Config

Plan is to implement a loop for each tokenized folder.

crocokyle avatar Jan 25 '21 03:01 crocokyle

For users who want a workaround, you'll want to only delete the only the single folders that looks like

AppData\Local\VALORANT\Saved\Config\bd20b341-ef13-542a-bcf7-dc3523cc43c9

which corresponds to your old account. For myself, I was able to identify the unused folders by logging in to my active account in Valorant, then look at the folders to see which had a date modified of today. Then I just deleted the folders that were not modified today.

If you are worried about making a mistake, you can always move the folders somewhere else as a backup and then put it back if something breaks.

crocokyle avatar Apr 28 '21 17:04 crocokyle