summary refs log tree commit diff stats
path: root/win32
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2012-11-03 23:54:05 +0100
committerBerke Viktor <bviktor@hexchat.org>2012-11-03 23:54:05 +0100
commitb236af84a4dc285736ea5dde8518adad4b3eacd0 (patch)
tree9e8beca7fa097fdda41d7d3289d08852d92e98a6 /win32
parent0481433d698a1bb8a1b3c438d07f830c02bf761d (diff)
Installer migrator functions for xchat.conf -> hexchat.conf
Diffstat (limited to 'win32')
-rw-r--r--win32/installer/hexchat-xp-x64.skel.iss23
-rw-r--r--win32/installer/hexchat-xp-x86.skel.iss23
2 files changed, 46 insertions, 0 deletions
diff --git a/win32/installer/hexchat-xp-x64.skel.iss b/win32/installer/hexchat-xp-x64.skel.iss
index e43b80e2..7661ef27 100644
--- a/win32/installer/hexchat-xp-x64.skel.iss
+++ b/win32/installer/hexchat-xp-x64.skel.iss
@@ -259,6 +259,21 @@ begin
 end;

 

 /////////////////////////////////////////////////////////////////////

+procedure MigrateConf();

+begin

+  FileCopy(ExpandConstant('{userappdata}\HexChat\xchat.conf'), ExpandConstant('{userappdata}\HexChat\hexchat.conf'), True);

+end;

+

+/////////////////////////////////////////////////////////////////////

+function ConfExistCheck(): Boolean;

+begin

+  if FileExists(ExpandConstant('{userappdata}\HexChat\xchat.conf')) then

+    Result := True

+  else

+    Result := False

+end;

+

+/////////////////////////////////////////////////////////////////////

 procedure CurStepChanged(CurStep: TSetupStep);

 begin

 	if not (IsTaskSelected('portable')) then

@@ -271,6 +286,14 @@ begin
 			end;

 			DeleteFile(ExpandConstant('{app}\portable-mode'));

 		end;

+

+		if (CurStep=ssPostInstall) then

+		begin

+			if ConfExistCheck() then begin

+				if SuppressibleMsgBox('Would you like to copy your old HexChat configuration file (xchat.conf) to the new name (hexchat.conf)? Make sure you remove xchat.conf when you no longer need it.', mbConfirmation, MB_YESNO or MB_DEFBUTTON2, IDNO) = IDYES then

+					MigrateConf();

+			end;

+		end;

 	end;

 end;

 

diff --git a/win32/installer/hexchat-xp-x86.skel.iss b/win32/installer/hexchat-xp-x86.skel.iss
index 8875ebad..0c27aeac 100644
--- a/win32/installer/hexchat-xp-x86.skel.iss
+++ b/win32/installer/hexchat-xp-x86.skel.iss
@@ -260,6 +260,21 @@ begin
 end;

 

 /////////////////////////////////////////////////////////////////////

+procedure MigrateConf();

+begin

+  FileCopy(ExpandConstant('{userappdata}\HexChat\xchat.conf'), ExpandConstant('{userappdata}\HexChat\hexchat.conf'), True);

+end;

+

+/////////////////////////////////////////////////////////////////////

+function ConfExistCheck(): Boolean;

+begin

+  if FileExists(ExpandConstant('{userappdata}\HexChat\xchat.conf')) then

+      Result := True

+  else

+    Result := False

+end;

+

+/////////////////////////////////////////////////////////////////////

 procedure CurStepChanged(CurStep: TSetupStep);

 begin

 	if not (IsTaskSelected('portable')) then

@@ -272,6 +287,14 @@ begin
 			end;

 			DeleteFile(ExpandConstant('{app}\portable-mode'));

 		end;

+

+		if (CurStep=ssPostInstall) then

+		begin

+			if ConfExistCheck() then begin

+				if SuppressibleMsgBox('Would you like to copy your old HexChat configuration file (xchat.conf) to the new name (hexchat.conf)? Make sure you remove xchat.conf when you no longer need it.', mbConfirmation, MB_YESNO or MB_DEFBUTTON2, IDNO) = IDYES then

+					MigrateConf();

+			end;

+		end;

 	end;

 end;