Differences

This shows you the differences between the selected revisions of the page.

2005-05-13 2005-05-13
no summary (martin) complete (martin)
Line 1: Line 1:
-~~NOCACHE~~ 
====== Custom Distribution ====== ====== Custom Distribution ======
This chapter includes hints for thos who want to prepare custom distribution This chapter includes hints for thos who want to prepare custom distribution
Line 8: Line 7:
===== Creating Custom Installer ===== ===== Creating Custom Installer =====
 +WinSCP uses [[&url(innosetup)|Inno Setup]] as installer. The most simple InnoSetup script for WinSCP may look like the one below. For full WinSCP install script see file ''release/winscpsetup.iss'' in the source code.
<code iss> <code iss>
-Setup 
- 
[Setup] [Setup]
; Name of the application ; Name of the application
AppName=WinSCP3 (provided by Some Company) AppName=WinSCP3 (provided by Some Company)
-; not to allow installation while WinSCP is running +; Name of the application including version 
-AppMutex=WinSCP+AppVerName=WinSCP 3.7.5
; Installation directory (can be changed by user) ; Installation directory (can be changed by user)
DefaultDirName={pf}\WinSCP3 DefaultDirName={pf}\WinSCP3
; Start menu group name ; Start menu group name
DefaultGroupName=WinSCP3 (provided by Some Company) DefaultGroupName=WinSCP3 (provided by Some Company)
-; Name of the application including version +; Not to allow installation while WinSCP is running 
-AppVerName=WinSCP 3.7.5+AppMutex=WinSCP
[Files] [Files]
Line 47: Line 45:
  ValueName: "Interface"; ValueData: 1   ValueName: "Interface"; ValueData: 1
; Enable using of drag&drop shell extension ; Enable using of drag&drop shell extension
 +; (and make sure it is disabled again when the extension is uninstalled)
Root: HKCU; SubKey: "{#RegistryKey}\Configuration\Interface"; ValueType: dword; \ Root: HKCU; SubKey: "{#RegistryKey}\Configuration\Interface"; ValueType: dword; \
  ValueName: "DDExtEnabled"; ValueData: 1; \   ValueName: "DDExtEnabled"; ValueData: 1; \
Line 60: Line 59:
Filename: "{app}\WinSCP3.exe"; Parameters: "/UninstallCleanup"; \ Filename: "{app}\WinSCP3.exe"; Parameters: "/UninstallCleanup"; \
  RunOnceId: "UninstallCleanup"   RunOnceId: "UninstallCleanup"
 +</code>
-; ???? +Save the script into file (e.g. ''winscpsetup.iss''), put files ''WinSCP3.exe'' and ''DragExt.dll'' to the same directory and run InnoSetup compiler:
-[UninstallDelete] +
-Type: files; Name: &quot;{app}\WinSCP3.ini&quot;+
 +<code>
 +iscc winscpsetup.iss
 +</code>
 +
 +===== Preconfigured Session =====
 +You may have the installer pre-configure stored sessions, to make it easier for your users to connect to your server.
 +
 +The easiest way is to configure the session using GUI and then check the [[config|configuration storage]] to see how WinSCP stored the session settings. Then add corresponding lines to the installer scripts.
 +
 +Simple example of ''Server'' session configuration, including hostname and username only, is shown below. You can also use hidden option ''Special'' to prevent user from accidentally deleting or modifing the session. Such session will also be highlighted in session list.
 +
 +<code iss>
 +[Registry]
 +#define RegistryKey "Software\Martin Prikryl\WinSCP 2"
 +; Configure hostname/username
 +Root: HKCU; SubKey: "{#RegistryKey}\Sessions\Server"; ValueType: string; \
 +  ValueName: "HostName"; ValueData: "example.com"
 +Root: HKCU; SubKey: "{#RegistryKey}\Sessions\Server"; ValueType: string; \
 +  ValueName: "UserName"; ValueData: "customer"
 +; Prevent user from accidentally deleting or modifing the session
 +Root: HKCU; SubKey: "{#RegistryKey}\Sessions\Server"; ValueType: dword; \
 +  ValueName: "Special"; ValueData: 1
</code> </code>
===== Using INI File as Configuration Storage ===== ===== Using INI File as Configuration Storage =====
-Read [[config|documentation]]. 
-===== Setting Up Autologin =====+Instead of modifing the registry from install script your can make the installer create [[config|configuration INI file]].  
 + 
 +You can also have the installer install the embeded INI file, like: 
 + 
 +<code ini> 
 +[Configuration\Interface] 
 +Interface=1 
 + 
 +[Sessions\Server] 
 +HostName=example.com 
 +</code> 
 + 
 +===== Embedded Settings ===== 
 + 
 +As alternative to own installer you can directly embed session settings to WinSCP executable. 
 + 
 +You can do it by inserting INI file with session settings to ''RCData'' resource named "WINSCP_SESSION".  
 + 
 +<code ini> 
 +[Sessions\Server] 
 +HostName=example.com 
 +</code>
-  * Using INI file as [[config|configuration storage]]. +When WinSCP finds such resource it loads the session list from it instead of [[config|configure storage]]. In addition it automatically starts the first session in the list, unless overriden by specifing name of another session on [[commandline|command line]]. Note that general configuration options will be ignored, when present in the INI file.
-  * Setting up autologin. +
-  * Using embedded settings (that cannot be overridden).+
 +You can also embed private key to be used for authentication to ''RCData'' resource named "WINSCP_KEY". WinSCP will automatically try to use it.
 +To embed ''RCData' resource you can use any resource editor, for example [[http://www.users.on.net/johnson/resourcehacker/|Resource Hacker]].

Last modified: by martin