Where is the session information kept

Advertisement

Guest
Guest

Where is the session information kept

Where is the session information kept and can I pre-configure WinSCP and send it to my clients in such a way that they only have to fill in the password?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Where is the session information kept

WinSCP stores configuration either to Windows registry (HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2) or to INI file (winscp3.ini). You may setup all you need, switch to INI file (from preferences dialog) and distribute the INI file with the application.
WinSCP has also hidden feature that enables you to store all settings into EXE file (it cannot be changed by user). If you would like more information about this, let me know.

Reply with quote

bfranz
Joined:
Posts:
1
Location:
Hannover Germany

Re: Where is the session information kept

martin wrote:

WinSCP stores configuration either to Windows registry (HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2) or to INI file (winscp3.ini). You may setup all you need, switch to INI file (from preferences dialog) and distribute the INI file with the application.
WinSCP has also hidden feature that enables you to store all settings into EXE file (it cannot be changed by user). If you would like more information about this, let me know.

Hello Martin

I would like to know how to store the configuration into the exe file

Thank you very much for your kind help

bfranz

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Where is the session information kept

bfranz wrote:

I would like to know how to store the configuration into the exe file

The solution that WinSCP supports is not perfect. So it may not satisfy your needs, but just in case:

You may embed session settings and key as custom resource (RCData) of executable file. These resources can be changed directly in binary EXE file.

When you start WinSCP, it first checks whether EXE file contains a RCData resource named WINSCP_SESSION. If it does not find the resource, it works as usually. Otherwise, it treats this resource as a content of INI file with session configuration. When WinSCP is started with no parameter it uses first session, otherwise first parameter is considered to be a session name.
Using selected session it starts with connection (supposing, that the session configuration has all required information, otherwise login dialog is shown). When session has no associated key file and WinSCP finds resource named WINSCP_KEY, it uses the key stored in the resource.

How to create session INI file: Create session in WinSCP GUI and save configuration to INI file instead of registry (see preferences dialog). In created INI file (in same directory where EXE file is) find group of the session named [Sessions\session name]. Extract this group to separate INI file.

You cannot embed general configuration options! If you do they will be ignored.

To create key file to embed, use puttygen tool from Putty package (link is on WinSCP site).

To embed INI file and key file to EXE file, use any resource editor you want (there are plenty of them on internet). I've used ResHacker available at: http://www.angusj.com/resourcehacker/
It is a freeware. This tool has GUI, but it can also be used from command-line.

Reply with quote

Albert
Guest

Re: Where is the session information kept

Hi, I try to add the session into using reshacker but it generate an invalide executable. I also try to view the exisitng RCData but it tells me that this file has a non-standard resource layout.... it has probably been compressed with an "EXE compressor". I can view other resource data such as Incon Group->MAINICON. Any ideas?

Thanks very much in advance.
Albert

martin wrote:

bfranz wrote:

I would like to know how to store the configuration into the exe file

The solution that WinSCP supports is not perfect. So it may not satisfy your needs, but just in case:

You may embed session settings and key as custom resource (RCData) of executable file. These resources can be changed directly in binary EXE file.

When you start WinSCP, it first checks whether EXE file contains a RCData resource named WINSCP_SESSION. If it does not find the resource, it works as usually. Otherwise, it treats this resource as a content of INI file with session configuration. When WinSCP is started with no parameter it uses first session, otherwise first parameter is considered to be a session name.
Using selected session it starts with connection (supposing, that the session configuration has all required information, otherwise login dialog is shown). When session has no associated key file and WinSCP finds resource named WINSCP_KEY, it uses the key stored in the resource.

How to create session INI file: Create session in WinSCP GUI and save configuration to INI file instead of registry (see preferences dialog). In created INI file (in same directory where EXE file is) find group of the session named [Sessions\session name]. Extract this group to separate INI file.

You cannot embed general configuration options! If you do they will be ignored.

To create key file to embed, use puttygen tool from Putty package (link is on WinSCP site).

To embed INI file and key file to EXE file, use any resource editor you want (there are plenty of them on internet). I've used ResHacker available at: http://www.angusj.com/resourcehacker/
It is a freeware. This tool has GUI, but it can also be used from command-line.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Where is the session information kept

Albert wrote:

Hi, I try to add the session into using reshacker but it generate an invalide executable. I also try to view the exisitng RCData but it tells me that this file has a non-standard resource layout.... it has probably been compressed with an "EXE compressor". I can view other resource data such as Incon Group->MAINICON. Any ideas?
Use EXE file from the installation package, which is not compressed.

Reply with quote

Advertisement

You can post new topics in this forum