summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2013-03-23 17:06:19 +0100
committerBerke Viktor <bviktor@hexchat.org>2013-03-23 17:06:19 +0100
commitc6ead740c8795dd9afea46ad392c153fbe47c675 (patch)
tree747cedd0453db3e7326017afdef14110ee8ee9ef
parent96fe6bf2ca940f11f3779016974d1d52678d4303 (diff)
Migrator for servlist_ in the installers
-rw-r--r--win32/installer/hexchat-x64.skel.iss27
-rw-r--r--win32/installer/hexchat-x86.skel.iss27
2 files changed, 54 insertions, 0 deletions
diff --git a/win32/installer/hexchat-x64.skel.iss b/win32/installer/hexchat-x64.skel.iss
index 4459922f..fe55e7d3 100644
--- a/win32/installer/hexchat-x64.skel.iss
+++ b/win32/installer/hexchat-x64.skel.iss
@@ -240,6 +240,24 @@ begin
 		Result := 1;
 end;
 
+
+/////////////////////////////////////////////////////////////////////
+procedure MigrateServlist();
+begin
+  FileCopy(ExpandConstant('{userappdata}\HexChat\servlist_.conf'), ExpandConstant('{userappdata}\HexChat\servlist.conf'), True);
+end;
+
+
+/////////////////////////////////////////////////////////////////////
+function OldServlistCheck(): Boolean;
+begin
+  if FileExists(ExpandConstant('{userappdata}\HexChat\servlist_.conf')) then
+    Result := True
+  else
+    Result := False
+end;
+
+
 /////////////////////////////////////////////////////////////////////
 procedure CurStepChanged(CurStep: TSetupStep);
 begin
@@ -253,9 +271,18 @@ begin
 			end;
 			DeleteFile(ExpandConstant('{app}\portable-mode'));
 		end;
+
+		if (CurStep=ssPostInstall) then
+		begin
+			if OldServlistCheck() then begin
+				if SuppressibleMsgBox('Would you like to copy your old HexChat network list (servlist_.conf) to the new name (servlist.conf)? Make sure you remove servlist_.conf when you no longer need it.', mbConfirmation, MB_YESNO or MB_DEFBUTTON2, IDNO) = IDYES then
+					MigrateServlist();
+			end;
+		end;
 	end;
 end;
 
+
 /////////////////////////////////////////////////////////////////////
 // Importing LoadSkin API from ISSkin.DLL
 procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
diff --git a/win32/installer/hexchat-x86.skel.iss b/win32/installer/hexchat-x86.skel.iss
index b4c7d192..12c1251b 100644
--- a/win32/installer/hexchat-x86.skel.iss
+++ b/win32/installer/hexchat-x86.skel.iss
@@ -239,6 +239,24 @@ begin
 		Result := 1;
 end;
 
+
+/////////////////////////////////////////////////////////////////////
+procedure MigrateServlist();
+begin
+  FileCopy(ExpandConstant('{userappdata}\HexChat\servlist_.conf'), ExpandConstant('{userappdata}\HexChat\servlist.conf'), True);
+end;
+
+
+/////////////////////////////////////////////////////////////////////
+function OldServlistCheck(): Boolean;
+begin
+  if FileExists(ExpandConstant('{userappdata}\HexChat\servlist_.conf')) then
+    Result := True
+  else
+    Result := False
+end;
+
+
 /////////////////////////////////////////////////////////////////////
 procedure CurStepChanged(CurStep: TSetupStep);
 begin
@@ -252,9 +270,18 @@ begin
 			end;
 			DeleteFile(ExpandConstant('{app}\portable-mode'));
 		end;
+
+		if (CurStep=ssPostInstall) then
+		begin
+			if OldServlistCheck() then begin
+				if SuppressibleMsgBox('Would you like to copy your old HexChat network list (servlist_.conf) to the new name (servlist.conf)? Make sure you remove servlist_.conf when you no longer need it.', mbConfirmation, MB_YESNO or MB_DEFBUTTON2, IDNO) = IDYES then
+					MigrateServlist();
+			end;
+		end;
 	end;
 end;
 
+
 /////////////////////////////////////////////////////////////////////
 // Importing LoadSkin API from ISSkin.DLL
 procedure LoadSkin(lpszPath: String; lpszIniFileName: String);