summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2013-11-16 15:37:41 -0500
committerTingPing <tingping@tingping.se>2013-11-16 15:37:41 -0500
commit5c872eb110e73701bea3cfab38f1e26f6371c8f2 (patch)
treeb1c47f1f317292282a25e44285b2f9b5660bdd2f
parent9834301edaad48e87f5acae5c9798d63961d30b5 (diff)
win32: Improvements to portable-mode in installer
-rw-r--r--win32/installer/hexchat.iss.tt86
1 files changed, 56 insertions, 30 deletions
diff --git a/win32/installer/hexchat.iss.tt b/win32/installer/hexchat.iss.tt
index 7c280e69..1ba55303 100644
--- a/win32/installer/hexchat.iss.tt
+++ b/win32/installer/hexchat.iss.tt
@@ -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
@@ -234,6 +234,8 @@ begin
 end;
 
 /////////////////////////////////////////////////////////////////////
+// Sets up the automatic downloads
+/////////////////////////////////////////////////////////////////////
 procedure CurPageChanged(CurPageID: Integer);
 var
 	REDIST: String;
@@ -243,45 +245,69 @@ 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';
-
-	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'));
+		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
 /////////////////////////////////////////////////////////////////////
 function GetUninstallString(): String;