Post a reply :: Support Forum

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Username
Subject
Message body
Options

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.


(max 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)
Options
 

Topic review

Author Message
martin
russds wrote:
But that didn't work out, when I run the winscp.exe I don't see any session information. I believe because when I run the installer, I have to run it as an administrator so the registry keys are created under the Administrator account, when I run the software I'm running as a regular user, so I'm not seeing the session information in the registry keys.

That's true, if you are actually using a different administrator account for installation. But typically, you use the same account, just with elevated privileges.

Quote:
So my next attempt was using an .INI file like:

WinSCP2.ini

Why are you using WinSCP2.ini? The INI file has to have the same (base) name as the executable, i.e. WinSCP.ini.
Also make sure you store the INI file to a writable-location [unless you really want to read-only]. I.e. to user profile folder. But with that you'll have the same problem as with registry path, if you are really using a different administrator account.
See https://winscp.net/eng/docs/config#ini
russds
Hello, I've read through the documentation, and got everything working, except I can't seem to get my session information into the .iss file, and into my Installer. Ultimately I would like hostname: xyz.com, username: %username%.

I tried doing it via the [Registry] section like:

Code:
[Registry]
#define RegistryKey "Software\Martin Prikryl\WinSCP 2"
; Configure hostname/username
Root: HKCU; SubKey: "{#RegistryKey}\Sessions\Server"; ValueType: string; \
  ValueName: "HostName"; ValueData: "xyz.com"
Root: HKCU; SubKey: "{#RegistryKey}\Sessions\Server"; ValueType: string; \
  ValueName: "UserName"; ValueData: %username%
; Prevent user from accidentally deleting or modifing the session
Root: HKCU; SubKey: "{#RegistryKey}\Sessions\Server"; ValueType: dword; \
  ValueName: "Special"; ValueData: 1


But that didn't work out, when I run the winscp.exe I don't see any session information. I believe because when I run the installer, I have to run it as an administrator so the registry keys are created under the Administrator account, when I run the software I'm running as a regular user, so I'm not seeing the session information in the registry keys.

So my next attempt was using an .INI file like:

WinSCP2.ini

Code:
[Configuration\Interface]
Interface=1
 
[Sessions\Server]
HostName=xyz.com
UserName=%username%
Special=1


But I can't figure out a way to tell the *.iss file to use this WinSCP2.ini file. I looked at the documentation of Inno Installer, under the [INI] command, but seems to indicate that it will create an INI file, not use an INI file that I specify. Any ideas on how I could do this?

Thank you!

Search

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