fix: create all .disabled files for previous versions, just to be safe

This commit is contained in:
goat 2020-03-31 23:43:15 +09:00
parent fb42419b5d
commit 4d6f7762e6

View file

@ -142,11 +142,6 @@ namespace Dalamud.Plugin
// DisablePlugin() below immediately creates a .disabled file anyway, but will fail
// with an exception if we try to do it twice in row like this
// TODO: not sure if doing this for all versions is really necessary, since the
// others really needed to be disabled before anyway
//foreach (var sortedVersion in sortedVersions) {
// File.Create(Path.Combine(sortedVersion.FullName, ".disabled"));
//}
if (!dryRun)
{
@ -161,6 +156,18 @@ namespace Dalamud.Plugin
hasError = true;
}
try {
// Just to be safe
foreach (var sortedVersion in sortedVersions)
{
var disabledFile = new FileInfo(Path.Combine(sortedVersion.FullName, ".disabled"));
if (!disabledFile.Exists)
disabledFile.Create();
}
} catch (Exception ex) {
Log.Error(ex, "Plugin disable failed");
}
var installSuccess = InstallPlugin(remoteInfo);
if (installSuccess)