diff --git a/SM64RomManager.UpdateInstallerAddOn/AddOn.cs b/SM64RomManager.UpdateInstallerAddOn/AddOn.cs
index c77261b..0cd483e 100644
--- a/SM64RomManager.UpdateInstallerAddOn/AddOn.cs
+++ b/SM64RomManager.UpdateInstallerAddOn/AddOn.cs
@@ -1,19 +1,28 @@
-using global::System.IO;
-using global::Pilz.Updating.UpdateInstaller;
+using System.IO;
+using Pilz.Updating.UpdateInstaller.Lib;
+using Pilz.Plugins;
namespace UpdateInstaller
{
- public static class AddOn
+ public class AddOn : IPlugin
{
- public static void Main(UpdateInstallerConfig config, bool isAfterCopyFiles)
+ public string Name => "SM64 ROM Manager UpdateInstaller AddOn";
+
+ public AddOn(Pilz.Updating.UpdateInstaller.Lib.UpdateInstaller installer)
{
- if (!isAfterCopyFiles /*&& config.NewApplicationVersion is null && config.CurrentApplicationVersion is null*/)
+ installer.OnStep += Installer_OnStep;
+ }
+
+ private void Installer_OnStep(object sender, UpdateInstallerStepEventArgs e)
+ {
+ if (e.Step == UpdateInstallerStep.CopyFiles && e.State == UpdateInstallerStepState.PostEvent
+ /*&& config.NewApplicationVersion is null && config.CurrentApplicationVersion is null*/)
{
- Directory.Delete(Path.Combine(config.HostApplicationPath, @"Data\Importer Presets"), true);
+ Directory.Delete(Path.Combine(e.UpdateInstaller.Configuration.HostApplicationPath, @"Data\Importer Presets"), true);
- Directory.Delete(Path.Combine(config.HostApplicationPath, @"Data\Tweaks\Reviewed"), true);
+ Directory.Delete(Path.Combine(e.UpdateInstaller.Configuration.HostApplicationPath, @"Data\Tweaks\Reviewed"), true);
- var pCustomObjectDatabase = Path.Combine(config.HostApplicationPath, @"Data\Custom Objects\Reviewed");
+ var pCustomObjectDatabase = Path.Combine(e.UpdateInstaller.Configuration.HostApplicationPath, @"Data\Custom Objects\Reviewed");
if (Directory.Exists(pCustomObjectDatabase))
Directory.Delete(pCustomObjectDatabase, true);
}
diff --git a/SM64RomManager.UpdateInstallerAddOn/My Project/Application.Designer.cs b/SM64RomManager.UpdateInstallerAddOn/My Project/Application.Designer.cs
deleted file mode 100644
index 5e9e2a0..0000000
--- a/SM64RomManager.UpdateInstallerAddOn/My Project/Application.Designer.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// ------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-// ------------------------------------------------------------------------------
-
-
diff --git a/SM64RomManager.UpdateInstallerAddOn/My Project/Application.myapp b/SM64RomManager.UpdateInstallerAddOn/My Project/Application.myapp
deleted file mode 100644
index 758895d..0000000
--- a/SM64RomManager.UpdateInstallerAddOn/My Project/Application.myapp
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
- false
- false
- 0
- true
- 0
- 1
- true
-
diff --git a/SM64RomManager.UpdateInstallerAddOn/My Project/MyNamespace.Static.1.Designer.cs b/SM64RomManager.UpdateInstallerAddOn/My Project/MyNamespace.Static.1.Designer.cs
deleted file mode 100644
index 30a4e3f..0000000
--- a/SM64RomManager.UpdateInstallerAddOn/My Project/MyNamespace.Static.1.Designer.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Diagnostics;
-using Microsoft.VisualBasic;
-
-/* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
-/* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia */
-/* TODO ERROR: Skipped DefineDirectiveTrivia *//* TODO ERROR: Skipped DefineDirectiveTrivia *//* TODO ERROR: Skipped DefineDirectiveTrivia *//* TODO ERROR: Skipped DefineDirectiveTrivia */
-/* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
-/* TODO ERROR: Skipped IfDirectiveTrivia */
-namespace SM64RomManager.UpdateInstallerAddOn.My
-{
-
- /* TODO ERROR: Skipped IfDirectiveTrivia */
- [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")]
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
-
- /* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped ElifDirectiveTrivia */
- internal partial class MyApplication : Microsoft.VisualBasic.ApplicationServices.ApplicationBase
- {
- /* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
- }
-
- /* TODO ERROR: Skipped EndIfDirectiveTrivia */
- /* TODO ERROR: Skipped IfDirectiveTrivia */
- [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")]
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
-
- /* TODO ERROR: Skipped IfDirectiveTrivia */
- internal partial class MyComputer : Microsoft.VisualBasic.Devices.Computer
- {
- /* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
- [DebuggerHidden()]
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- public MyComputer() : base()
- {
- }
- }
- /* TODO ERROR: Skipped EndIfDirectiveTrivia */
- [HideModuleName()]
- [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")]
- internal static class MyProject
- {
-
- /* TODO ERROR: Skipped IfDirectiveTrivia */
- [System.ComponentModel.Design.HelpKeyword("My.Computer")]
- internal static MyComputer Computer
- {
- [DebuggerHidden()]
- get
- {
- return m_ComputerObjectProvider.GetInstance;
- }
- }
-
- private readonly static ThreadSafeObjectProvider m_ComputerObjectProvider = new ThreadSafeObjectProvider();
- /* TODO ERROR: Skipped EndIfDirectiveTrivia */
- /* TODO ERROR: Skipped IfDirectiveTrivia */
- [System.ComponentModel.Design.HelpKeyword("My.Application")]
- internal static MyApplication Application
- {
- [DebuggerHidden()]
- get
- {
- return m_AppObjectProvider.GetInstance;
- }
- }
-
- private readonly static ThreadSafeObjectProvider m_AppObjectProvider = new ThreadSafeObjectProvider();
- /* TODO ERROR: Skipped EndIfDirectiveTrivia */
- /* TODO ERROR: Skipped IfDirectiveTrivia */
- [System.ComponentModel.Design.HelpKeyword("My.User")]
- internal static Microsoft.VisualBasic.ApplicationServices.User User
- {
- [DebuggerHidden()]
- get
- {
- return m_UserObjectProvider.GetInstance;
- }
- }
-
- private readonly static ThreadSafeObjectProvider m_UserObjectProvider = new ThreadSafeObjectProvider();
- /* TODO ERROR: Skipped ElifDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
- /* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
- /* TODO ERROR: Skipped IfDirectiveTrivia */
- [System.ComponentModel.Design.HelpKeyword("My.WebServices")]
- internal static MyWebServices WebServices
- {
- [DebuggerHidden()]
- get
- {
- return m_MyWebServicesObjectProvider.GetInstance;
- }
- }
-
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- [MyGroupCollection("System.Web.Services.Protocols.SoapHttpClientProtocol", "Create__Instance__", "Dispose__Instance__", "")]
- internal sealed class MyWebServices
- {
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- [DebuggerHidden()]
- public override bool Equals(object o)
- {
- return base.Equals(o);
- }
-
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- [DebuggerHidden()]
- public override int GetHashCode()
- {
- return base.GetHashCode();
- }
-
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- [DebuggerHidden()]
- internal new Type GetType()
- {
- return typeof(MyWebServices);
- }
-
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- [DebuggerHidden()]
- public override string ToString()
- {
- return base.ToString();
- }
-
- [DebuggerHidden()]
- private static T Create__Instance__(T instance) where T : new()
- {
- if (instance == null)
- {
- return new T();
- }
- else
- {
- return instance;
- }
- }
-
- [DebuggerHidden()]
- private void Dispose__Instance__(ref T instance)
- {
- instance = default;
- }
-
- [DebuggerHidden()]
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- public MyWebServices() : base()
- {
- }
- }
-
- private readonly static ThreadSafeObjectProvider m_MyWebServicesObjectProvider = new ThreadSafeObjectProvider();
- /* TODO ERROR: Skipped EndIfDirectiveTrivia */
- /* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- [System.Runtime.InteropServices.ComVisible(false)]
- internal sealed class ThreadSafeObjectProvider where T : new()
- {
- internal T GetInstance
- {
- /* TODO ERROR: Skipped IfDirectiveTrivia */
- [DebuggerHidden()]
- get
- {
- var Value = m_Context.Value;
- if (Value == null)
- {
- Value = new T();
- m_Context.Value = Value;
- }
-
- return Value;
- }
- /* TODO ERROR: Skipped ElseDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
- }
-
- [DebuggerHidden()]
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- public ThreadSafeObjectProvider() : base()
- {
- }
-
- /* TODO ERROR: Skipped IfDirectiveTrivia */
- private readonly Microsoft.VisualBasic.MyServices.Internal.ContextValue m_Context = new Microsoft.VisualBasic.MyServices.Internal.ContextValue();
- /* TODO ERROR: Skipped ElseDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */
- }
- }
-}
-/* TODO ERROR: Skipped EndIfDirectiveTrivia */
diff --git a/SM64RomManager.UpdateInstallerAddOn/My Project/MyNamespace.Static.2.Designer.cs b/SM64RomManager.UpdateInstallerAddOn/My Project/MyNamespace.Static.2.Designer.cs
deleted file mode 100644
index dc16ca1..0000000
--- a/SM64RomManager.UpdateInstallerAddOn/My Project/MyNamespace.Static.2.Designer.cs
+++ /dev/null
@@ -1,253 +0,0 @@
-// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-// See Compiler::LoadXmlSolutionExtension
-using System.Collections;
-using System.Collections.Generic;
-using System.Data;
-using System.Diagnostics;
-using System.Linq;
-using System.Xml.Linq;
-using Microsoft.VisualBasic;
-using Microsoft.VisualBasic.CompilerServices;
-
-namespace SM64RomManager.UpdateInstallerAddOn.My
-{
- [Embedded()]
- [DebuggerNonUserCode()]
- [System.Runtime.CompilerServices.CompilerGenerated()]
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- internal sealed class InternalXmlHelper
- {
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- private InternalXmlHelper()
- {
- }
-
- public static string get_Value(IEnumerable source)
- {
- foreach (XElement item in source)
- return item.Value;
- return null;
- }
-
- public static void set_Value(IEnumerable source, string value)
- {
- foreach (XElement item in source)
- {
- item.Value = value;
- break;
- }
- }
-
- public static string get_AttributeValue(IEnumerable source, XName name)
- {
- foreach (XElement item in source)
- return Conversions.ToString(item.Attribute(name));
- return null;
- }
-
- public static void set_AttributeValue(IEnumerable source, XName name, string value)
- {
- foreach (XElement item in source)
- {
- item.SetAttributeValue(name, value);
- break;
- }
- }
-
- public static string get_AttributeValue(XElement source, XName name)
- {
- return Conversions.ToString(source.Attribute(name));
- }
-
- public static void set_AttributeValue(XElement source, XName name, string value)
- {
- source.SetAttributeValue(name, value);
- }
-
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- public static XAttribute CreateAttribute(XName name, object value)
- {
- if (value is null)
- {
- return null;
- }
-
- return new XAttribute(name, value);
- }
-
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- public static XAttribute CreateNamespaceAttribute(XName name, XNamespace ns)
- {
- var a = new XAttribute(name, ns.NamespaceName);
- a.AddAnnotation(ns);
- return a;
- }
-
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- public static object RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, object obj)
- {
- if (obj is object)
- {
- XElement elem = obj as XElement;
- if (elem is object)
- {
- return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elem);
- }
- else
- {
- IEnumerable elems = obj as IEnumerable;
- if (elems is object)
- {
- return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elems);
- }
- }
- }
-
- return obj;
- }
-
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- public static IEnumerable RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, IEnumerable obj)
- {
- if (obj is object)
- {
- IEnumerable elems = obj as IEnumerable;
- if (elems is object)
- {
- return elems.Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessXElement);
- }
- else
- {
- return obj.Cast