AeliusSaionji / chocopkgs

13 stars 24 forks source link

wsltty 3.7.1: ERROR: Cannot bind argument to parameter 'Path' because it is an empty string #66

Open hwalinga opened 8 months ago

hwalinga commented 8 months ago

Some problem with installing wsltty:

Here is the log file:

2024-03-03 22:55:22,541 2124 [DEBUG] - ---------------------------Script Execution---------------------------
2024-03-03 22:55:22,545 2124 [DEBUG] - Running 'ChocolateyScriptRunner' for wsltty v3.7.1 with packageScript 'C:\ProgramData\chocolatey\lib\wsltty\tools\chocolateyinstall.ps1', packageFolder:'C:\ProgramData\chocolatey\lib\wsltty', installArguments: '', packageParameters: '', preRunHookScripts: '', postRunHookScripts: '',
2024-03-03 22:55:22,562 2124 [DEBUG] - Running package script 'C:\ProgramData\chocolatey\lib\wsltty\tools\chocolateyinstall.ps1'
2024-03-03 22:55:22,636 2124 [DEBUG] - Running Get-OSArchitectureWidth -compare '64'
2024-03-03 22:55:23,832 2124 [DEBUG] - Running Install-ChocolateyShortcut -shortcutFilePath 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\WSL Generate Shortcuts.lnk' -targetPath 'C:\ProgramData\chocolatey\lib\wsltty\tools\wslttyinstall\install.bat' -workingDirectory 'C:\ProgramData\chocolatey\lib\wsltty\tools\wslttyinstall'
2024-03-03 22:55:23,855 2124 [DEBUG] - Creating Shortcut...
2024-03-03 22:55:24,011 2124 [DEBUG] - Shortcut created.
2024-03-03 22:55:24,043 2124 [ERROR] - ERROR: Cannot bind argument to parameter 'Path' because it is an empty string.
2024-03-03 22:55:24,089 2124 [DEBUG] - Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = '';[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::SystemDefault; & 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 '' -preRunHookScripts $null -postRunHookScripts $null'] exited with '-1'.
2024-03-03 22:55:24,094 2124 [DEBUG] - Calling command ['"C:\WINDOWS\System32\shutdown.exe" /a']
2024-03-03 22:55:24,151 2124 [DEBUG] - Command ['"C:\WINDOWS\System32\shutdown.exe" /a'] exited with '1116'
2024-03-03 22:55:24,399 2124 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\wsltty'
2024-03-03 22:55:24,411 2124 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\wsltty\wsltty.nupkg'
  with checksum '47F3F0EE087BBD68141971FE00C09C97'
2024-03-03 22:55:24,414 2124 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\wsltty\wsltty.nuspec'
  with checksum 'D1201C2FE22B3EDFF66E367820CF79C0'
2024-03-03 22:55:24,416 2124 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\wsltty\tools\chocolateyinstall.ps1'
  with checksum '038A304A7A66771122B61B3D1B7B4516'
2024-03-03 22:55:24,418 2124 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\wsltty\tools\chocolateyuninstall.ps1'
  with checksum 'FF3013F1063ECB5F5B77452B2E4435CC'
2024-03-03 22:55:24,420 2124 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\wsltty\tools\LICENSE.mintty.txt'
...
2024-03-03 22:55:24,525 2124 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\wsltty\tools\wslttyinstall\wslbridge2.exe'
  with checksum '7B059F7324E699BD3DEDE1156F432483'
2024-03-03 22:55:24,528 2124 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\wsltty\tools\wslttyinstall\wsltty home & help.url'
  with checksum '46B926975285C5C892C77336B4F718B6'
2024-03-03 22:55:24,530 2124 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\wsltty\tools\wslttyinstall\zoo.exe'
  with checksum 'DA3FC1DBBB51DC2224387C82F68102C3'
2024-03-03 22:55:24,562 2124 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\wsltty.3.7.1\.arguments".
2024-03-03 22:55:24,564 2124 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\wsltty.3.7.1\.extra".
2024-03-03 22:55:24,565 2124 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\wsltty.3.7.1\.version".
2024-03-03 22:55:24,567 2124 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\wsltty.3.7.1\.sxs".
2024-03-03 22:55:24,568 2124 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\wsltty.3.7.1\.pin".
2024-03-03 22:55:24,578 2124 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib-bad\wsltty".
2024-03-03 22:55:24,604 2124 [DEBUG] - Sending message 'HandlePackageResultCompletedMessage' out if there are subscribers...
2024-03-03 22:55:24,610 2124 [ERROR] - The install of wsltty was NOT successful.
2024-03-03 22:55:24,654 2124 [ERROR] - Error while running 'C:\ProgramData\chocolatey\lib\wsltty\tools\chocolateyinstall.ps1'.
 See log for details.
2024-03-03 22:55:24,678 2124 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib-bad\wsltty".
2024-03-03 22:55:24,682 2124 [DEBUG] - Moving C:\ProgramData\chocolatey\lib\wsltty to C:\ProgramData\chocolatey\lib-bad\wsltty\3.7.1
2024-03-03 22:55:24,690 2124 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\wsltty'
 to 'C:\ProgramData\chocolatey\lib-bad\wsltty\3.7.1'
2024-03-03 22:55:26,724 2124 [WARN ] -
Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2024-03-03 22:55:26,727 2124 [INFO ] -
2024-03-03 22:55:26,728 2124 [ERROR] - Failures
2024-03-03 22:55:26,731 2124 [ERROR] -  - wsltty (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\wsltty\tools\chocolateyinstall.ps1'.
 See log for details.
2024-03-03 22:55:26,736 2124 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2024-03-03 22:55:26,740 2124 [DEBUG] - Exiting with -1
slycordinator commented 8 months ago

Since the error is occurring directly after the successful call to Install-ChocolateyShortcut, my guess is that the offending line in tools/chocolateyinstall.ps1 is: Remove-Item -Force -ea 0 "$filePath32"

$filePath32 will evaluate to the empty string, because there's no 32-bit installer provided in the package anymore, because upstream seemed to have stopped providing a 32-bit installer starting with this release.

AeliusSaionji commented 8 months ago

Thanks for the report, I've pushed a fixed version. If chocolatey doesn't reject it, should be available by tomorrow.

opello commented 7 months ago

This was originally a comment to #67 but I expect it belonged here, sorry for the noise.


https://community.chocolatey.org/packages/wsltty/3.7.1.20240304

Looks like Chocolatey is waiting for you to ask for moderator approval? I'm not sure how notifications for the messages in the "comments list" scrolling div get sent out, but here's the detail:

wsltty has been flagged as part of automated virus scanning. Package virus scanning found that at least 1 file within, or downloaded by, the package has between 6 and 10 VirusTotal detections associated with it.

After logging it it seems that the installer showed 6 detections:

wsltty-3.7.1-x86_64-install_x64.exe (397036f24ebb) -6/71

And annoyingly today VirusTotal shows 4. I'm not sure if there's a way to trigger a re-query of VirusTotal in some Chocolatey dashboard. But just so you're aware I did open an upstream issue and it seems like the only real answer is to sign the installers which was more scope than upstream was willing to accept.

That was all in service of:

If there a known reason that this software may have a high rate of false positives, please link to the upstream documentation (for example it could be an issue or wiki) in the package description. Then ask for an exemption and a moderator will review the documentation. If there is not a known and documented reason, please contact the software authors to see if they have any reasons they can document.

The reason is iexpress.exe generated installers are commonly used in pentesting and malware packagers so it's essentially been fingerprinted as universally bad, despite it's more humble beginnings.

Anyway, I hope this was helpful and prods the process along. Thanks for maintaining this in Chocolatey.