2014-05-30 08:53:19 +00:00
|
|
|
; Script generated by the Inno Setup Script Wizard.
|
|
|
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
|
|
|
|
|
|
|
#define MyAppShortName "Telegram"
|
2014-09-30 14:11:09 +00:00
|
|
|
#define MyAppName "Telegram Desktop"
|
|
|
|
#define MyAppPublisher "Telegram Messenger LLP"
|
2014-05-30 08:53:19 +00:00
|
|
|
#define MyAppURL "https://tdesktop.com"
|
|
|
|
#define MyAppExeName "Telegram.exe"
|
|
|
|
#define MyAppId "53F49750-6209-4FBF-9CA8-7A333C87D1ED"
|
|
|
|
|
|
|
|
[Setup]
|
|
|
|
; NOTE: The value of AppId uniquely identifies this application.
|
|
|
|
; Do not use the same AppId value in installers for other applications.
|
|
|
|
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
|
|
|
AppId={{{#MyAppId}}
|
|
|
|
AppName={#MyAppName}
|
|
|
|
AppVersion={#MyAppVersion}
|
|
|
|
;AppVerName={#MyAppName} {#MyAppVersion}
|
|
|
|
AppPublisher={#MyAppPublisher}
|
|
|
|
AppPublisherURL={#MyAppURL}
|
|
|
|
AppSupportURL={#MyAppURL}
|
|
|
|
AppUpdatesURL={#MyAppURL}
|
|
|
|
DefaultDirName={userappdata}\{#MyAppName}
|
|
|
|
DefaultGroupName={#MyAppName}
|
|
|
|
AllowNoIcons=yes
|
2014-05-30 09:55:07 +00:00
|
|
|
OutputDir=.\..\Win32\Deploy
|
2015-02-05 14:49:50 +00:00
|
|
|
OutputBaseFilename=tsetup.{#MyAppVersionForExe}
|
2014-11-23 11:20:40 +00:00
|
|
|
SetupIconFile=.\SourceFiles\art\icon256.ico
|
2014-05-30 08:53:19 +00:00
|
|
|
UninstallDisplayIcon={app}\Telegram.exe
|
|
|
|
Compression=lzma
|
|
|
|
SolidCompression=yes
|
|
|
|
DisableStartupPrompt=yes
|
|
|
|
PrivilegesRequired=lowest
|
|
|
|
VersionInfoVersion={#MyAppFullVersion}
|
|
|
|
|
|
|
|
[Languages]
|
|
|
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
|
|
|
|
|
|
|
[Tasks]
|
|
|
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
|
|
|
|
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; OnlyBelowVersion: 0,6.1
|
|
|
|
|
|
|
|
[Files]
|
2014-05-30 09:55:07 +00:00
|
|
|
Source: ".\..\Win32\Deploy\Telegram.exe"; DestDir: "{app}"; Flags: ignoreversion
|
|
|
|
Source: ".\..\Win32\Deploy\Updater.exe"; DestDir: "{app}"; Flags: ignoreversion
|
2014-05-30 08:53:19 +00:00
|
|
|
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
|
|
|
|
|
|
|
[Icons]
|
|
|
|
Name: "{group}\{#MyAppShortName}"; Filename: "{app}\{#MyAppExeName}"
|
|
|
|
Name: "{group}\{cm:UninstallProgram,{#MyAppShortName}}"; Filename: "{uninstallexe}"
|
|
|
|
Name: "{userdesktop}\{#MyAppShortName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
|
|
|
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppShortName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
|
|
|
|
|
|
|
|
[Run]
|
|
|
|
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppShortName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
|
|
|
|
|
|
|
[UninstallDelete]
|
|
|
|
Type: files; Name: "{app}\data"
|
|
|
|
Type: files; Name: "{app}\data_config"
|
|
|
|
Type: files; Name: "{app}\log.txt"
|
|
|
|
Type: filesandordirs; Name: "{app}\DebugLogs"
|
|
|
|
Type: filesandordirs; Name: "{app}\tupdates"
|
|
|
|
Type: filesandordirs; Name: "{app}\tdata"
|
2015-03-02 12:34:16 +00:00
|
|
|
Type: filesandordirs; Name: "{app}\tcache"
|
2014-05-30 08:53:19 +00:00
|
|
|
Type: filesandordirs; Name: "{app}\tdumps"
|
|
|
|
Type: dirifempty; Name: "{app}"
|
|
|
|
Type: files; Name: "{userappdata}\{#MyAppName}\data"
|
|
|
|
Type: files; Name: "{userappdata}\{#MyAppName}\data_config"
|
|
|
|
Type: files; Name: "{userappdata}\{#MyAppName}\log.txt"
|
|
|
|
Type: filesandordirs; Name: "{userappdata}\{#MyAppName}\DebugLogs"
|
|
|
|
Type: filesandordirs; Name: "{userappdata}\{#MyAppName}\tupdates"
|
|
|
|
Type: filesandordirs; Name: "{userappdata}\{#MyAppName}\tdata"
|
2015-03-02 12:34:16 +00:00
|
|
|
Type: filesandordirs; Name: "{userappdata}\{#MyAppName}\tcache"
|
2014-05-30 08:53:19 +00:00
|
|
|
Type: filesandordirs; Name: "{userappdata}\{#MyAppName}\tdumps"
|
|
|
|
Type: dirifempty; Name: "{userappdata}\{#MyAppName}"
|
|
|
|
|
2014-12-20 17:49:18 +00:00
|
|
|
[Languages]
|
|
|
|
Name: "it"; MessagesFile: "compiler:Languages\Italian.isl"
|
|
|
|
Name: "es"; MessagesFile: "compiler:Languages\Spanish.isl"
|
2015-01-02 14:55:24 +00:00
|
|
|
Name: "de"; MessagesFile: "compiler:Languages\German.isl"
|
|
|
|
Name: "nl"; MessagesFile: "compiler:Languages\Dutch.isl"
|
|
|
|
Name: "pt"; MessagesFile: "compiler:Languages\Portuguese.isl"
|
2014-12-20 17:49:18 +00:00
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
[Code]
|
|
|
|
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
|
|
|
|
var ResultCode: Integer;
|
|
|
|
begin
|
|
|
|
if CurUninstallStep = usUninstall then
|
|
|
|
begin
|
|
|
|
ShellExec('', ExpandConstant('{app}\{#MyAppExeName}'), '-cleanup', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
const CSIDL_DESKTOPDIRECTORY = $0010;
|
|
|
|
CSIDL_COMMON_DESKTOPDIRECTORY = $0019;
|
|
|
|
|
|
|
|
procedure CurStepChanged(CurStep: TSetupStep);
|
|
|
|
var ResultCode: Integer;
|
|
|
|
HasOldKey: Boolean;
|
|
|
|
HasNewKey: Boolean;
|
|
|
|
HasOldLnk: Boolean;
|
|
|
|
HasNewLnk: Boolean;
|
|
|
|
UserDesktopLnk: String;
|
|
|
|
CommonDesktopLnk: String;
|
|
|
|
begin
|
|
|
|
if CurStep = ssPostInstall then
|
|
|
|
begin
|
|
|
|
HasNewKey := RegKeyExists(HKEY_CURRENT_USER, 'Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{#MyAppId}}_is1') or RegKeyExists(HKEY_CURRENT_USER, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{{#MyAppId}}_is1');
|
|
|
|
HasOldKey := RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{{#MyAppId}}_is1') or RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{{#MyAppId}}_is1');
|
|
|
|
UserDesktopLnk := ExpandFileName(GetShellFolderByCSIDL(CSIDL_DESKTOPDIRECTORY, False) + '\{#MyAppShortName}.lnk');
|
|
|
|
CommonDesktopLnk := ExpandFileName(GetShellFolderByCSIDL(CSIDL_COMMON_DESKTOPDIRECTORY, False) + '\{#MyAppShortName}.lnk');
|
|
|
|
HasNewLnk := FileExists(UserDesktopLnk);
|
|
|
|
HasOldLnk := FileExists(CommonDesktopLnk) and (UserDesktopLnk <> CommonDesktopLnk);
|
|
|
|
if (HasOldKey and HasNewKey) or (HasOldLnk and HasNewLnk) then
|
|
|
|
begin
|
|
|
|
if (GetWindowsVersion >= $06000000) then // Vista or later
|
|
|
|
ShellExec('runas', ExpandConstant('{app}\{#MyAppExeName}'), '-fixprevious', '', SW_SHOW, ewWaitUntilTerminated, ResultCode)
|
|
|
|
else
|
|
|
|
ShellExec('', ExpandConstant('{app}\{#MyAppExeName}'), '-fixprevious', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
end;
|