2019-09-19 06:19:25 +00:00
#define MyAppName "SFTPGo"
2020-06-28 13:57:33 +00:00
#if GetEnv("SFTPGO_ISS_VERSION") != ""
#define MyAppVersion GetEnv("SFTPGO_ISS_VERSION")
#else
2021-10-23 17:27:39 +00:00
#define MyAppVersion GetEnv("SFTPGO_ISS_DEV_VERSION")
2020-06-28 13:57:33 +00:00
#endif
2021-11-28 17:56:30 +00:00
#if GetEnv("SFTPGO_ISS_ARCH") != ""
#define MyAppArch GetEnv("SFTPGO_ISS_ARCH")
#define MySetupName "sftpgo_windows_" + MyAppArch
2021-11-28 20:30:31 +00:00
#if MyAppArch == "x86"
#define MyAppArch64 ""
#else
#define MyAppArch64 GetEnv("SFTPGO_ISS_ARCH")
#endif
2021-11-28 17:56:30 +00:00
#else
#define MyAppArch "x64"
2021-11-28 20:30:31 +00:00
#define MyAppArch64 "x64"
2021-11-28 17:56:30 +00:00
#define MySetupName "sftpgo_windows_x86_64"
#endif
2019-09-19 06:19:25 +00:00
#define MyAppURL "https://github.com/drakkan/sftpgo"
2020-06-28 13:57:33 +00:00
#define MyVersionInfo StringChange(MyAppVersion,"v","")
#if GetEnv("SFTPGO_ISS_DOC_URL") != ""
#define DocURL GetEnv("SFTPGO_ISS_DOC_URL")
#else
2021-02-09 18:53:03 +00:00
#define DocURL "https://github.com/drakkan/sftpgo/blob/main/README.md"
2020-06-28 13:57:33 +00:00
#endif
2019-09-19 06:19:25 +00:00
#define MyAppExeName "sftpgo.exe"
2020-06-28 13:57:33 +00:00
#define MyAppDir "..\output"
#define MyOutputDir ".."
2019-09-19 06:19:25 +00:00
[Setup]
AppId={{1FB9D57F-00DD-4B1B-8798-1138E5CE995D}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
2020-06-29 12:55:58 +00:00
AppVerName={#MyAppName} {#MyAppVersion}
2021-11-28 17:56:30 +00:00
AppPublisher=Nicola Murino
2019-09-19 06:19:25 +00:00
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
2021-10-23 17:27:39 +00:00
AppCopyright=AGPL-3.0
2019-09-19 06:19:25 +00:00
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
2019-10-07 20:37:28 +00:00
LicenseFile={#MyAppDir}\LICENSE.txt
OutputDir={#MyOutputDir}
2021-11-28 17:56:30 +00:00
OutputBaseFilename={#MySetupName}
2021-10-23 17:27:39 +00:00
SetupIconFile=icon.ico
2019-09-19 06:19:25 +00:00
SolidCompression=yes
2021-10-23 17:27:39 +00:00
UninstallDisplayIcon={app}\sftpgo.exe
2019-09-19 06:19:25 +00:00
WizardStyle=modern
2021-11-28 20:30:31 +00:00
ArchitecturesInstallIn64BitMode={#MyAppArch64}
2019-09-19 06:19:25 +00:00
PrivilegesRequired=admin
2021-11-28 17:56:30 +00:00
ArchitecturesAllowed={#MyAppArch}
2024-05-30 16:07:17 +00:00
MinVersion=10.0.14393
2020-06-28 13:57:33 +00:00
VersionInfoVersion={#MyVersionInfo}
2021-10-23 17:27:39 +00:00
VersionInfoCopyright=AGPL-3.0
2021-11-19 21:44:50 +00:00
SignTool=signtool
SignedUninstaller=yes
2019-09-19 06:19:25 +00:00
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
2021-11-19 21:44:50 +00:00
Source: "{#MyAppDir}\sftpgo.exe"; DestDir: "{app}"; Flags: ignoreversion signonce
2020-03-03 21:31:13 +00:00
Source: "{#MyAppDir}\sftpgo.db"; DestDir: "{commonappdata}\{#MyAppName}"; Flags: onlyifdoesntexist uninsneveruninstall
2019-10-07 20:37:28 +00:00
Source: "{#MyAppDir}\LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion
2020-03-03 21:31:13 +00:00
Source: "{#MyAppDir}\sftpgo.json"; DestDir: "{commonappdata}\{#MyAppName}"; Flags: onlyifdoesntexist uninsneveruninstall
2021-12-05 06:58:53 +00:00
Source: "{#MyAppDir}\sftpgo.json"; DestDir: "{commonappdata}\{#MyAppName}"; DestName: "sftpgo_default.json"; Flags: ignoreversion
2020-03-03 21:31:13 +00:00
Source: "{#MyAppDir}\templates\*"; DestDir: "{commonappdata}\{#MyAppName}\templates"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#MyAppDir}\static\*"; DestDir: "{commonappdata}\{#MyAppName}\static"; Flags: ignoreversion recursesubdirs createallsubdirs
2021-11-21 08:32:51 +00:00
Source: "{#MyAppDir}\openapi\*"; DestDir: "{commonappdata}\{#MyAppName}\openapi"; Flags: ignoreversion recursesubdirs createallsubdirs
2021-11-29 16:58:10 +00:00
Source: "README.txt"; DestDir: "{app}"; Flags: ignoreversion isreadme
2019-09-19 06:19:25 +00:00
[Dirs]
2020-03-03 21:31:13 +00:00
Name: "{commonappdata}\{#MyAppName}\logs"; Permissions: everyone-full
Name: "{commonappdata}\{#MyAppName}\backups"; Permissions: everyone-full
2022-10-13 16:43:58 +00:00
Name: "{commonappdata}\{#MyAppName}\env.d"; Permissions: everyone-full
2022-05-27 05:39:55 +00:00
Name: "{commonappdata}\{#MyAppName}\certs"; Permissions: everyone-full
2019-09-19 06:19:25 +00:00
[Icons]
2021-11-29 16:58:10 +00:00
Name: "{group}\Web Admin"; Filename: "http://localhost:8080/web/admin";
Name: "{group}\Web Client"; Filename: "http://localhost:8080/web/client";
Name: "{group}\OpenAPI"; Filename: "http://localhost:8080/openapi";
2020-06-29 12:55:58 +00:00
Name: "{group}\Service Control"; WorkingDir: "{app}"; Filename: "powershell.exe"; Parameters: "-Command ""Start-Process cmd \""/k cd {app} & {#MyAppExeName} service --help\"" -Verb RunAs"; Comment: "Manage SFTPGo Service"
2020-06-28 13:57:33 +00:00
Name: "{group}\Documentation"; Filename: "{#DocURL}";
2019-09-19 06:19:25 +00:00
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
[Run]
Filename: "netsh"; Parameters: "advfirewall firewall delete rule name=""SFTPGo Service"""; Flags: runhidden
Filename: "netsh"; Parameters: "advfirewall firewall add rule name=""SFTPGo Service"" dir=in action=allow program=""{app}\{#MyAppExeName}"""; Flags: runhidden
2020-03-07 17:06:46 +00:00
Filename: "{app}\{#MyAppExeName}"; Parameters: "service stop"; Flags: runhidden
Filename: "{app}\{#MyAppExeName}"; Parameters: "service uninstall"; Flags: runhidden
2020-03-04 08:27:14 +00:00
Filename: "{app}\{#MyAppExeName}"; Parameters: "service install -c ""{commonappdata}\{#MyAppName}"" -l ""logs\sftpgo.log"""; Description: "Install SFTPGo Windows Service"; Flags: runhidden
2019-09-19 06:19:25 +00:00
Filename: "{app}\{#MyAppExeName}"; Parameters: "service start"; Description: "Start SFTPGo Windows Service"; Flags: runhidden
[UninstallRun]
2021-10-23 17:27:39 +00:00
Filename: "{app}\{#MyAppExeName}"; Parameters: "service stop"; Flags: runhidden; RunOnceId: "Stop SFTPGo service"
Filename: "{app}\{#MyAppExeName}"; Parameters: "service uninstall"; Flags: runhidden; RunOnceId: "Uninstall SFTPGo service"
2021-11-29 16:58:10 +00:00
Filename: "netsh"; Parameters: "advfirewall firewall delete rule name=""SFTPGo Service"""; Flags: runhidden; RunOnceId: "Remove SFTPGo firewall rule"
[Messages]
2023-06-29 09:23:04 +00:00
FinishedLabel=Setup has finished installing SFTPGo on your computer. SFTPGo should already be running as a Windows service, it uses TCP port 8080 for HTTP service and TCP port 2022 for SFTP service by default, make sure the configured ports are not used by other services or edit the configuration according to your needs.
[Code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
Code: Integer;
begin
if (FileExists(ExpandConstant('{app}\{#MyAppExeName}'))) then
begin
Exec(ExpandConstant('{app}\{#MyAppExeName}'), 'service stop', '', SW_HIDE, ewWaitUntilTerminated, Code);
end
end;