Chocolatey-coreteampackages: (winscp) WinSCP.com should get a shim

Created on 13 Jan 2020  路  12Comments  路  Source: chocolatey-community/chocolatey-coreteampackages

Expected Behavior

With winscp.portable (and likely winscp.installer too), the file WinSCP.com should get a shim.

Current Behavior

WinSCP.exe gets a shim during installation, but WinSCP.com doesn't.

Context

WinSCP.com is the console-only version which can be used in automated scripts, etc. It's possible to use WinSCP.exe /console for some situations, but exit codes don't work the same way.

Enhancement Up for grabs

All 12 comments

@majkinetor do you want me to close this one and open #1134, or leave this one open?

All is fine.

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

AFAIK, still relevant.

@burfo
Would copying WinSCP.com to the location of the shimmed WinSCP.exe accomplish what is requested?

The questions are more about:

  • do you require it in the PATH?
    {The entire chocolatey bin directory is on the PATH}
  • what location is expected?
  • would something like programdata/chocolatey/WinSCP.com work for you?

@RedBaron2 I would expect (and prefer) for WinSCP.com to be in the PATH, yes. This executable is used in scripts and such; it would not be ideal to embed the executable's path into the scripts. If it's in PATH, then I don't have any preference on where it's actually stored but being next to WinSCP.exe would seem appropriate to me.

@burfo
I'll work on a test package for you by the end of the week fingers crossed . You can give me feedback if it works for you.

I'll edit this with the package URL later

@RedBaron2 be mindful that adding files manually to the bin directory is not allowed on chocolatey.org.
The same goes for any directory underneath %ChocolateyInstall% other than the package directory itself.

The best bet would actually be to change the installation location to use Get-ToolsLocation and add that to the PATH environment variable instead of relying on shims.

NOTE: This will require a call to refreshenv by the user for them to use the program immediately after installation without restarting the shell

I suggest simply adding shim to it.

@majkinetor I don't think that would work in this case, I believe it may be incompatible with the already shimmed WinSCP.exe file.
But by all means, if it do work then indeed that would be the best.

FYI: the normal install of the WinSCP Setup file _Does Not_ add either WinSCP.exe or WinSCP.com to the _Path_
This is only done when installing WinSCP.Install through Chocolatey

AdmiringWorm had quoted in issue #1134

I'm guessing that if we were to shim the winscp.com utility, it would ... be shimmed as winscp.com.exe

This appears to be the easiest solution to the problem.

  • It will put it on the path
  • It will make it accessible from the cmd and posh
  • It will be a simple line addition to the WinSCP.Install package un/install script files
  • NOTE: If the shim is renamed to be WinSCP.com _It will be uninstalled_ through chocolatey {Tested Works}
    AdmiringWorm has pointed out that manual change to any files in the bin directory is not allowed on chocolatey.org.

The negatives are

  • That it doesn't add the shim if the WinSCP.Portable is installed.

@burfo
If you are concerned about the .exe extension now added to the file. This appears to be a side effect of the Un/Install-BinFile helper function 馃槥

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ericoporto picture ericoporto  路  3Comments

Foadsf picture Foadsf  路  4Comments

jerome-benoit picture jerome-benoit  路  5Comments

verglor picture verglor  路  5Comments

kaffeekanne picture kaffeekanne  路  4Comments