mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
Switched hardcoded DLL names to wildcard patterns (ex: atk-1.0-0.dll → *atk-1.0-0.dll, iconv.dll → *iconv*.dll, etc.) so it correctly picks up lib* prefixed builds. Made Enchant provider copying resilient by copying lib\enchant\*.dll instead of a single hardcoded libenchant_myspell.dll. Added optional copy support for LuaJIT DLLs (luajit*.dll) alongside lua51.dll. win32/installer/zoitechat.iss.tt Updated DLL Source: entries to match real-world names from dependency bundles using wildcards (*glib-2*.dll, *gtk-3*.dll, etc.). Added optional LuaJIT inclusion (skip if missing) and wildcarded girepository. win32/zoitechat.props Added env overrides so CI (and humans) can actually control paths: ZOITECHAT_DEPS_PATH ZOITECHAT_PYTHON3_PATH already supported ISCC_EXE and now it actually matters. Fixed glib-genmarshal handling to prefer glib-genmarshal.exe if present (and only use Python script path if needed). Added library-name auto-detection for MSVC import libs (gtk-3.lib vs gtk-3.0.lib vs libgtk-3.lib, etc.) so linking doesn’t die just because the bundle names differ. Ensured InstallerEnabled gets re-evaluated after IsccPath is resolved (GTK3 had the order wrong, so installer builds could be silently disabled). .github/workflows/windows-build.yml Made artifact collection and plugin validation tolerate win32 vs Win32 output directory naming, instead of assuming humans are consistent (they aren’t).
416 lines
22 KiB
Plaintext
416 lines
22 KiB
Plaintext
#define APPNAM "ZoiteChat"
|
|
#define APPVER "<#= [string]::Join('.', $versionParts) #>"
|
|
; These are defined by our installer project at build time
|
|
;#define APPARCH "x64"
|
|
;#define PROJECTDIR "C:\...\zoitechat\win32\installer\"
|
|
|
|
;http://mitrich.net23.net/?/inno-download-plugin.html
|
|
#include <idp.iss>
|
|
|
|
[Setup]
|
|
AppName=ZoiteChat
|
|
AppVersion={#APPVER}
|
|
AppVerName=ZoiteChat {#APPVER}
|
|
AppPublisher=ZoiteChat
|
|
AppPublisherURL=http://zoitechat.zoite.net
|
|
AppCopyright=Copyright (C) 1998-2010 Peter Zelezny
|
|
AppSupportURL=https://github.com/zoitechat/zoitechat/issues
|
|
AppUpdatesURL=http://zoitechat.zoite.net/downloads.html
|
|
LicenseFile=share\doc\zoitechat\COPYING
|
|
UninstallDisplayIcon={app}\zoitechat.exe
|
|
UninstallDisplayName=ZoiteChat
|
|
#if APPARCH == "x64"
|
|
DefaultDirName={pf64}\ZoiteChat
|
|
#else
|
|
DefaultDirName={pf32}\ZoiteChat
|
|
#endif
|
|
DefaultGroupName=ZoiteChat
|
|
AllowNoIcons=yes
|
|
SolidCompression=yes
|
|
Compression=lzma2/ultra64
|
|
SourceDir=..\rel
|
|
OutputDir=..
|
|
#if APPARCH == "x64"
|
|
OutputBaseFilename={#APPNAM}-{#APPVER}_x64
|
|
#else
|
|
OutputBaseFilename={#APPNAM}-{#APPVER}_x86
|
|
#endif
|
|
FlatComponentsList=no
|
|
PrivilegesRequired=none
|
|
ShowComponentSizes=no
|
|
CreateUninstallRegKey=not IsTaskSelected('portable')
|
|
Uninstallable=not IsTaskSelected('portable')
|
|
#if APPARCH == "x64"
|
|
ArchitecturesAllowed=x64
|
|
ArchitecturesInstallIn64BitMode=x64
|
|
#else
|
|
ArchitecturesAllowed=x86 x64
|
|
#endif
|
|
MinVersion=6.1
|
|
WizardImageFile={#PROJECTDIR}wizardimage.bmp
|
|
WizardSmallImageFile={#PROJECTDIR}wizardsmallimage.bmp
|
|
SetupIconFile={#PROJECTDIR}..\..\data\icons\zoitechat.ico
|
|
|
|
[Types]
|
|
Name: "normal"; Description: "Normal Installation"
|
|
Name: "minimal"; Description: "Minimal Installation"
|
|
Name: "custom"; Description: "Custom Installation"; Flags: iscustom
|
|
|
|
[Components]
|
|
Name: "libs"; Description: "ZoiteChat"; Types: normal minimal custom; Flags: fixed
|
|
Name: "xctext"; Description: "ZoiteChat-Text"; Types: custom; Flags: disablenouninstallwarning
|
|
Name: "icons"; Description: "Create Shortcuts"; Types: custom; Flags: disablenouninstallwarning
|
|
Name: "icons\desktopicon"; Description: "Create Desktop Shortcut"; Types: custom; Flags: disablenouninstallwarning
|
|
Name: "icons\quicklaunchicon"; Description: "Create Quick Launch Shortcut"; Types: custom; Flags: disablenouninstallwarning
|
|
Name: "translations"; Description: "Translations"; Types: normal custom; Flags: disablenouninstallwarning
|
|
Name: "spell"; Description: "Spelling Dictionaries"; Types: custom; Flags: disablenouninstallwarning
|
|
Name: "plugins"; Description: "Plugins"; Types: normal custom; Flags: disablenouninstallwarning
|
|
Name: "plugins\checksum"; Description: "Checksum"; Types: normal custom; Flags: disablenouninstallwarning
|
|
Name: "plugins\exec"; Description: "Exec"; Types: normal custom; Flags: disablenouninstallwarning
|
|
Name: "plugins\fishlim"; Description: "FiSHLiM"; Types: normal custom; Flags: disablenouninstallwarning
|
|
Name: "plugins\sysinfo"; Description: "SysInfo"; Types: normal custom; Flags: disablenouninstallwarning
|
|
Name: "plugins\upd"; Description: "Update Checker"; Types: normal custom; Flags: disablenouninstallwarning
|
|
Name: "plugins\winamp"; Description: "Winamp"; Types: custom; Flags: disablenouninstallwarning
|
|
Name: "langs"; Description: "Language Interfaces"; Types: custom; Flags: disablenouninstallwarning
|
|
Name: "langs\lua"; Description: "Lua"; Types: normal custom; Flags: disablenouninstallwarning
|
|
Name: "langs\perl"; Description: "Perl (requires Perl 5.20)"; Types: normal custom; Flags: disablenouninstallwarning
|
|
Name: "langs\python"; Description: "Python (requires Python 3.14.2)"; Types: normal custom; Flags: disablenouninstallwarning
|
|
|
|
[Tasks]
|
|
Name: portable; Description: "Yes"; GroupDescription: "Portable Mode: Stores configuration files within install directory for portable drives."; Flags: unchecked
|
|
|
|
[Registry]
|
|
Root: HKCR; Subkey: "irc"; ValueType: none; ValueName: ""; ValueData: ""; Flags: deletekey uninsdeletekey; Tasks: not portable
|
|
Root: HKCR; Subkey: "irc"; ValueType: string; ValueName: ""; ValueData: "URL:IRC Protocol"; Flags: uninsdeletevalue; Tasks: not portable
|
|
Root: HKCR; Subkey: "irc"; ValueType: string; ValueName: "URL Protocol"; ValueData: ""; Flags: uninsdeletevalue; Tasks: not portable
|
|
Root: HKCR; Subkey: "irc\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\zoitechat.exe,0"; Flags: uninsdeletevalue; Tasks: not portable
|
|
Root: HKCR; Subkey: "irc\shell"; ValueType: string; ValueName: ""; ValueData: "open"; Flags: uninsdeletevalue; Tasks: not portable
|
|
Root: HKCR; Subkey: "irc\shell\open\command"; ValueType: string; ValueName: ""; ValueData: "{app}\zoitechat.exe --url=""%1"""; Flags: uninsdeletevalue; Tasks: not portable
|
|
Root: HKCR; Subkey: ".zct"; ValueType: string; ValueName: ""; ValueData: "ZoiteChat.Theme"; Flags: uninsdeletevalue; Tasks: not portable
|
|
Root: HKCR; Subkey: ".hct"; ValueType: string; ValueName: ""; ValueData: "ZoiteChat.Theme"; Flags: uninsdeletevalue; Tasks: not portable
|
|
Root: HKCR; Subkey: "ZoiteChat.Theme"; ValueType: string; ValueName: ""; ValueData: "ZoiteChat Theme"; Flags: uninsdeletekey; Tasks: not portable
|
|
Root: HKCR; Subkey: "ZoiteChat.Theme\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\zoitechat.exe,0"; Flags: uninsdeletevalue; Tasks: not portable
|
|
Root: HKCR; Subkey: "ZoiteChat.Theme\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\zoitechat.exe"" ""%1"""; Flags: uninsdeletevalue; Tasks: not portable
|
|
|
|
[Run]
|
|
Filename: "{app}\zoitechat.exe"; Description: "Run ZoiteChat after closing the Wizard"; Flags: nowait postinstall skipifsilent
|
|
Filename: "http://docs.zoitechat.org/en/latest/changelog.html"; Description: "See what's changed"; Flags: shellexec runasoriginaluser postinstall skipifsilent unchecked
|
|
Filename: "{tmp}\vcredist.exe"; Parameters: "/install /quiet /norestart"; StatusMsg: "Installing Visual C++ Redistributable"; Flags: skipifdoesntexist; Tasks: not portable
|
|
Filename: "{tmp}\vcredist2013.exe"; Parameters: "/install /quiet /norestart"; StatusMsg: "Installing Visual C++ Redistributable"; Flags: skipifdoesntexist; Tasks: not portable
|
|
Filename: "{tmp}\perl.msi"; StatusMsg: "Installing Perl"; Components: langs\perl; Flags: shellexec skipifdoesntexist; Tasks: not portable
|
|
Filename: "{tmp}\python.msi"; StatusMsg: "Installing Python"; Components: langs\python; Flags: shellexec skipifdoesntexist; Tasks: not portable
|
|
Filename: "{tmp}\python.exe"; Parameters: "InstallAllUsers=1 PrependPath=1"; StatusMsg: "Installing Python"; Components: langs\python; Flags: shellexec skipifdoesntexist; Tasks: not portable
|
|
Filename: "{tmp}\spelling-dicts.exe"; Parameters: "/verysilent"; StatusMsg: "Installing Spelling Dictionaries"; Components: spell; Flags: skipifdoesntexist; Tasks: not portable
|
|
|
|
[Files]
|
|
Source: "portable-mode"; DestDir: "{app}"; Tasks: portable
|
|
|
|
Source: "changelog.url"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "readme.url"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "cert.pem"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "share\xml\*"; DestDir: "{app}\share\xml"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs
|
|
Source: "share\doc\*"; DestDir: "{app}\share\doc"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs
|
|
Source: "share\themes\MS-Windows\*"; DestDir: "{app}\share\themes\MS-Windows"; Flags: ignoreversion createallsubdirs recursesubdirs skipifsourcedoesntexist; Components: libs
|
|
Source: "share\locale\*"; DestDir: "{app}\share\locale"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: translations
|
|
Source: "etc\fonts\*"; DestDir: "{app}\etc\fonts"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs
|
|
|
|
Source: "*atk-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*cairo*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*freetype*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*fribidi*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*fontconfig*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*gdk_pixbuf*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*gdk-3*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*gio-2*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*glib-2*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*gmodule-2*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*gobject-2*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
#if APPARCH == "x64"
|
|
Source: "gspawn-win64-helper.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "gspawn-win64-helper-console.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
#else
|
|
Source: "gspawn-win32-helper.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "gspawn-win32-helper-console.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
#endif
|
|
Source: "*gthread-2*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*gtk-3*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*iconv*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "libcrypto-*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "libssl-*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "libenchant.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*ffi*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*intl*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "jpeg*.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist; Components: libs
|
|
Source: "*png*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "libjpeg*.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist; Components: libs
|
|
Source: "*xml2*.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist; Components: libs
|
|
Source: "xml2-*.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist; Components: libs
|
|
Source: "*pango-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*pangocairo-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*pangoft2-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*pangowin32-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "*zlib*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
|
|
Source: "plugins\hcnotifications-winrt.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: libs
|
|
|
|
Source: "lib\enchant\*"; DestDir: "{app}\lib\enchant"; Flags: ignoreversion; Components: libs
|
|
|
|
; GTK 3 input method modules (e.g. IMEs) and printing backends. These can be absent
|
|
; in some CI dependency bundles, so skip when the directory isn't present.
|
|
Source: "lib\gtk-3.0\3.0.0\immodules\*"; DestDir: "{app}\lib\gtk-3.0\3.0.0\immodules"; Flags: ignoreversion createallsubdirs recursesubdirs skipifsourcedoesntexist; Components: libs
|
|
Source: "lib\gtk-3.0\3.0.0\printbackends\*"; DestDir: "{app}\lib\gtk-3.0\3.0.0\printbackends"; Flags: ignoreversion createallsubdirs recursesubdirs skipifsourcedoesntexist; Components: libs
|
|
|
|
Source: "*girepository*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: langs\lua
|
|
Source: "lua51.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist; Components: langs\lua
|
|
Source: "luajit*.dll"; DestDir: "{app}"; Flags: ignoreversion skipifsourcedoesntexist; Components: langs\lua
|
|
Source: "lib\lua\2.1\lgi\*.dll"; DestDir: "{app}\lib\lua\2.1\lgi"; Flags: ignoreversion; Components: langs\lua
|
|
Source: "lib\girepository-1.0\*.typelib"; DestDir: "{app}\lib\girepository-1.0"; Flags: ignoreversion; Components: langs\lua
|
|
Source: "share\lua\2.1\*.lua"; DestDir: "{app}\share\lua\2.1"; Flags: ignoreversion; Components: langs\lua
|
|
Source: "share\lua\2.1\lgi\*.lua"; DestDir: "{app}\share\lua\2.1\lgi"; Flags: ignoreversion; Components: langs\lua
|
|
Source: "share\lua\2.1\lgi\override\*.lua"; DestDir: "{app}\share\lua\2.1\lgi\override"; Flags: ignoreversion; Components: langs\lua
|
|
Source: "plugins\hclua.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: langs\lua
|
|
|
|
Source: "plugins\hcchecksum.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\checksum
|
|
Source: "plugins\hcexec.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\exec
|
|
Source: "plugins\hcfishlim.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\fishlim
|
|
Source: "share\music.png"; DestDir: "{app}\share"; Flags: ignoreversion; Components: plugins\winamp
|
|
Source: "share\download.png"; DestDir: "{app}\share"; Flags: ignoreversion; Components: plugins\upd
|
|
Source: "plugins\hcupd.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\upd
|
|
Source: "WinSparkle.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: plugins\upd
|
|
Source: "plugins\hcwinamp.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\winamp
|
|
Source: "share\system.png"; DestDir: "{app}\share"; Flags: ignoreversion; Components: plugins\sysinfo
|
|
Source: "plugins\hcsysinfo.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\sysinfo
|
|
Source: "plugins\hcperl.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: langs\perl
|
|
|
|
Source: "python\*.py"; DestDir: "{app}\python"; Flags: ignoreversion; Components: langs\python
|
|
|
|
Source: "plugins\hcpython3.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: langs\python
|
|
Source: "_cffi_backend.cp3*.pyd"; DestDir: "{app}"; Flags: ignoreversion; Components: langs\python
|
|
|
|
Source: "zoitechat.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
|
|
Source: "zoitechat-text.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: xctext
|
|
|
|
[Icons]
|
|
Name: "{group}\ZoiteChat"; Filename: "{app}\zoitechat.exe"; AppUserModelID: "ZoiteChat.Desktop.Notify"; Tasks: not portable; Check: not WizardNoIcons
|
|
Name: "{group}\ZoiteChat Safe Mode"; Filename: "{app}\zoitechat.exe"; Parameters: "--no-auto --no-plugins"; Tasks: not portable; Check: not WizardNoIcons
|
|
Name: "{group}\ZoiteChat ChangeLog"; Filename: "{app}\changelog.url"; IconFilename: "{sys}\shell32.dll"; IconIndex: 165; Tasks: not portable; Check: not WizardNoIcons
|
|
Name: "{group}\ZoiteChat ReadMe"; Filename: "{app}\readme.url"; IconFilename: "{sys}\shell32.dll"; IconIndex: 23; Tasks: not portable; Check: not WizardNoIcons
|
|
Name: "{group}\ZoiteChat Config Folder"; Filename: "%APPDATA%\ZoiteChat\"; Tasks: not portable; Check: not WizardNoIcons
|
|
Name: "{group}\ZoiteChat-Text"; Filename: "{app}\zoitechat-text.exe"; Components: xctext; Tasks: not portable; Check: not WizardNoIcons
|
|
Name: "{group}\Uninstall ZoiteChat"; Filename: "{uninstallexe}"; Tasks: not portable; Check: not WizardNoIcons
|
|
Name: "{commondesktop}\ZoiteChat"; Filename: "{app}\zoitechat.exe"; AppUserModelID: "ZoiteChat.Desktop.Notify"; Components: icons\desktopicon; Tasks: not portable
|
|
Name: "{commonappdata}\Microsoft\Internet Explorer\Quick Launch\ZoiteChat"; Filename: "{app}\zoitechat.exe"; Components: icons\quicklaunchicon; Tasks: not portable
|
|
|
|
[Messages]
|
|
BeveledLabel= {#APPNAM}
|
|
|
|
[Code]
|
|
/////////////////////////////////////////////////////////////////////
|
|
procedure InitializeWizard;
|
|
begin
|
|
WizardForm.LicenseAcceptedRadio.Checked := True;
|
|
|
|
idpDownloadAfter(wpReady);
|
|
end;
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
function GetSysDir(): String;
|
|
begin
|
|
#if APPARCH != "x64"
|
|
if IsWin64 then
|
|
Result := ExpandConstant('{syswow64}\')
|
|
else
|
|
Result := ExpandConstant('{sys}\');
|
|
#else
|
|
Result := ExpandConstant('{sys}\');
|
|
#endif
|
|
end;
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
function CheckDLL(DLLName: String): Boolean;
|
|
var
|
|
ResultCode: Integer;
|
|
begin
|
|
if ExecAsOriginalUser(GetSysDir() + 'where.exe', '/Q ' + DLLName,
|
|
'', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
|
|
Result := ResultCode = 0 // 0 is success
|
|
else
|
|
Result := False;
|
|
end;
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
function CheckVCInstall(): Boolean;
|
|
begin
|
|
Result := FileExists(GetSysDir() + 'vcruntime140.dll');;
|
|
end;
|
|
|
|
function CheckVC2013Install(): Boolean;
|
|
begin
|
|
Result := FileExists(GetSysDir() + 'msvcr120.dll');;
|
|
end;
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
function CheckSpellInstall(): Boolean;
|
|
var
|
|
Version: TWindowsVersion;
|
|
begin
|
|
GetWindowsVersionEx(Version);
|
|
|
|
// Windows 8 or greater has built in spell check.
|
|
if Version.NTPlatform and (Version.Major > 6) or ((Version.Major = 6) and (Version.Minor > 1)) then
|
|
Result := True
|
|
else
|
|
Result := DirExists(ExpandConstant('{localappdata}') + '\enchant\myspell');
|
|
end;
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
// Sets up the automatic downloads
|
|
/////////////////////////////////////////////////////////////////////
|
|
procedure CurPageChanged(CurPageID: Integer);
|
|
var
|
|
REDIST: String;
|
|
REDIST_2013: String;
|
|
PERL: String;
|
|
PY2: String;
|
|
PY3: String;
|
|
SPELL: String;
|
|
begin
|
|
if(CurPageID = wpReady) then
|
|
begin
|
|
idpClearFiles;
|
|
|
|
if not IsTaskSelected('portable') then
|
|
begin
|
|
|
|
#if APPARCH == "x64"
|
|
REDIST := 'https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.16.2/vcredist_2015_x64.exe';
|
|
REDIST_2013 := 'https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.16.2/vcredist_2013_x64.exe';
|
|
PERL := 'https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.16.2/Perl.5.20.0.x64.msi';
|
|
PY3 := 'https://www.python.org/ftp/python/3.14.2/python-3.14.2-amd64.exe';
|
|
#else
|
|
REDIST := 'https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.16.2/vcredist_2015_x86.exe';
|
|
REDIST_2013 := 'https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.16.2/vcredist_2013_x86.exe';
|
|
PERL := 'https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.16.2/Perl.5.20.0.x86.msi';
|
|
PY3 := 'https://www.python.org/ftp/python/3.14.2/python-3.14.2.exe';
|
|
#endif
|
|
SPELL := 'https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.16.2/ZoiteChat.Spelling.Dictionaries.r2.exe';
|
|
|
|
if not CheckVCInstall() then
|
|
idpAddFile(REDIST, ExpandConstant('{tmp}\vcredist.exe'));
|
|
|
|
if IsComponentSelected('spell') and not CheckSpellInstall() then
|
|
idpAddFile(SPELL, ExpandConstant('{tmp}\spelling-dicts.exe'));
|
|
|
|
if not WizardSilent() then
|
|
begin
|
|
if IsComponentSelected('langs\perl') and not CheckDLL('perl520.dll') then
|
|
begin
|
|
if not CheckVC2013Install() then
|
|
idpAddFile(REDIST_2013, ExpandConstant('{tmp}\vcredist2013.exe'));
|
|
|
|
idpAddFile(PERL, ExpandConstant('{tmp}\perl.msi'))
|
|
end;
|
|
|
|
if IsComponentSelected('langs\python\python3') and not CheckDLL('python314.dll') then
|
|
idpAddFile(PY3, ExpandConstant('{tmp}\python.exe'));
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
// Disable portable-mode if installing to program files
|
|
/////////////////////////////////////////////////////////////////////
|
|
function NextButtonClick(CurPageID: Integer): Boolean;
|
|
begin
|
|
if (CurPageID = wpSelectTasks) then
|
|
if (WizardForm.TasksList.Checked[1] = True) then
|
|
#if APPARCH == "x64"
|
|
if (WizardDirValue() = ExpandConstant('{pf64}\ZoiteChat')) then
|
|
#else
|
|
if (WizardDirValue() = ExpandConstant('{pf32}\ZoiteChat')) then
|
|
#endif
|
|
begin
|
|
WizardForm.TasksList.Checked[1] := False
|
|
MsgBox('Portable mode is only intended for use on portable drives and has been disabled.', mbInformation, MB_OK)
|
|
end;
|
|
|
|
Result := True; // Always continue
|
|
end;
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
// these are required for x86->x64 or reverse upgrades
|
|
/////////////////////////////////////////////////////////////////////
|
|
function GetUninstallString(): String;
|
|
var
|
|
sUnInstPath: String;
|
|
sUnInstallString: String;
|
|
begin
|
|
#if APPARCH == "x64"
|
|
sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\ZoiteChat (x64)_is1');
|
|
#else
|
|
sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\ZoiteChat (x86)_is1');
|
|
#endif
|
|
sUnInstallString := '';
|
|
if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
|
|
RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
|
|
if not (sUnInstallString <> '') then
|
|
sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\ZoiteChat_is1');
|
|
if not RegQueryStringValue(HKLM32, sUnInstPath, 'UninstallString', sUnInstallString) then
|
|
if not RegQueryStringValue(HKCU32, sUnInstPath, 'UninstallString', sUnInstallString) then
|
|
if IsWin64 then
|
|
if not RegQueryStringValue(HKLM64, sUnInstPath, 'UninstallString', sUnInstallString) then
|
|
RegQueryStringValue(HKCU64, sUnInstPath, 'UninstallString', sUnInstallString);
|
|
Result := sUnInstallString;
|
|
end;
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
function IsUpgrade(): Boolean;
|
|
begin
|
|
Result := (GetUninstallString() <> '');
|
|
end;
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
function UnInstallOldVersion(): Integer;
|
|
var
|
|
sUnInstallString: String;
|
|
iResultCode: Integer;
|
|
begin
|
|
// Return Values:
|
|
// 1 - uninstall string is empty
|
|
// 2 - error executing the UnInstallString
|
|
// 3 - successfully executed the UnInstallString
|
|
|
|
// default return value
|
|
Result := 0;
|
|
|
|
// get the uninstall string of the old app
|
|
sUnInstallString := GetUninstallString();
|
|
if sUnInstallString <> '' then begin
|
|
sUnInstallString := RemoveQuotes(sUnInstallString);
|
|
if Exec(sUnInstallString, '/VERYSILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
|
|
Result := 3
|
|
else
|
|
Result := 2;
|
|
end else
|
|
Result := 1;
|
|
end;
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
procedure CurStepChanged(CurStep: TSetupStep);
|
|
begin
|
|
if not (IsTaskSelected('portable')) then
|
|
begin
|
|
if (CurStep=ssInstall) then
|
|
begin
|
|
if (IsUpgrade()) then
|
|
begin
|
|
UnInstallOldVersion();
|
|
end;
|
|
DeleteFile(ExpandConstant('{app}\portable-mode'));
|
|
end;
|
|
end;
|
|
end;
|