1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-11-25 10:42:18 -05:00

win32: Improvements to portable-mode in installer

This commit is contained in:
TingPing 2013-11-16 15:37:41 -05:00
parent 9834301eda
commit 5c872eb110

View File

@ -80,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
@ -233,6 +233,8 @@ begin
Result := RegKeyExists(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4');
end;
/////////////////////////////////////////////////////////////////////
// Sets up the automatic downloads
/////////////////////////////////////////////////////////////////////
procedure CurPageChanged(CurPageID: Integer);
var
@ -243,10 +245,13 @@ var
DOTNET: String;
SPELL: String;
begin
if not IsTaskSelected('portable') and (CurPageID = wpReady) then
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';
@ -280,6 +285,27 @@ begin
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