Skip to content

Commit 758848d

Browse files
committed
Improvements in setup/upgrade
1 parent 6536f0b commit 758848d

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

BlogEngine/BlogEngine.Core/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
[assembly: CLSCompliant(false)]
2020
[assembly: ComVisible(false)]
2121
[assembly: AllowPartiallyTrustedCallers]
22-
[assembly: AssemblyVersion("3.1.4.6")]
22+
[assembly: AssemblyVersion("3.1.4.7")]
2323
[assembly: SecurityRules(SecurityRuleSet.Level1)]

BlogEngine/BlogEngine.NET/setup/upgrade/Updater.asmx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)