You are here

[Fixed] WinSCP resets PuTTY configuration

11 posts / 0 new
Last post
impbob
Offline
Last seen: 3 years 8 months ago
Joined: 2018-05-30 20:32
[Fixed] WinSCP resets PuTTY configuration

I'm trying to use the "Open Session in Putty" button in WinSCPPortable. I can configure update the configuration path in Options | Preferences | Integration | Applications | Putty/Telnet client path and it works as expected (I use KittyPortable ).

However, if I close WinSCP, reopen it, and click Open Session in Putty, it asks me to open PuttyPortable first. When I check the Options, it appears to reset.

I tried watching the config file (...\WInSCPPortable\Data\settings\winscp.ini) for changes. Changes are saved, and they persist after closing the app too. When I open WinSCPPortable, several settings appear to reset.

OS: Win10x64 WinSCPPortable:5.11.3

John T. Haller
John T. Haller's picture
Online
Last seen: 40 min 23 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
PuTTY Specifically

WinSCP Portable has the ability to specifically link to PuTTY Portable using the built-in PuTTYPortableLinker.exe and ensure both apps stay portable. The WinSCP Portable launcher specifically sets the PuttyPath entry in settings to this path on launch. KiTTY is not currently supported. If you wish to use KiTTY, please use the standalone WinSCP not in PA.c Format at this time.

Sometimes, the impossible can become possible, if you're awesome!

impbob
Offline
Last seen: 3 years 8 months ago
Joined: 2018-05-30 20:32
Thank you for the reply. I

Thank you for the reply. I understand that Kitty is not support.

I'm curious :
- if future support will be provided
- is there something I could do to help provide support
- assuming there is no support, why the need reset the file

Anyway, thanks for the years (and years) of time you have spent on the website and apps. It's made it easy to test websites in different browsers, and "install" software on friends / family PCs. Smile

John T. Haller
John T. Haller's picture
Online
Last seen: 40 min 23 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Written On Startup

The only way WinSCP Portable can fully use PuTTY Portable and keep things portable is via that PuTTYPortableLinker.exe linker app that handles it. These keeps PuTTY from having multiple copies of itself stepping on the registry entries. It's written on startup because when this portablization method was implemented, KiTTY Portable didn't exist.

According to the WinSCP documentation there is a series of entries you can use to specifically pass the details in portable mode otherwise WinSCP open KiTTY in non-portable mode. However, I'm not sure if these specific parameters prevent WinSCP from writing the registry entry as well. Do you happen to know if these prevent WinSCP from writing the registry key?

We'd need to figure all this out before altering the implementation as if it does it via registry key, that'll not only leave private data behind on the local machine, but possibly result in KiTTY running in non-portable mode as well. If there is a way to get WinSCP to call KiTTY in portable mode specifically, then we could possibly have it pre-configured if KiTTY Portable Exists but not PuTTY Portable by default.

Sometimes, the impossible can become possible, if you're awesome!

impbob
Offline
Last seen: 3 years 8 months ago
Joined: 2018-05-30 20:32
I did a little investigating:

I did a little investigating:

The settings I use to call KittyPortable is :

z:\testing\KiTTYPortable\KiTTYPortable.exe !U@!@ -P !# -title "!N"

The steps I used for watching registry changes

RegFromApp - https://www.nirsoft.net/utils/reg_file_from_application.html
1. Open RegFromApp
2. Open WinSCPPortable
3. In RegFromApp, select File | Start with exisiting process & select WinSCPPortable
4. in WinSCPPortable, connect a server. Select Options | Preference | Integration | Application & change putty preferences. Select OK
5. RegFromApp detects no changes.
6. Exit WinSCPPortable and no changes detected

RegistryChangesView - https://www.nirsoft.net/utils/registry_changes_view.html
1. Open RegistryChangesView
2. Take snapshot
3. Open WinSCPPortable & connect & close
4. Take snapshot and compare. There are some references to WinSCPPPortable in the following keys
- HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store
- HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search\JumplistData
- HKEY_LOCAL_MACHINE\System\ControlSet001\Services\bam\UserSettings\{%CSLID%}

5. Open WinSCPPortable, connect to server.
6. In RegistryChangesView, take new base snapshot.
7. In WinSCPPortable, update options (see above) and close
8. In RegistryChangesView, take new snapshot. Changes include
- HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store
- HKEY_LOCAL_MACHINE\System\ControlSet001\Services\bam\UserSettings\{%CSLID%}
As above, both of these key reference WinSCPPortable EXE file in "Value Name", and updated Value data of a REG_BINARY string

