Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install extension with "'" in username/users path. #356

Closed
homotechsual opened this issue Oct 26, 2019 · 7 comments · Fixed by #381
Closed

Cannot install extension with "'" in username/users path. #356

homotechsual opened this issue Oct 26, 2019 · 7 comments · Fixed by #381

Comments

@homotechsual
Copy link

homotechsual commented Oct 26, 2019

Repro steps:

  1. Have user account with ' in the username.
  2. Try to install the extension.

Action: acquireDotnet
Error type: string
Error Message:

The term 'c:\Users\MichaelO' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:128
+ ... d]::CurrentThread.CurrentUICulture = '';& 'c:\Users\MichaelO'Toole.v ...
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (c:\Users\MichaelO:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Version: 0.7.0
OS: win32
Product: Visual Studio Code
Product Version: 1.39.2
Language: en

@homotechsual
Copy link
Author

Note: this results in the same behaviour as in #267

@StephenWeatherford
Copy link
Contributor

Ouch! That's a case I didn't consider. I'm guessing you've seen this before? :-) Will look will for a workaround tomorrow.

@StephenWeatherford
Copy link
Contributor

Apologies, have been much busier than expected. I do have a private build that has a setting you could use to work around this (by pointing it to an already-installed version of dotnet core). Do you want me to provide this? We were hoping to put out the next version (with these changes) tomorrow, but might be a bit later.

@homotechsual
Copy link
Author

I think we can trace this to this line in particular the single quoting of the "Install-Dir" which is then breaking on finding a single quote within the installation directory variable's value.

Working around it with a custom dotnet core installation directory is ok - would seem like a better long-term solution to fix the install scripting - not many people have control over the Windows username with Windows 10 and external authentication like Microsoft Accounts and (as in our case) Azure Active Directory providing the authentication and Windows 10 silently choosing a username behind the scenes.

@StephenWeatherford
Copy link
Contributor

Right, I was talking about a temporary work-around for you. Testing a fix right now.

@StephenWeatherford
Copy link
Contributor

If you want to work around this until the fix is published, try the following:

"c:\Users<USERNAME>\Repos\vscode-azurearmtools\assets\install scripts\dotnet-install.cmd" -InstallDir 'c:\Users<USERNAME>\AppData\Roaming\Code\User\globalStorage\msazurermtools.azurerm-vscode-tools.dotnet\2.2.5' -Runtime dotnet -Version 2.2.5

IMPORTANT: For USERNAME, replace any apostrophe with two apostrophes (' -> ''), e.g. O''Harris

Or optionally you can use the new setting to override the location of where it finds .dotnet: azureResourceManagerTools.languageServer.dotnetExePath

@homotechsual
Copy link
Author

Thanks @StephenWeatherford :-)

I'll give it a try. Much appreciated!

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants