@@ -193,8 +193,8 @@ public class Updater : WebService {
193193 var backupDir = HostingEnvironment.MapPath("~/setup/upgrade/backup");
194194 var blogDir = HostingEnvironment.MapPath("~/");
195195
196- if (!System.IO. Directory.Exists(backupDir))
197- System.IO. Directory.CreateDirectory(backupDir);
196+ if (!Directory.Exists(backupDir))
197+ Directory.CreateDirectory(backupDir);
198198
199199 if (File.Exists(_oldZip))
200200 File.Delete(_oldZip);
@@ -288,8 +288,15 @@ public class Updater : WebService {
288288
289289 FixSH();
290290
291- Directory.Delete(_root + "\\setup\\upgrade\\backup", true);
291+ // add few new custom controls
292+ string from = "{0}\\setup\\upgrade\\backup\\be\\Custom\\Controls\\{1}";
293+ string to = "{0}\\Custom\\Controls\\{1}";
294+ CopyFile(string.Format(from, _root, "CommentList.ascx"), string.Format(to, _root, "CommentList.ascx"));
295+ CopyFile(string.Format(from, _root, "PostList.ascx"), string.Format(to, _root, "PostList.ascx"));
296+ CopyFile(string.Format(from, _root, "Defaults\\CommentView.ascx"), string.Format(to, _root, "Defaults\\CommentView.ascx"));
297+ CopyFile(string.Format(from, _root, "Defaults\\PostView.ascx"), string.Format(to, _root, "Defaults\\PostView.ascx"));
292298
299+ Directory.Delete(_root + "\\setup\\upgrade\\backup", true);
293300 Utils.Log(string.Format("Upgrade completed by {0}", Security.CurrentUser.Identity.Name));
294301
295302 return "";
@@ -542,15 +549,13 @@ public class Updater : WebService {
542549
543550 void DeleteFile(string file)
544551 {
545- //Log(file, "", false, Operation.Delete);
546552 if (File.Exists(file))
547553 File.Delete(file);
548554 }
549555
550556 void CopyFile(string from, string to)
551557 {
552- //Log(from, to);
553- File.Copy(from, to);
558+ File.Copy(from, to, true);
554559 }
555560
556561 void ReplaceFilesInDir(string dir)
0 commit comments