9. In WinSCPPortable, connect to server using Open Session from Putty (with KittyPortable settings)
10. In RegistryChangesView, take new snapshot. Changes include
- HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store
- HKEY_LOCAL_MACHINE\System\ControlSet001\Services\bam\UserSettings\{%CSLID%}

The last key now includes references with WinSCP.exe, PuttyPortableLauncher.exe, KittyPortable.exe,& kitty_portable.exe

In Regedit, both the Compatibility Assistant and bam\UserSettings\{%CSLID%} areas appear to contain a list of every file I've run (including numerous PortableApps). As far as I can tell, no specific Kitty data seems to be stored. The path/filename is, but this appears to be the norm form other PortableApps too.

Hope this helps Smile

depp.jones
Offline
Last seen: 1 day 16 hours ago
DeveloperTranslator
Joined: 2010-06-05 17:19
Hi, I'm the maintainer of

Hi, I'm the maintainer of KiTTY Portable. I don't use it in conjunction with WinSCP, so did not test this usecase. From a quick look, you're calling KiTTY's PA.c launcher (KiTTYPortable.exe) to open a session with kitty. That way it should stay in portable mode, even with recurring launches. I don't know for the command line parameters, but they should be passed correctly to kitty_portable so I think that's not a problem here.

KiTTYs portablization method works differently compared to PuTTY Portable. The registry is not used. As long as the configdir setting in the kitty.ini remains intakt (pointing to the DATA directory), all settings go there and it stays portable. There is a registry handling section because KiTTY used to leave some (PuTTY-) keys in the registry even in portable mode a long time ago, but I don't know if that's still the case. I left it there just to be shure. Maybe I should test the next release if this section is obsolete.

As the command line examples in the WinSCP settings seem hardcoded in WinSCPs source code, I don' know a way to add your command line in addition to the PuTTYPortableLinker. The WinSCP-Launcher is a custom nsi-launcher (not PA.c-Launcher based). Atm, the custom putty command-line is reset by design (hard-coded in the WinSCPPortable launcher). I don't know it it is feasable with this launcher to have different settings, or to keep a default setting to PuTTYPortableLinker in case someone messes with that setting. Opening it up to free user setting may break PuTTY Portable if not used correctly.

John T. Haller
John T. Haller's picture
Online
Last seen: 40 min 23 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Passing Method

I wasn't worried about KiTTY due to the way it's called. WinSCP only talks about PuTTY in its GUI and the default method is via registry for both PuTTY and KiTTY. According to impbob, the registry isn't written to when the options are passed on the command line. I'll double check to confirm in a clean VM and come up with an implementation in WinSCP Portable. I'm thinking that it detects PuTTY Portable and configures the special linker. If it doesn't detect PuTTY Portable, it looks for KiTTY Portable and implements the recommended command line. If it detects neither, it'll do nothing. I may add an INI option to specifically select it as well.

Sometimes, the impossible can become possible, if you're awesome!

impbob
Offline
Last seen: 3 years 8 months ago
Joined: 2018-05-30 20:32
Thank you

Thank you for looking into this. It's kind of annoying changing the value every time I open the app but it really is just a "wishlist" request. It's usually these "simple" little things to make my day so much nicer.

If there is anything else I can do to help, please let me know. I do really appreciate your time and efforts.

John T. Haller
John T. Haller's picture
Online
Last seen: 40 min 23 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Fixed in 15.3.3

With today's release, the launcher will now first look for PuTTY Portable and automatically configure that. If not found, it will look for KiTTY Portable and automatically configure that. If not found, it will leave the settings alone so the user can manually select an alternative client.

So, if you have WinSCP Portable and KiTTY Portable installed, it will configure itself automatically now.

Sometimes, the impossible can become possible, if you're awesome!

depp.jones
Offline
Last seen: 1 day 16 hours ago
DeveloperTranslator
Joined: 2010-06-05 17:19
Great news

I'll check immediately to learn, how that is done. Wink

impbob
Offline
Last seen: 3 years 8 months ago
Joined: 2018-05-30 20:32
Thanks for the update ... At

Thanks for the update ... At first, it wouldn't work for me, it kept asking me to open Putty. Then I realized i still had the PuttyPortable folder in the directory. d'oh!

Once I removed Putty, it automatically opened KittyPortable, which was my initial request.

Thank you very much for taking the time to make the adjustments. I'm sure there are others out there that can / will also benefit.

Log in or register to post comments