2016-12-15 06:32:21 +13:00
#define MyAppName "ShareX"
#define MyAppRootDirectory "..\.."
2017-04-23 08:49:45 +12:00
#define MyAppOutputDirectory MyAppRootDirectory + "\Output"
2021-12-28 04:57:32 +13:00
#define MyAppReleaseDirectory MyAppRootDirectory + "\" + MyAppName + "\bin\Release"
#define MyAppFileName MyAppName + ".exe"
#define MyAppFilePath MyAppReleaseDirectory + "\" + MyAppFileName
2023-01-16 13:23:40 +13:00
#define MyAppVersion GetStringFileInfo(MyAppFilePath, "ProductVersion")
2016-12-15 06:32:21 +13:00
#define MyAppPublisher "ShareX Team"
2021-12-28 04:57:32 +13:00
#define MyAppURL "https://getsharex.com"
2016-12-15 06:32:21 +13:00
#define MyAppId "82E6AC09-0FEF-4390-AD9F-0DD3F5561EFC"
2013-11-03 23:53:49 +13:00
[Setup]
2024-01-03 12:57:14 +13:00
AppCopyright=Copyright (c) 2007-2024 ShareX Team
2016-12-15 06:32:21 +13:00
AppId={#MyAppId}
AppMutex={#MyAppId}
AppName={#MyAppName}
AppPublisher={#MyAppPublisher}
2021-12-28 04:57:32 +13:00
AppPublisherURL={#MyAppURL}
2016-12-15 06:32:21 +13:00
AppVerName={#MyAppName} {#MyAppVersion}
AppVersion={#MyAppVersion}
2021-12-28 04:57:32 +13:00
ArchitecturesAllowed=x86 x64 arm64 ia64
2013-11-03 23:53:49 +13:00
ArchitecturesInstallIn64BitMode=x64 ia64
2021-08-14 22:24:27 +12:00
DefaultDirName={commonpf}\{#MyAppName}
2016-12-15 06:32:21 +13:00
DefaultGroupName={#MyAppName}
2015-07-06 20:08:42 +12:00
DisableProgramGroupPage=yes
2016-12-15 06:32:21 +13:00
LicenseFile={#MyAppRootDirectory}\LICENSE.txt
2021-08-14 22:24:27 +12:00
MinVersion=6.1sp1
2016-12-15 06:32:21 +13:00
OutputBaseFilename={#MyAppName}-{#MyAppVersion}-setup
2017-04-23 08:49:45 +12:00
OutputDir={#MyAppOutputDirectory}
2020-07-06 11:23:59 +12:00
PrivilegesRequired=none
2021-12-28 04:57:32 +13:00
SolidCompression=yes
UninstallDisplayIcon={app}\{#MyAppFileName}
2016-12-15 06:32:21 +13:00
UninstallDisplayName={#MyAppName}
VersionInfoCompany={#MyAppPublisher}
VersionInfoTextVersion={#MyAppVersion}
VersionInfoVersion={#MyAppVersion}
2013-11-03 23:53:49 +13:00
[Tasks]
2018-04-24 12:46:45 +12:00
Name: "CreateDesktopIcon"; Description: "Create a desktop shortcut"; GroupDescription: "Additional shortcuts:"; Check: not IsUpdating and not DesktopIconExists
Name: "CreateContextMenuButton"; Description: "Show ""Upload with ShareX"" button in Windows Explorer context menu"; GroupDescription: "Additional shortcuts:"; Check: not IsUpdating
Name: "CreateSendToIcon"; Description: "Create a send to shortcut"; GroupDescription: "Additional shortcuts:"; Check: not IsUpdating
Name: "CreateStartupIcon"; Description: "Run ShareX when Windows starts"; GroupDescription: "Other tasks:"; Check: not IsUpdating
2013-11-03 23:53:49 +13:00
[Files]
2021-12-28 04:57:32 +13:00
Source: "{#MyAppFilePath}"; DestDir: {app}; Flags: ignoreversion
Source: "{#MyAppFilePath}.config"; DestDir: {app}; Flags: ignoreversion
2016-12-15 06:32:21 +13:00
Source: "{#MyAppReleaseDirectory}\*.dll"; DestDir: {app}; Flags: ignoreversion
Source: "{#MyAppRootDirectory}\Licenses\*.txt"; DestDir: {app}\Licenses; Flags: ignoreversion
2017-04-23 08:49:45 +12:00
Source: "{#MyAppOutputDirectory}\Recorder-devices-setup.exe"; DestDir: {app}; Flags: ignoreversion
2022-09-11 16:42:39 +12:00
Source: "{#MyAppOutputDirectory}\ffmpeg.exe"; DestDir: {app}; Flags: ignoreversion
2023-10-23 22:44:49 +13:00
Source: "{#MyAppReleaseDirectory}\ShareX_NativeMessagingHost.exe"; DestDir: {app}; Flags: ignoreversion
2016-12-15 06:32:21 +13:00
Source: "{#MyAppReleaseDirectory}\de\*.resources.dll"; DestDir: {app}\Languages\de; Flags: ignoreversion
Source: "{#MyAppReleaseDirectory}\es\*.resources.dll"; DestDir: {app}\Languages\es; Flags: ignoreversion
2018-08-07 22:38:35 +12:00
Source: "{#MyAppReleaseDirectory}\es-MX\*.resources.dll"; DestDir: {app}\Languages\es-MX; Flags: ignoreversion
2019-08-30 22:59:52 +12:00
Source: "{#MyAppReleaseDirectory}\fa-IR\*.resources.dll"; DestDir: {app}\Languages\fa-IR; Flags: ignoreversion
2019-08-31 22:02:03 +12:00
Source: "{#MyAppReleaseDirectory}\fr\*.resources.dll"; DestDir: {app}\Languages\fr; Flags: ignoreversion
2023-03-27 18:37:57 +13:00
Source: "{#MyAppReleaseDirectory}\he-IL\*.resources.dll"; DestDir: {app}\Languages\he-IL; Flags: ignoreversion
2016-12-15 06:32:21 +13:00
Source: "{#MyAppReleaseDirectory}\hu\*.resources.dll"; DestDir: {app}\Languages\hu; Flags: ignoreversion
2018-04-30 21:03:13 +12:00
Source: "{#MyAppReleaseDirectory}\id-ID\*.resources.dll"; DestDir: {app}\Languages\id-ID; Flags: ignoreversion
2017-08-07 09:09:47 +12:00
Source: "{#MyAppReleaseDirectory}\it-IT\*.resources.dll"; DestDir: {app}\Languages\it-IT; Flags: ignoreversion
2020-10-14 04:41:45 +13:00
Source: "{#MyAppReleaseDirectory}\ja-JP\*.resources.dll"; DestDir: {app}\Languages\ja-JP; Flags: ignoreversion
2016-12-15 06:32:21 +13:00
Source: "{#MyAppReleaseDirectory}\ko-KR\*.resources.dll"; DestDir: {app}\Languages\ko-KR; Flags: ignoreversion
Source: "{#MyAppReleaseDirectory}\nl-NL\*.resources.dll"; DestDir: {app}\Languages\nl-NL; Flags: ignoreversion
2022-07-10 18:54:38 +12:00
Source: "{#MyAppReleaseDirectory}\pl\*.resources.dll"; DestDir: {app}\Languages\pl; Flags: ignoreversion
2016-12-15 06:32:21 +13:00
Source: "{#MyAppReleaseDirectory}\pt-BR\*.resources.dll"; DestDir: {app}\Languages\pt-BR; Flags: ignoreversion
2020-05-08 23:28:02 +12:00
Source: "{#MyAppReleaseDirectory}\pt-PT\*.resources.dll"; DestDir: {app}\Languages\pt-PT; Flags: ignoreversion
2022-06-30 00:01:25 +12:00
Source: "{#MyAppReleaseDirectory}\ro\*.resources.dll"; DestDir: {app}\Languages\ro; Flags: ignoreversion
2016-12-15 06:32:21 +13:00
Source: "{#MyAppReleaseDirectory}\ru\*.resources.dll"; DestDir: {app}\Languages\ru; Flags: ignoreversion
Source: "{#MyAppReleaseDirectory}\tr\*.resources.dll"; DestDir: {app}\Languages\tr; Flags: ignoreversion
2018-04-30 21:03:13 +12:00
Source: "{#MyAppReleaseDirectory}\uk\*.resources.dll"; DestDir: {app}\Languages\uk; Flags: ignoreversion
2016-12-15 06:32:21 +13:00
Source: "{#MyAppReleaseDirectory}\vi-VN\*.resources.dll"; DestDir: {app}\Languages\vi-VN; Flags: ignoreversion
Source: "{#MyAppReleaseDirectory}\zh-CN\*.resources.dll"; DestDir: {app}\Languages\zh-CN; Flags: ignoreversion
2017-04-13 08:55:39 +12:00
Source: "{#MyAppReleaseDirectory}\zh-TW\*.resources.dll"; DestDir: {app}\Languages\zh-TW; Flags: ignoreversion
2018-03-17 08:58:25 +13:00
Source: "{#MyAppRootDirectory}\ShareX.ScreenCaptureLib\Stickers\*"; DestDir: {app}\Stickers; Flags: ignoreversion recursesubdirs
2016-06-20 19:32:39 +12:00
Source: "puush"; DestDir: {app}; Check: IsPuushMode
2014-10-05 01:55:18 +13:00
2013-11-03 23:53:49 +13:00
[Icons]
2021-12-28 04:57:32 +13:00
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppFileName}"; WorkingDir: "{app}"
2016-12-15 06:32:21 +13:00
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; WorkingDir: "{app}"
2021-12-28 04:57:32 +13:00
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppFileName}"; WorkingDir: "{app}"; Tasks: CreateDesktopIcon
Name: "{usersendto}\{#MyAppName}"; Filename: "{app}\{#MyAppFileName}"; WorkingDir: "{app}"; Tasks: CreateSendToIcon
Name: "{userstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppFileName}"; WorkingDir: "{app}"; Parameters: "-silent"; Tasks: CreateStartupIcon
2013-11-03 23:53:49 +13:00
[Run]
2021-12-28 04:57:32 +13:00
Filename: "{app}\{#MyAppFileName}"; Description: "{cm:LaunchProgram,{#MyAppName}}"; Flags: nowait postinstall; Check: not IsNoRun
2013-11-03 23:53:49 +13:00
[Registry]
2016-12-15 06:32:21 +13:00
Root: "HKCU"; Subkey: "Software\Classes\*\shell\{#MyAppName}"; ValueType: string; ValueData: "Upload with {#MyAppName}"; Tasks: CreateContextMenuButton
2021-12-28 04:57:32 +13:00
Root: "HKCU"; Subkey: "Software\Classes\*\shell\{#MyAppName}"; ValueType: string; ValueName: "Icon"; ValueData: """{app}\{#MyAppFileName}"",0"; Tasks: CreateContextMenuButton
Root: "HKCU"; Subkey: "Software\Classes\*\shell\{#MyAppName}\command"; ValueType: string; ValueData: """{app}\{#MyAppFileName}"" ""%1"""; Tasks: CreateContextMenuButton
2016-12-15 06:32:21 +13:00
Root: "HKCU"; Subkey: "Software\Classes\Directory\shell\{#MyAppName}"; ValueType: string; ValueData: "Upload with {#MyAppName}"; Tasks: CreateContextMenuButton
2021-12-28 04:57:32 +13:00
Root: "HKCU"; Subkey: "Software\Classes\Directory\shell\{#MyAppName}"; ValueType: string; ValueName: "Icon"; ValueData: """{app}\{#MyAppFileName}"",0"; Tasks: CreateContextMenuButton
Root: "HKCU"; Subkey: "Software\Classes\Directory\shell\{#MyAppName}\command"; ValueType: string; ValueData: """{app}\{#MyAppFileName}"" ""%1"""; Tasks: CreateContextMenuButton
2016-12-15 06:32:21 +13:00
Root: "HKCU"; Subkey: "Software\Classes\*\shell\{#MyAppName}"; Flags: dontcreatekey uninsdeletekey
Root: "HKCU"; Subkey: "Software\Classes\Directory\shell\{#MyAppName}"; Flags: dontcreatekey uninsdeletekey
2017-01-14 08:09:38 +13:00
Root: "HKCU"; Subkey: "Software\Classes\.sxcu"; Flags: dontcreatekey uninsdeletekey
Root: "HKCU"; Subkey: "Software\Classes\ShareX.sxcu"; Flags: dontcreatekey uninsdeletekey
2020-07-06 10:37:56 +12:00
Root: "HKCU"; Subkey: "Software\Classes\.sxie"; Flags: dontcreatekey uninsdeletekey
Root: "HKCU"; Subkey: "Software\Classes\ShareX.sxie"; Flags: dontcreatekey uninsdeletekey
2018-04-25 22:47:03 +12:00
Root: "HKCU"; Subkey: "Software\Classes\SystemFileAssociations\image\shell\ShareXImageEditor"; Flags: dontcreatekey uninsdeletekey
2013-11-03 23:53:49 +13:00
2021-08-17 20:05:34 +12:00
#include "CodeDependencies.iss"
2018-03-01 04:29:25 +13:00
[Code]
2024-01-22 13:38:49 +13:00
function IsAdmin: Boolean;
2021-08-17 20:05:34 +12:00
begin
2024-01-22 12:13:23 +13:00
Result := (IsAdminLoggedOn or IsPowerUserLoggedOn);
end;
2024-01-22 13:38:49 +13:00
procedure InitializeWizard;
2024-01-22 12:13:23 +13:00
begin
2024-01-22 13:38:49 +13:00
if not IsAdmin then
begin
WizardForm.DirEdit.Text := ExpandConstant('{userpf}\{#MyAppName}');
end;
2024-01-22 12:13:23 +13:00
2021-08-17 20:05:34 +12:00
Dependency_InitializeWizard;
end;
function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
Result := Dependency_PrepareToInstall(NeedsRestart);
end;
function NeedRestart: Boolean;
begin
Result := Dependency_NeedRestart;
end;
function UpdateReadyMemo(const Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
begin
Result := Dependency_UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo);
end;
function InitializeSetup(): Boolean;
begin
Dependency_AddDotNet48;
Result := true;
end;
2021-05-09 07:54:54 +12:00
function InitializeUninstall(): Boolean;
var
ErrorCode: Integer;
begin
2021-05-09 08:18:15 +12:00
if CheckForMutexes('{#MyAppId}') then
2021-05-09 07:54:54 +12:00
begin
2021-05-09 08:24:32 +12:00
if MsgBox('Uninstall has detected that {#MyAppName} is currently running.' + #13#10#13#10 + 'Would you like to close it?', mbError, MB_YESNO) = IDYES then
2021-05-09 08:18:15 +12:00
begin
2021-12-28 04:57:32 +13:00
Exec('taskkill.exe', '/f /im {#MyAppFileName}', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
2021-05-09 08:18:15 +12:00
end
else
begin
Result := False;
Exit;
end;
2021-05-09 07:54:54 +12:00
end;
Result := True;
end;
2016-06-20 19:32:39 +12:00
function CmdLineParamExists(const value: string): Boolean;
var
i: Integer;
begin
Result := False;
for i := 1 to ParamCount do
if CompareText(ParamStr(i), value) = 0 then
begin
Result := True;
Exit;
end;
end;
2018-04-24 12:55:35 +12:00
function IsUpdating(): Boolean;
2018-03-12 01:12:37 +13:00
begin
2018-04-24 12:55:35 +12:00
Result := CmdLineParamExists('/UPDATE');
2018-03-12 01:12:37 +13:00
end;
2018-04-24 12:55:35 +12:00
function IsNoRun(): Boolean;
2018-03-26 09:36:15 +13:00
begin
2018-04-24 12:55:35 +12:00
Result := CmdLineParamExists('/NORUN');
2018-03-26 09:36:15 +13:00
end;
2018-04-24 12:55:35 +12:00
function IsPuushMode(): Boolean;
2018-03-26 09:36:15 +13:00
begin
2018-04-24 12:46:45 +12:00
Result := CmdLineParamExists('-puush');
2018-04-23 09:39:23 +12:00
end;
2018-04-24 12:46:45 +12:00
function DesktopIconExists(): Boolean;
2018-04-23 09:39:23 +12:00
begin
2018-04-24 12:46:45 +12:00
Result := FileExists(ExpandConstant('{userdesktop}\{#MyAppName}.lnk'));
2020-04-23 00:26:04 +12:00
end;