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

winScp sessions not listed #488

Open
verajosemanuel opened this issue Dec 19, 2020 · 11 comments · May be fixed by Keypirinha/Packages#40
Open

winScp sessions not listed #488

verajosemanuel opened this issue Dec 19, 2020 · 11 comments · May be fixed by Keypirinha/Packages#40

Comments

@verajosemanuel
Copy link

Installed WinSCP with keypirinha in portable mode. Using WinSCP keyword only options are: Rebuild catalog and Start Program.

all my WinSCP sessions are labelled as requested by instructions (WinSCP : name)

any other requirement I am not aware of?

regards

@polyvertex
Copy link
Member

Your WinSCP sessions do not need at all to be labeled as per format WinSCP: <name>. That is just the format of the resulting items in Keypirinha.

You have to configure KP's WinSCP package.

Search for the Keypirinha: Configure Package: WinSCP item in Keypirinha so to open WinSCP package config file.

The edit the file so that your configuration should be something like:

[dist/official]
enable = yes
path = C:\SomeDir\WinSCP
ini_path = C:\SomeDir\WinSCP\WinSCP.ini

Where C:\SomeDir\WinSCP is the installation folder of WinSCP.

@verajosemanuel
Copy link
Author

verajosemanuel commented Dec 20, 2020

Followed your instructions to no avail. Still no site is listed.
noticed WinSCP.ini is not an existing file. Theres a winscp.ini file inside keypirinha folder but seems to be a different file.

So I exported my Winscp configuration to an ini file and placed the path into config this way:

[dist/official]

enable = yes

path = C:\Users\joe\AppData\Local\Programs\WinSCP\WinSCP.exe

ini_path = C:\Users\joe\AppData\Local\Programs\WinSCP\WinSCP.ini

sill not listing any site

@polyvertex
Copy link
Member

polyvertex commented Dec 21, 2020

Installed WinSCP with keypirinha in portable mode.

I assumed you also use WinSCP itself in portable mode, in which case its configuration is stored in file WinSCP.ini iirc in its own folder by default.

If however you do use WinSCP in installed mode you do not have to export your WinSCP configuratrion. And you do not even need to configure KP's package. Keypirinha's WinSCP package should read your WinSCP sessions from the Registry (at HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\Sessions).

If your WinSCP sessions are still not listed, checking KP's Console might be useful (press F2 from KP's main window).

@verajosemanuel
Copy link
Author

verajosemanuel commented Dec 21, 2020

you are right. Wiscp is installed mode. I've checked console:

18:40:09.928 WARNING: WinSCP.WinSCP: WinSCP distribution "official" not found in: C:\Users\joe\AppData\Local\Programs\WinSCP\WinSCP.exe

it is very strange. That is the exact location of WinSCP executable. I can reach that folder and execute winSCP on double click.

winscp

@sam97
Copy link

sam97 commented Dec 23, 2020

verajosemanuel, can you confirm that there are no ERROR: ... or ERR: ... messages around the warning message that you found in the console?

I'd also suggest going to Keypirinha: Configure Package: WinSCP from KP, removing everything from the right-side configuration, and checking the console messages again for any errors or warnings. Since the package autodetects both install folder and session configurations we shouldn't need to provide them explicitly (and providing INI won't work anyways because it seemingly does not exist on your system).

Thirdly, check which config store you're using by enabling logging in WinSCP. The first few lines of the log file should be enough to give a clear idea.

@verajosemanuel
Copy link
Author

verajosemanuel commented Dec 23, 2020

Hi
I can confirm no ERROR: around the warning.

Removed everything on right side as you mentioned.

15:41:35.857 WinSCP.WinSCP: Configuration changed, rebuilding catalog...

but to no avail. Still no saved site is shown in addition to"rebuild catalog" and "start program". None of the sites I have in Winscp are listed.

@sam97
Copy link

sam97 commented Dec 23, 2020

Can you enable logging and check the logs? Let's see what store WinSCP is using and why KP is not able to read it.

  1. Create an empty logs folder in your WinSCP directory, next to winscp.exe.
  2. Open WinSCP; go to Preferences > Logging and check 'Enable session logging'.
  3. Change 'Log Path' to logs/!S.log.
  4. Close and open WinSCP.
  5. Open logs folder and open the first *.log file with notepad.
  6. Report back with the first five lines of the file (until 'Local account: ...').

If you can, check WinReg to see whether HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\Sessions has all your sessions listed.

@verajosemanuel
Copy link
Author

verajosemanuel commented Dec 24, 2020

I confirm all my sessions are listed at Winreg HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\Sessions

here the logs opening WinSCP

. 2020-12-24 12:31:29.159 --------------------------------------------------------------------------
. 2020-12-24 12:31:29.160 WinSCP Versión 5.17.9 (Compilación 10905) (OS 10.0.19042 - Windows 10 Enterprise)
. 2020-12-24 12:31:29.160 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2020-12-24 12:31:29.160 Log level: Normal
. 2020-12-24 12:31:29.160 Local account: WORKGROUP\joe
. 2020-12-24 12:31:29.160 Working directory: C:\Users\joe\AppData\Local\Programs\WinSCP
. 2020-12-24 12:31:29.160 Process ID: 7304
. 2020-12-24 12:31:29.160 Command-line: "C:\Users\joe\AppData\Local\Programs\WinSCP\WinSCP.exe" 
. 2020-12-24 12:31:29.161 Time zone: Current: GMT+1, Standard: GMT+1 (Hora estándar romance), DST: GMT+2 (Hora de verano romance), DST Start: 29/03/2020, DST End: 25/10/2020
. 2020-12-24 12:31:29.161 Login time: jueves, 24 de diciembre de 2020 12:31:29
. 2020-12-24 12:31:29.161 --------------------------------------------------------------------------

Thanks !!

@sam97
Copy link

sam97 commented Dec 24, 2020

Hmm. I can reproduce and confirm this issue by installing WinSCP in "Only for me" mode as opposed to "For all users" mode. The package is working fine in the latter, but in the former it is behaving as if enabled = no. When enabled = yes is given the warning WinSCP distribution "official" not found is thrown because we are not accounting for the install folder being in AppData.

@verajosemanuel, for now you should be able to work around this issue by using Keypirinha: Configure Package: WinSCP in KP and putting the following on the right-side config:

 [dist/official]
 path = C:\Users\joe\AppData\Local\Programs\WinSCP

@polyvertex I think I have the issue. I'll test my fixes in a few different environments and send a PR with some analysis tonight.

@verajosemanuel
Copy link
Author

verajosemanuel commented Dec 27, 2020

@sam97 great! But the workaround was used before (see my second comment here) removing ini_path to no avail. I will wait for your fix.
Thanks a lot

@sam97
Copy link

sam97 commented Dec 27, 2020

@verajosemanuel I don't think the workaround in your second comment is quite valid, although I may be wrong -- path requires a folder path, not an EXE path. We need to provide the path to the WinSCP folder. The package will find the EXE on its own.

It may seem redundant, but If you try my two-line workaround and report the results we'll know for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants