This commit is contained in:
mikx 2020-11-14 15:39:42 -05:00
parent 96f29efd96
commit 3cdeed815f
10 changed files with 544 additions and 0 deletions

25
MxWa.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30503.244
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MxWa", "MxWa\MxWa.csproj", "{834F795E-DAE8-4BF7-A411-8F75D13FB301}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{834F795E-DAE8-4BF7-A411-8F75D13FB301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{834F795E-DAE8-4BF7-A411-8F75D13FB301}.Debug|Any CPU.Build.0 = Debug|Any CPU
{834F795E-DAE8-4BF7-A411-8F75D13FB301}.Release|Any CPU.ActiveCfg = Release|Any CPU
{834F795E-DAE8-4BF7-A411-8F75D13FB301}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {79B18C3C-A15F-4E0B-B23C-67B107BC0382}
EndGlobalSection
EndGlobal

6
MxWa/App.config Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

3
MxWa/FodyWeavers.xml Normal file
View File

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<Costura />
</Weavers>

111
MxWa/FodyWeavers.xsd Normal file
View File

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="Costura" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:all>
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="IncludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged64Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="PreloadOrder" type="xs:string">
<xs:annotation>
<xs:documentation>The order of preloaded assemblies, delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
<xs:attribute name="CreateTemporaryAssemblies" type="xs:boolean">
<xs:annotation>
<xs:documentation>This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeDebugSymbols" type="xs:boolean">
<xs:annotation>
<xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCompression" type="xs:boolean">
<xs:annotation>
<xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCleanup" type="xs:boolean">
<xs:annotation>
<xs:documentation>As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="LoadAtModuleInit" type="xs:boolean">
<xs:annotation>
<xs:documentation>Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IgnoreSatelliteAssemblies" type="xs:boolean">
<xs:annotation>
<xs:documentation>Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ExcludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged64Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="PreloadOrder" type="xs:string">
<xs:annotation>
<xs:documentation>The order of preloaded assemblies, delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

76
MxWa/MxWa.csproj Normal file
View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.2.0.306\build\net46\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.2.0.306\build\net46\LibGit2Sharp.NativeBinaries.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{834F795E-DAE8-4BF7-A411-8F75D13FB301}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>MxWa</RootNamespace>
<AssemblyName>MxWa</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>mxw%282%29.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="LibGit2Sharp, Version=0.26.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333, processorArchitecture=MSIL">
<HintPath>..\packages\LibGit2Sharp.0.26.2\lib\net46\LibGit2Sharp.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="msg.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="mxw%282%29.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.2.0.306\build\net46\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.2.0.306\build\net46\LibGit2Sharp.NativeBinaries.props'))" />
</Target>
</Project>

71
MxWa/Program.cs Normal file
View File

@ -0,0 +1,71 @@
using LibGit2Sharp;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Security.AccessControl;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
namespace MxWa
{
public class Addon
{
public string name { get; set; }
public string git { get; set; }
}
public class Root
{
public List<Addon> addons { get; set; }
}
class Program
{
public static string version = "1.0.0";
static void Main(string[] args)
{
msg.Splash();
string listurl = @"https://wow.mikx.xyz/mxwa/addons.json";
WebClient web = new WebClient();
var js = web.DownloadString(listurl);
Root lj = JsonConvert.DeserializeObject<Root>(js);
foreach (var a in lj.addons)
{
if (Directory.Exists($@"AddOns\{a.name}"))
{
msg.CMW($"Fixing [{a.name}] folder permissions...",true,1);
FixPermission($@"AddOns\{a.name}");
msg.CMW($"Deleting old [{a.name}] files...", true, 1);
Directory.Delete($@"AddOns\{a.name}", true);
msg.CMW($"Installing latest [{a.name}] data...", true, 1);
Repository.Clone(a.git, $@"AddOns\{a.name}");
}
else
{
msg.CMW($"Installing latest [{a.name}] data...", true, 1);
Repository.Clone(a.git, $@"AddOns\{a.name}");
}
}
}
static void FixPermission(string path)
{
var dl = Directory.GetDirectories(path, "*", SearchOption.AllDirectories);
foreach (var d in dl)
{
var fl = Directory.GetFiles(d);
foreach (var f in fl)
{
File.SetAttributes(f, FileAttributes.Normal);
}
}
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Les informations générales relatives à un assembly dépendent de
// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
// associées à un assembly.
[assembly: AssemblyTitle("MxWa")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MxWa")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
// COM, affectez la valeur true à l'attribut ComVisible sur ce type.
[assembly: ComVisible(false)]
// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
[assembly: Guid("834f795e-dae8-4bf7-a411-8f75d13fb301")]
// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
//
// Version principale
// Version secondaire
// Numéro de build
// Révision
//
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme indiqué ci-dessous :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

210
MxWa/msg.cs Normal file
View File

@ -0,0 +1,210 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MxWa
{
class msg
{
public static void CM(string msg, bool time, int color)
{
string seconds = "";
string minutes = "";
string hours = "";
if (DateTime.Now.Second < 10)
{
seconds = String.Format("0{0}", DateTime.Now.Second);
}
else
{
seconds = DateTime.Now.Second.ToString();
}
if (DateTime.Now.Minute < 10)
{
minutes = String.Format("0{0}", DateTime.Now.Minute);
}
else
{
minutes = DateTime.Now.Minute.ToString();
}
if (DateTime.Now.Hour < 10)
{
hours = String.Format("0{0}", DateTime.Now.Hour);
}
else
{
hours = DateTime.Now.Hour.ToString();
}
string date = String.Format("{0}:{1}:{2}", hours, minutes, seconds);
//color switch
ConsoleColor cc = ConsoleColor.White;
switch (color)
{
case 0:
//nothing
break;
case 1:
cc = ConsoleColor.Cyan;
break;
case 2:
cc = ConsoleColor.Green;
break;
case 3:
cc = ConsoleColor.Red;
break;
}
if (time)
{
Console.ForegroundColor = cc;
Console.WriteLine(String.Format("[{0}] {1}", date, msg));
}
else
{
Console.ForegroundColor = cc;
Console.WriteLine(String.Format("{0}", msg));
}
Console.ForegroundColor = ConsoleColor.White;
}
public static void CMW(string msg, bool time, int color)
{
string seconds = "";
string minutes = "";
string hours = "";
if (DateTime.Now.Second < 10)
{
seconds = String.Format("0{0}", DateTime.Now.Second);
}
else
{
seconds = DateTime.Now.Second.ToString();
}
if (DateTime.Now.Minute < 10)
{
minutes = String.Format("0{0}", DateTime.Now.Minute);
}
else
{
minutes = DateTime.Now.Minute.ToString();
}
if (DateTime.Now.Hour < 10)
{
hours = String.Format("0{0}", DateTime.Now.Hour);
}
else
{
hours = DateTime.Now.Hour.ToString();
}
string date = String.Format("{0}:{1}:{2}", hours, minutes, seconds);
File.AppendAllText("mxfiltergen.logs", String.Format("[{0}] {1}", date, msg) + Environment.NewLine);
//color switch
ConsoleColor cc = ConsoleColor.White;
switch (color)
{
case 0:
//nothing
break;
case 1:
cc = ConsoleColor.Cyan;
break;
case 2:
cc = ConsoleColor.Green;
break;
case 3:
cc = ConsoleColor.Red;
break;
}
if (time)
{
Console.ForegroundColor = cc;
Console.WriteLine(String.Format("[{0}] {1}", date, msg));
}
else
{
Console.ForegroundColor = cc;
Console.WriteLine(String.Format(""));
}
Console.ForegroundColor = ConsoleColor.White;
}
public static void drawProgress(int progress, int total)
{
string seconds = "";
string minutes = "";
string hours = "";
if (DateTime.Now.Second < 10)
{
seconds = String.Format("0{0}", DateTime.Now.Second);
}
else
{
seconds = DateTime.Now.Second.ToString();
}
if (DateTime.Now.Minute < 10)
{
minutes = String.Format("0{0}", DateTime.Now.Minute);
}
else
{
minutes = DateTime.Now.Minute.ToString();
}
if (DateTime.Now.Hour < 10)
{
hours = String.Format("0{0}", DateTime.Now.Hour);
}
else
{
hours = DateTime.Now.Hour.ToString();
}
string date = String.Format("{0}:{1}:{2}", hours, minutes, seconds);
string beg = String.Format("[{0}] [", date);
Console.ForegroundColor = ConsoleColor.Cyan;
if (progress == 1)
{
Console.Write(beg);
Console.CursorLeft = total + beg.Length;
Console.Write("]");
}
Console.CursorLeft = (progress + beg.Length) - 1;
Console.Write($"#");
Console.CursorLeft = beg.Length + total + 2;
Console.Write($"{progress}/{total}");
if (progress == total)
{
Console.WriteLine();
}
}
public static void Splash()
{
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("");
Console.WriteLine("#### MxWa");
Console.WriteLine(string.Format("#### VERSION: {0}", Program.version));
Console.WriteLine("#### DEV: mikx");
Console.WriteLine("#### wow.mikx.xyz");
Console.WriteLine("");
Console.ForegroundColor = ConsoleColor.White;
}
}
}

BIN
MxWa/mxw(2).ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

6
MxWa/packages.config Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="LibGit2Sharp" version="0.26.2" targetFramework="net472" />
<package id="LibGit2Sharp.NativeBinaries" version="2.0.306" targetFramework="net472" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" />
</packages>