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
1 changed files with 53 additions and 27 deletions

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,44 +245,68 @@ 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';
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';
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';
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';
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 not CheckVCInstall() then
idpAddFile(REDIST, ExpandConstant('{tmp}\vcredist.exe'));
if IsComponentSelected('xtm') and not CheckDotNetInstall() then
idpAddFile(DOTNET, ExpandConstant('{tmp}\dotnet4.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'));
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
/////////////////////////////////////////////////////////////////////