diff options
Diffstat (limited to 'win32')
-rw-r--r-- | win32/hexchat.props | 4 | ||||
-rw-r--r-- | win32/installer/hexchat.iss.tt | 137 | ||||
-rw-r--r-- | win32/installer/installer.vcxproj | 4 |
3 files changed, 135 insertions, 10 deletions
diff --git a/win32/hexchat.props b/win32/hexchat.props index 57f77648..3acfd913 100644 --- a/win32/hexchat.props +++ b/win32/hexchat.props @@ -94,6 +94,10 @@ copy "$(HexChatBin)hcsysinfo.dll" "$(HexChatRel)\plugins" xcopy /q /s /i "$(HexChatBin)locale" "$(HexChatRel)\share\locale" xcopy /q /s /i "$(DepsRoot)\share\locale" "$(HexChatRel)\share\locale" </HexChatCopy> + <TextTransformPath Condition="'$(Platform)'=='Win32'">"%PROGRAMFILES%\Common Files\microsoft shared\TextTemplating\12.0\TextTransform.exe"</TextTransformPath> + <TextTransformPath Condition="'$(Platform)'=='x64'">"%PROGRAMFILES(x86)%\Common Files\microsoft shared\TextTemplating\12.0\TextTransform.exe"</TextTransformPath> + <IsccPath Condition="'$(Platform)'=='Win32'">"%PROGRAMFILES%\Inno Setup 5\iscc.exe"</IsccPath> + <IsccPath Condition="'$(Platform)'=='x64'">"%PROGRAMFILES(x86)%\Inno Setup 5\iscc.exe"</IsccPath> </PropertyGroup> <ItemDefinitionGroup> diff --git a/win32/installer/hexchat.iss.tt b/win32/installer/hexchat.iss.tt index 1f2e1491..1ba55303 100644 --- a/win32/installer/hexchat.iss.tt +++ b/win32/installer/hexchat.iss.tt @@ -4,6 +4,9 @@ ;#define APPARCH "x64" ;#define PROJECTDIR "C:\...\hexchat\win32\installer\" +;http://mitrich.net23.net/?/inno-download-plugin.html +#include <idp.iss> + [Setup] AppName=HexChat AppVersion={#APPVER} @@ -57,8 +60,9 @@ Name: "custom"; Description: "Custom Installation"; Flags: iscustom Name: "libs"; Description: "HexChat"; Types: normal minimal custom; Flags: fixed Name: "gtktheme"; Description: "GTK+ Theme"; Types: normal custom; Flags: disablenouninstallwarning Name: "xctext"; Description: "HexChat-Text"; Types: custom; Flags: disablenouninstallwarning -Name: "xtm"; Description: "HexChat Theme Manager (Requires .NET 4.0)"; Types: normal custom; Flags: disablenouninstallwarning +Name: "xtm"; Description: "HexChat Theme Manager"; Types: normal 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: custom; Flags: disablenouninstallwarning Name: "plugins\checksum"; Description: "Checksum"; Types: custom; Flags: disablenouninstallwarning Name: "plugins\dns"; Description: "DNS"; Types: custom; Flags: disablenouninstallwarning @@ -76,7 +80,7 @@ Name: "langs\python\python2"; Description: "Python (requires Python 2.7)"; Types Name: "langs\python\python3"; Description: "Python (requires Python 3.3)"; Types: custom; Flags: disablenouninstallwarning exclusive [Tasks] -Name: portable; Description: "Yes"; GroupDescription: "Portable Install (no Registry entries, no Start Menu icons, no uninstaller):"; Flags: unchecked +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 @@ -95,12 +99,12 @@ Root: HKCR; Subkey: ".hct\shell\open\command"; ValueType: string; ValueName: ""; [Run] Filename: "{app}\hexchat.exe"; Description: "Run HexChat after closing the Wizard"; Flags: nowait postinstall skipifsilent -Filename: "https://www.microsoft.com/en-us/download/details.aspx?id=39315"; Description: "Download Visual C++ 2013 Redistributable"; Flags: shellexec runasoriginaluser postinstall skipifsilent -Filename: "http://www.microsoft.com/en-us/download/details.aspx?id=17851"; Description: "Download .NET 4.0 for theme manager"; Components: xtm; Flags: shellexec runasoriginaluser postinstall skipifsilent Filename: "http://docs.hexchat.org/en/latest/changelog.html"; Description: "See what's changed"; Flags: shellexec runasoriginaluser postinstall skipifsilent unchecked -Filename: "http://hexchat.org/downloads.html"; Description: "Download Perl"; Flags: shellexec runasoriginaluser postinstall skipifsilent unchecked; Components: langs\perl and not langs\python -Filename: "http://hexchat.org/downloads.html"; Description: "Download Python"; Flags: shellexec runasoriginaluser postinstall skipifsilent unchecked; Components: langs\python and not langs\perl -Filename: "http://hexchat.org/downloads.html"; Description: "Download Perl and Python"; Flags: shellexec runasoriginaluser postinstall skipifsilent unchecked; Components: langs\perl and langs\python +Filename: "{tmp}\vcredist.exe"; Parameters: "/install /quiet /norestart"; StatusMsg: "Installing Visual C++ Redist"; Flags: skipifdoesntexist; Tasks: not portable +Filename: "{tmp}\dotnet4.exe"; Parameters: "/q /norestart"; StatusMsg: "Installing .NET"; Components: xtm; 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}\spelling-dicts.exe"; Parameters: "/verysilent"; StatusMsg: "Installing Spelling Dictionaries"; Components: spell; Flags: skipifdoesntexist; Tasks: not portable [Files] Source: "portable-mode"; DestDir: "{app}"; Tasks: portable @@ -182,8 +186,126 @@ BeveledLabel= {#APPNAM} 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.18.0%20x64.msi'; + PY2 := 'http://python.org/ftp/python/2.7.5/python-2.7.5.amd64.msi'; + PY3 := 'http://python.org/ftp/python/3.3.2/python-3.3.2.amd64.msi'; +#else + REDIST := 'http://dl.hexchat.net/misc/vcredist_2013_x86.exe'; + PERL := 'http://dl.hexchat.net/misc/perl/Perl%205.18.0%20x86.msi'; + PY2 := 'http://python.org/ftp/python/2.7.5/python-2.7.5.msi'; + PY3 := 'http://python.org/ftp/python/3.3.2/python-3.3.2.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 IsComponentSelected('langs\perl') and not CheckDLL('perl518.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('python33.dll') then + idpAddFile(PY3, ExpandConstant('{tmp}\python.msi')); + 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 @@ -211,7 +333,6 @@ begin Result := sUnInstallString; end; - ///////////////////////////////////////////////////////////////////// function IsUpgrade(): Boolean; begin diff --git a/win32/installer/installer.vcxproj b/win32/installer/installer.vcxproj index 453e87bd..09654ab0 100644 --- a/win32/installer/installer.vcxproj +++ b/win32/installer/installer.vcxproj @@ -64,10 +64,10 @@ <Command> <![CDATA[ SET SOLUTIONDIR=$(SolutionDir)..\ -"%PROGRAMFILES%\Common Files\microsoft shared\TextTemplating\12.0\TextTransform.exe" -out "%SOLUTIONDIR%win32\installer\hexchat.iss" "%SOLUTIONDIR%win32\installer\hexchat.iss.tt" +$(TextTransformPath) -out "%SOLUTIONDIR%win32\installer\hexchat.iss" "%SOLUTIONDIR%win32\installer\hexchat.iss.tt" del "$(OutDir)hexchat.iss" type hexchat.iss >> "$(OutDir)hexchat.iss" -"$(ProgramFiles)\Inno Setup 5\iscc.exe" /dPROJECTDIR="$(ProjectDir)" /dAPPARCH="$(Platform)" "$(OutDir)hexchat.iss" +$(IsccPath) /dPROJECTDIR="$(ProjectDir)" /dAPPARCH="$(Platform)" "$(OutDir)hexchat.iss" ]]> </Command> </PreBuildEvent> |