summary refs log blame commit diff stats
path: root/src/common/dcc.h
blob: 74028205b3e05dc999e955ed98c85e9562f2d7ce (plain) (tree)
a8abba84 generated by cgit-pink 1.4.1 (git 2.36.1) at 2024-11-13 15:02:30 +0000
ing 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; Components: libs Source: "share\locale\*"; DestDir: "{app}\share\locale"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: translations Source: "atk-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "cairo.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "fontconfig.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "gdk_pixbuf-2.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "gdk-win32-2.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "gio-2.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "glib-2.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "gmodule-2.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "gobject-2.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "gthread-2.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "gtk-win32-2.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "harfbuzz.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "iconv.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "libeay32.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "libenchant.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "libintl.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "libpng16.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "libxml2.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "pango-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "pangocairo-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "pangoft2-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "pangowin32-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "pixman-1.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "ssleay32.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "lib\enchant\libenchant_myspell.dll"; DestDir: "{app}\lib\enchant"; Flags: ignoreversion; Components: libs Source: "lib\gtk-2.0\i686-pc-vs10\engines\*"; DestDir: "{app}\lib\gtk-2.0\i686-pc-vs10\engines"; Flags: ignoreversion; Components: libs Source: "plugins\hcchecksum.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\checksum Source: "plugins\hcdoat.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\doat 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 or plugins\mpcinfo Source: "plugins\hcmpcinfo.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\mpcinfo 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: "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\hcpython2.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: langs\python\python2 Source: "plugins\hcpython3.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: langs\python\python3 Source: "plugins\hcperl.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: langs\perl Source: "hexchat.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: libs Source: "hexchat-text.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: xctext Source: "thememan.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: xtm [Icons] Name: "{group}\HexChat"; Filename: "{app}\hexchat.exe"; Tasks: not portable Name: "{group}\HexChat Safe Mode"; Filename: "{app}\hexchat.exe"; Parameters: "--no-auto --no-plugins"; Tasks: not portable Name: "{group}\HexChat ChangeLog"; Filename: "{app}\changelog.url"; IconFilename: "{sys}\shell32.dll"; IconIndex: 165; Tasks: not portable Name: "{group}\HexChat ReadMe"; Filename: "{app}\readme.url"; IconFilename: "{sys}\shell32.dll"; IconIndex: 23; Tasks: not portable Name: "{group}\HexChat Config Folder"; Filename: "%APPDATA%\HexChat\"; Tasks: not portable Name: "{group}\HexChat-Text"; Filename: "{app}\hexchat-text.exe"; Components: xctext; Tasks: not portable Name: "{group}\HexChat Theme Manager"; Filename: "{app}\thememan.exe"; Components: xtm; Tasks: not portable Name: "{group}\Uninstall HexChat"; Filename: "{uninstallexe}"; 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() + 'msvcr120.dll');; end; ///////////////////////////////////////////////////////////////////// function CheckSpellInstall(): Boolean; begin Result := DirExists(ExpandConstant('{localappdata}') + '\enchant');; end; ///////////////////////////////////////////////////////////////////// function CheckDotNetInstall(): Boolean; begin Result := RegKeyExists(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4'); end; ///////////////////////////////////////////////////////////////////// // Sets up the automatic downloads ///////////////////////////////////////////////////////////////////// procedure CurPageChanged(CurPageID: Integer); var REDIST: String; PERL: String; PY2: String; PY3: String; DOTNET: String; SPELL: String; begin if(CurPageID = wpReady) then begin idpClearFiles; if not IsTaskSelected('portable') then begin #if APPARCH == "x64" REDIST := 'http://dl.hexchat.net/misc/vcredist_2013_x64.exe'; PERL := 'http://dl.hexchat.net/misc/perl/Perl%205.20.0%20x64.msi'; PY2 := 'http://python.org/ftp/python/2.7.8/python-2.7.8.amd64.msi'; PY3 := 'http://python.org/ftp/python/3.4.1/python-3.4.1.amd64.msi'; #else REDIST := 'http://dl.hexchat.net/misc/vcredist_2013_x86.exe'; PERL := 'http://dl.hexchat.net/misc/perl/Perl%205.20.0%20x86.msi'; PY2 := 'http://python.org/ftp/python/2.7.8/python-2.7.8.msi'; PY3 := 'http://python.org/ftp/python/3.4.1/python-3.4.1.msi'; #endif DOTNET := 'http://dl.hexchat.net/misc/dotnet_40.exe'; SPELL := 'http://dl.hexchat.net/hexchat/HexChat%20Spelling%20Dictionaries%20r2.exe'; if not CheckVCInstall() then idpAddFile(REDIST, ExpandConstant('{tmp}\vcredist.exe')); if IsComponentSelected('xtm') and not CheckDotNetInstall() then idpAddFile(DOTNET, ExpandConstant('{tmp}\dotnet4.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 idpAddFile(PERL, ExpandConstant('{tmp}\perl.msi')); if IsComponentSelected('langs\python\python2') and not CheckDLL('python27.dll') then idpAddFile(PY2, ExpandConstant('{tmp}\python.msi')); if IsComponentSelected('langs\python\python3') and not CheckDLL('python34.dll') then idpAddFile(PY3, ExpandConstant('{tmp}\python.msi')); 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}\HexChat')) then #else if (WizardDirValue() = ExpandConstant('{pf32}\HexChat')) 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\HexChat (x64)_is1'); #else sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\HexChat (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\HexChat_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;