Skip to content

Commit

Permalink
DNN-8695 added try/catch in file deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishpd committed May 25, 2016
1 parent 08fb75d commit 31d7424
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions DNN Platform/Library/Services/Upgrade/Upgrade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4095,10 +4095,18 @@ public static string CheckUpgrade()
/// -----------------------------------------------------------------------------
public static void DeleteInstallerFiles()
{
FileSystemUtils.DeleteFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Install", "DotNetNuke.install.config"));
FileSystemUtils.DeleteFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Install", "DotNetNuke.install.config.resources"));
FileSystemUtils.DeleteFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Install", "InstallWizard.aspx"));
FileSystemUtils.DeleteFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Install", "InstallWizard.aspx.cs"));
var files = new List<string> {"DotNetNuke.install.config", "InstallWizard.aspx", "InstallWizard.aspx.cs"};
foreach (var file in files)
{
try
{
FileSystemUtils.DeleteFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Install", file));
}
catch (Exception ex)
{
Logger.Error("File deletion failed for [Install\\" + file + "]. PLEASE REMOVE THIS MANUALLY." + ex);
}
}
}

/// -----------------------------------------------------------------------------
Expand Down

0 comments on commit 31d7424

Please sign in to comment.