@@ -193,8 +193,8 @@ public class Updater : WebService {
193
193
var backupDir = HostingEnvironment.MapPath("~/setup/upgrade/backup");
194
194
var blogDir = HostingEnvironment.MapPath("~/");
195
195
196
- if (!System.IO. Directory.Exists(backupDir))
197
- System.IO. Directory.CreateDirectory(backupDir);
196
+ if (!Directory.Exists(backupDir))
197
+ Directory.CreateDirectory(backupDir);
198
198
199
199
if (File.Exists(_oldZip))
200
200
File.Delete(_oldZip);
@@ -288,8 +288,15 @@ public class Updater : WebService {
288
288
289
289
FixSH();
290
290
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"));
292
298
299
+ Directory.Delete(_root + "\\setup\\upgrade\\backup", true);
293
300
Utils.Log(string.Format("Upgrade completed by {0}", Security.CurrentUser.Identity.Name));
294
301
295
302
return "";
@@ -542,15 +549,13 @@ public class Updater : WebService {
542
549
543
550
void DeleteFile(string file)
544
551
{
545
- //Log(file, "", false, Operation.Delete);
546
552
if (File.Exists(file))
547
553
File.Delete(file);
548
554
}
549
555
550
556
void CopyFile(string from, string to)
551
557
{
552
- //Log(from, to);
553
- File.Copy(from, to);
558
+ File.Copy(from, to, true);
554
559
}
555
560
556
561
void ReplaceFilesInDir(string dir)
0 commit comments