mintty / wsltty

Mintty as a terminal for Bash on Ubuntu on Windows / WSL
Other
3.12k stars 104 forks source link

Access is denied. The install of wsltty was NOT successful #250

Closed suntong closed 4 years ago

suntong commented 4 years ago

I got:

choco install -y wsltty
Chocolatey v0.10.15
Installing the following packages:
wsltty
By installing you accept licenses for the packages.
Progress: Downloading wsltty 3.2.0... 100%

wsltty v3.2.0 [Approved]
wsltty package files install completed. Performing other installation steps.
ERROR: This command cannot be run due to the error: Access is denied.
The install of wsltty was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\wsltty\tools\chocolateyinstall.ps1'.
 See log for details.

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - wsltty (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\wsltty\tools\chocolateyinstall.ps1'.
 See log for details.

This is a corporate PC with excessive restrictions. I checked the log and it turns out to be:

2020-07-20 20:53:01,229 73160 [INFO ] - VERBOSE: Importing alias 'Start-ChocolateyProcess'.
2020-07-20 20:53:01,272 73160 [DEBUG] - ---------------------------Script Execution---------------------------
2020-07-20 20:53:01,273 73160 [DEBUG] - Running 'ChocolateyScriptRunner' for wsltty v3.2.0 with packageScript 'C:\ProgramData\chocolatey\lib\wsltty\tools\chocolateyinstall.ps1', packageFolder:'C:\ProgramData\chocolatey\lib\wsltty', installArguments: '', packageParameters: '',
2020-07-20 20:53:01,287 73160 [DEBUG] - Running 'C:\ProgramData\chocolatey\lib\wsltty\tools\chocolateyinstall.ps1'
2020-07-20 20:53:01,328 73160 [DEBUG] - Running Get-OSArchitectureWidth -compare '64' 
2020-07-20 20:53:01,710 73160 [ERROR] - ERROR: This command cannot be run due to the error: Access is denied.
2020-07-20 20:53:01,714 73160 [DEBUG] - Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\wsltty\tools\chocolateyinstall.ps1' -installArguments '' -packageParameters '''] exited with '-1'.

Since I have tons of chocolatey packages installed, I'm sure there is a way to overcome such restriction (of calling Get-OSArchitectureWidth).

mintty commented 4 years ago

Not familiar with choco installation, I'd guess you should have admin privilege to run the installation. Or try to install the original installer of this project to check please.

suntong commented 4 years ago

I am running every installation with admin privilege

image

will report to the choco installation author and try scoop instead.

suntong commented 4 years ago

Holly smoke, when I said "This is a corporate PC with excessive restrictions", I wasn't joking at all -- when I tried to install the original installer of this project, the downloaded .exe disappeared right after I launched it:

image

Talking about excessive restrictions! My lord!

mintty commented 4 years ago

If wsltty installer, choco and scoop all fail, there's still the option to install cygwin, download the wsltty archive from here and run make install. A small number of additional cygwin packages would be needed for which there is currently no overview, gcc, make and unzip at least.

Biswa96 commented 4 years ago

Alternatively, the wsltty installer can be extracted in a folder with 7ZIP like tools but it will not generate the shortcuts.

mintty commented 4 years ago

If you run the install.bat script, all configuration should be done. If, on the other hand, the installer gets deleted by some anti-virus policy before you can unpack it, you're out of luck. For that case, I may provide an additional zip archive if needed.

suntong commented 4 years ago

Thanks you all for chipping in offering help.

Currently I'm contacting the choco installer author for help, as it seems our anti-virus watches over browser download only, and not over the cinst scripts yet (touch woods).

Failing that, I can try ask for exceptions from my IT department, although the chance is slim, I'd like to exhaust all my options before coming back asking for more help.

will let you know...

mintty commented 4 years ago

Is this still an issue or can we close it?

suntong commented 4 years ago

Sorry for the delay. The thing is, I decided to go through IT to white-list it, albeit it'll take a long time, but it will be the least hassle way of doing things. However, three months passed but I haven't heard from IT yet.

I'll give cinst scripts another go tomorrow. If all failed, then, yes, we may need an additional zip archive...

mintty commented 4 years ago

You mean an archive of the binary distribution, instead of an installer?

suntong commented 4 years ago

Yeah, exactly, but hold on,as I said,

I'd like to exhaust all my options before coming back asking for more help.

suntong commented 4 years ago

Hmm... I'm closing this, as I don't think there is anything you can do at your end to make things work for the situation like this.

This is what I've just tried:

iwr 'https://aelius.keybase.pub/wsltty.portable.3.3.0.nupkg' -OutFile wsltty.portable.3.3.0.nupkg
iwr :
D01We found a security threat.
Website blocked
You tried to visit: https://aelius.keybase.pub/wsltty.portable.3.3.0.nupkg
Threat found: Virus
See our internet use policy.
Need help? Contact our support team at ...
Your organization has selected Zscaler to protect you from internet threats.
At line:1 char:1
+ iwr 'https://aelius.keybase.pub/wsltty.portable.3.3.0.nupkg' -OutFile ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExcept
   ion
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
mintty commented 4 years ago

I have made a zip file manually as a test case. Can you install wsltty with this? wsltty-3.4.2-x86_64.zip

Instruction: unzip the archive, go into the folder and invoke its install.bat script.

suntong commented 4 years ago

Oh, YES! this works for me!

Thank you very much @mintty for going the extra miles helping people like me. Really appreciate it!

I'm so happy. Thanks again!

Biswa96 commented 4 years ago

Try this. Download the wsltty installer in a WSL2 installation. Then extract all the files from it with p7zip. The installer is a self extracting file, so 7zip can extract it. The anti-virus may not scan into WSL2 VHDX file.

mintty commented 4 years ago

Ah, so that could save me from adding a zip file to the build and distribution. But where do Windows users get 7zip from?

mintty commented 4 years ago

I think I'll make it a "cabinet" file, to save all complications.

mintty commented 4 years ago

Released 3.4.3 with build of cab file. Adding instruction to project page.

suntong commented 4 years ago

Thanks, that's the best option, as I'm still using WSL, not WSL2. I.e., the files in WSL are not hiding within WSL2 VHDX file, but reside in plain sight, albeit a bit hard to find.

mintty commented 4 years ago

You would normally download and unpack the archive file at Windows level, so it doesn't matter what WSL you use.

mintty commented 3 years ago

Released 3.4.4.