Topic "Where is the session information kept"

Author Message
Guest

Guest


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?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
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.
_________________
Martin Prikryl
bfranz
[View user's profile]

Joined: 2003-09-12
Posts: 1
Location: Hannover Germany
prikryl 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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
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.
Albert

Guest


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

prikryl 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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
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.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License