some fixes
This commit is contained in:
parent
c201f11ce1
commit
4ae26cab92
@ -1,35 +1,34 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using DTLib.Filesystem;
|
||||||
namespace dtlauncher_client_win
|
|
||||||
{
|
namespace dtlauncher_client_win
|
||||||
/// <summary>
|
{
|
||||||
/// Логика взаимодействия для App.xaml
|
/// <summary>
|
||||||
/// </summary>
|
/// Логика взаимодействия для App.xaml
|
||||||
public partial class App : Application
|
/// </summary>
|
||||||
{
|
public partial class App : Application
|
||||||
protected override void OnStartup(StartupEventArgs e)
|
{
|
||||||
{
|
protected override void OnStartup(StartupEventArgs e)
|
||||||
base.OnStartup(e);
|
{
|
||||||
string[] args = e.Args;
|
base.OnStartup(e);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (args.Length > 0 && args[0] == "updated")
|
if (e.Args.Length > 0 && e.Args[0] == "updated")
|
||||||
{
|
{
|
||||||
LoginWindow window = new();
|
LoginWindow window = new();
|
||||||
window.ShowDialog();
|
window.ShowDialog();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Process.Start("cmd", "/c timeout 1 && start dtlauncher.exe");
|
if (!File.Exists("updater.exe")) throw new Exception("file <updater.exe> not found");
|
||||||
}
|
Process.Start("cmd", "/c timeout 1 && start updater.exe");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
}
|
||||||
{
|
catch (Exception ex)
|
||||||
MessageBox.Show($"STARTUP ERROR:\n{ex.Message}\n{ex.StackTrace}");
|
{ MessageBox.Show($"STARTUP ERROR:\n{ex.Message}\n{ex.StackTrace}"); }
|
||||||
}
|
//Current.Shutdown();
|
||||||
//Current.Shutdown();
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -1,131 +1,132 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProjectGuid>{367793EE-4757-4ADD-BF7E-960DC9EB6DF9}</ProjectGuid>
|
<ProjectGuid>{367793EE-4757-4ADD-BF7E-960DC9EB6DF9}</ProjectGuid>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<RootNamespace>dtlauncher_client_win</RootNamespace>
|
<RootNamespace>dtlauncher_client_win</RootNamespace>
|
||||||
<AssemblyName>dtlauncher-client-win</AssemblyName>
|
<AssemblyName>dtlauncher-client-win</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||||
<LangVersion>9.0</LangVersion>
|
<LangVersion>9.0</LangVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Build|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Build|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<DebugType>none</DebugType>
|
<DebugType>none</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\</OutputPath>
|
<OutputPath>bin\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<StartupObject>dtlauncher_client_win.App</StartupObject>
|
<StartupObject>dtlauncher_client_win.App</StartupObject>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ApplicationIcon>logo-D.ico</ApplicationIcon>
|
<ApplicationIcon>logo-D.ico</ApplicationIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
<Reference Include="System.Xaml">
|
<Reference Include="System.Xaml">
|
||||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ApplicationDefinition Include="App.xaml">
|
<ApplicationDefinition Include="App.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
<Page Include="LauncherWindow.xaml">
|
<Page Include="LauncherWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="LoginWindow.xaml">
|
<Page Include="LoginWindow.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Compile Include="App.xaml.cs">
|
<Compile Include="App.xaml.cs">
|
||||||
<DependentUpon>App.xaml</DependentUpon>
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="LauncherWindow.xaml.cs">
|
<Compile Include="LauncherConfig.cs" />
|
||||||
<DependentUpon>LauncherWindow.xaml</DependentUpon>
|
<Compile Include="LauncherWindow.xaml.cs">
|
||||||
</Compile>
|
<DependentUpon>LauncherWindow.xaml</DependentUpon>
|
||||||
<Compile Include="LoginWindow.xaml.cs">
|
</Compile>
|
||||||
<DependentUpon>LoginWindow.xaml</DependentUpon>
|
<Compile Include="LoginWindow.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<DependentUpon>LoginWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
<SubType>Code</SubType>
|
||||||
<Page Include="ProgramLabel.xaml">
|
</Compile>
|
||||||
<SubType>Designer</SubType>
|
<Page Include="ProgramLabel.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</ItemGroup>
|
</Page>
|
||||||
<ItemGroup>
|
</ItemGroup>
|
||||||
<Compile Include="ProgramLabel.xaml.cs">
|
<ItemGroup>
|
||||||
<DependentUpon>ProgramLabel.xaml</DependentUpon>
|
<Compile Include="ProgramLabel.xaml.cs">
|
||||||
</Compile>
|
<DependentUpon>ProgramLabel.xaml</DependentUpon>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
</Compile>
|
||||||
<SubType>Code</SubType>
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
</Compile>
|
<SubType>Code</SubType>
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
</Compile>
|
||||||
<AutoGen>True</AutoGen>
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
<DesignTime>True</DesignTime>
|
<AutoGen>True</AutoGen>
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<DesignTime>True</DesignTime>
|
||||||
</Compile>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
<Compile Include="Properties\Settings.Designer.cs">
|
</Compile>
|
||||||
<AutoGen>True</AutoGen>
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
</Compile>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
</Compile>
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
</EmbeddedResource>
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
<None Include="client.dtsod">
|
</EmbeddedResource>
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<None Include="client.dtsod">
|
||||||
</None>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
<None Include="Properties\Settings.settings">
|
</None>
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<None Include="Properties\Settings.settings">
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
</None>
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
</ItemGroup>
|
</None>
|
||||||
<ItemGroup>
|
</ItemGroup>
|
||||||
<None Include="App.config" />
|
<ItemGroup>
|
||||||
</ItemGroup>
|
<None Include="App.config" />
|
||||||
<ItemGroup>
|
</ItemGroup>
|
||||||
<ProjectReference Include="..\..\DTLib\DTLib\DTLib.csproj">
|
<ItemGroup>
|
||||||
<Project>{ce793497-2d5c-42d8-b311-e9b32af9cdfb}</Project>
|
<ProjectReference Include="..\..\DTLib\DTLib\DTLib.csproj">
|
||||||
<Name>DTLib</Name>
|
<Project>{ce793497-2d5c-42d8-b311-e9b32af9cdfb}</Project>
|
||||||
</ProjectReference>
|
<Name>DTLib</Name>
|
||||||
<ProjectReference Include="..\dtscript\dtscript.csproj">
|
</ProjectReference>
|
||||||
<Project>{e02ea967-fd29-47d2-b25b-ba684b784aee}</Project>
|
<ProjectReference Include="..\dtscript\dtscript.csproj">
|
||||||
<Name>dtscript</Name>
|
<Project>{e02ea967-fd29-47d2-b25b-ba684b784aee}</Project>
|
||||||
</ProjectReference>
|
<Name>dtscript</Name>
|
||||||
</ItemGroup>
|
</ProjectReference>
|
||||||
<ItemGroup>
|
</ItemGroup>
|
||||||
<Resource Include="logo-D.ico" />
|
<ItemGroup>
|
||||||
</ItemGroup>
|
<Resource Include="logo-D.ico" />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PostBuildEvent>del /f /q dtlauncher-client-win.exe.config
|
<PropertyGroup>
|
||||||
copy dtlauncher-client-win.exe ..\..\dtlauncher-server-win\bin\share\client\dtlauncher-client-win.exe
|
<PostBuildEvent>del /f /q dtlauncher-client-win.exe.config
|
||||||
copy client.dtsod ..\..\dtlauncher-server-win\bin\share\client\client.dtsod</PostBuildEvent>
|
copy dtlauncher-client-win.exe ..\..\dtlauncher-server-win\bin\share\client\dtlauncher-client-win.exe
|
||||||
</PropertyGroup>
|
copy client.dtsod ..\..\dtlauncher-server-win\bin\share\client\client.dtsod</PostBuildEvent>
|
||||||
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@ -1,98 +1,98 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using DTLib;
|
using DTLib;
|
||||||
using DTLib.Filesystem;
|
using DTLib.Filesystem;
|
||||||
using DTLib.Network;
|
using DTLib.Network;
|
||||||
using DTLib.Extensions;
|
using DTLib.Extensions;
|
||||||
|
|
||||||
namespace updater
|
namespace updater
|
||||||
{
|
{
|
||||||
class Updater
|
class Updater
|
||||||
{
|
{
|
||||||
static readonly string logfile = $"logs\\updater-{DateTime.Now}.log".Replace(':', '-').Replace(' ', '_');
|
static readonly string logfile = $"logs\\updater-{DateTime.Now}.log".Replace(':', '-').Replace(' ', '_');
|
||||||
static Socket mainSocket = new(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
static Socket mainSocket = new(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||||
static readonly string server_domain = "m1net.keenetic.pro";
|
static readonly string server_domain = "m1net.keenetic.pro";
|
||||||
static readonly int server_port = 25001;
|
static readonly int server_port = 25001;
|
||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Console.Title = "dtlauncher updater";
|
Console.Title = "dtlauncher updater";
|
||||||
Console.InputEncoding = Encoding.Unicode;
|
Console.InputEncoding = Encoding.Unicode;
|
||||||
Console.OutputEncoding = Encoding.Unicode;
|
Console.OutputEncoding = Encoding.Unicode;
|
||||||
PublicLog.LogEvent += Log;
|
PublicLog.LogEvent += Log;
|
||||||
PublicLog.LogNoTimeEvent += Log;
|
PublicLog.LogNoTimeEvent += Log;
|
||||||
// подключение к центральному серверу
|
// подключение к центральному серверу
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log("b", "server address: <", "c", server_domain, "b",
|
Log("b", "server address: <", "c", server_domain, "b",
|
||||||
">\nserver port: <", "c", server_port.ToString(), "b", ">\n");
|
">\nserver port: <", "c", server_port.ToString(), "b", ">\n");
|
||||||
mainSocket.Connect(new IPEndPoint(Dns.GetHostAddresses(server_domain)[0], server_port));
|
mainSocket.Connect(new IPEndPoint(Dns.GetHostAddresses(server_domain)[0], server_port));
|
||||||
Log("g", "connected to server\n");
|
Log("g", "connected to server\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
catch (SocketException ex)
|
catch (SocketException ex)
|
||||||
{
|
{
|
||||||
Log("r", $"updater.Main() error:\n{ex.Message}\n{ex.StackTrace}\n");
|
Log("r", $"updater.Main() error:\n{ex.Message}\n{ex.StackTrace}\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var fsp = new FSP(mainSocket);
|
var fsp = new FSP(mainSocket);
|
||||||
string recieved = mainSocket.GetPackage().BytesToString();
|
string recieved = mainSocket.GetPackage().BytesToString();
|
||||||
if (recieved != "requesting hash") throw new Exception("invalid server request");
|
if (recieved != "requesting hash") throw new Exception("invalid server request");
|
||||||
mainSocket.SendPackage(new byte[] { 255, 255, 255, 255, 255, 255, 255, 255 });
|
mainSocket.SendPackage(new byte[] { 255, 255, 255, 255, 255, 255, 255, 255 });
|
||||||
recieved = mainSocket.GetPackage().BytesToString();
|
recieved = mainSocket.GetPackage().BytesToString();
|
||||||
if (recieved != "updater") throw new Exception($"invalid central server answer <{recieved}>");
|
if (recieved != "updater") throw new Exception($"invalid central server answer <{recieved}>");
|
||||||
// обновление апдейтера
|
// обновление апдейтера
|
||||||
if (args.Length == 0 || args[0] != "updated")
|
if (args.Length == 0 || args[0] != "updated")
|
||||||
{
|
{
|
||||||
fsp.DownloadFile("dtlauncher.exe", "TEMP\\dtlauncher.exe");
|
fsp.DownloadFile("updater.exe", "TEMP\\updater.exe");
|
||||||
Log("g", "dtlauncher.exe downloaded\n");
|
Log("g", "updater.exe downloaded\n");
|
||||||
fsp.DownloadFile("DTLib.dll", "TEMP\\DTLib.dll");
|
fsp.DownloadFile("DTLib.dll", "TEMP\\DTLib.dll");
|
||||||
Log("g", "DTLib.dll downloaded\n");
|
Log("g", "DTLib.dll downloaded\n");
|
||||||
Process.Start("cmd", "/c timeout 0 && copy TEMP\\dtlauncher.exe dtlauncher.exe && copy TEMP\\DTLib.dll DTLib.dll && start dtlauncher.exe updated");
|
Process.Start("cmd", "/c timeout 0 && copy TEMP\\updater.exe updater.exe && copy TEMP\\DTLib.dll DTLib.dll && start updater.exe updated");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
// установка шрифтов
|
// установка шрифтов
|
||||||
/*Log("installing fonts\n");
|
/*Log("installing fonts\n");
|
||||||
Process.Start("fonts\\fontinst.exe");
|
Process.Start("fonts\\fontinst.exe");
|
||||||
Directory.Delete("TEMP");*/
|
Directory.Delete("TEMP");*/
|
||||||
Log("deleted TEMP\n");
|
Log("deleted TEMP\n");
|
||||||
fsp.DownloadFile("dtlauncher-client-win.exe", "dtlauncher-client-win.exe");
|
fsp.DownloadFile("dtlauncher-client-win.exe", "dtlauncher-client-win.exe");
|
||||||
Process.Start("dtlauncher-client-win.exe", "updated");
|
Process.Start("dtlauncher-client-win.exe", "updated");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log("r", $"updater.Main() error:\n{ex.Message}\n{ex.StackTrace}\n", "gray", "press any key to close...");
|
Log("r", $"updater.Main() error:\n{ex.Message}\n{ex.StackTrace}\n", "gray", "press any key to close...");
|
||||||
Console.ReadKey();
|
Console.ReadKey();
|
||||||
}
|
}
|
||||||
Log("gray", " \n");
|
Log("gray", " \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// вывод лога в консоль и файл
|
// вывод лога в консоль и файл
|
||||||
public static void Log(params string[] msg)
|
public static void Log(params string[] msg)
|
||||||
{
|
{
|
||||||
if (msg.Length == 1) msg[0] = "[" + DateTime.Now.ToString() + "]: " + msg[0];
|
if (msg.Length == 1) msg[0] = "[" + DateTime.Now.ToString() + "]: " + msg[0];
|
||||||
else msg[1] = "[" + DateTime.Now.ToString() + "]: " + msg[1];
|
else msg[1] = "[" + DateTime.Now.ToString() + "]: " + msg[1];
|
||||||
LogNoTime(msg);
|
LogNoTime(msg);
|
||||||
}
|
}
|
||||||
public static void LogNoTime(params string[] msg)
|
public static void LogNoTime(params string[] msg)
|
||||||
{
|
{
|
||||||
lock (new object())
|
lock (new object())
|
||||||
{
|
{
|
||||||
if (msg.Length == 1) File.AppendAllText(logfile, msg[0]);
|
if (msg.Length == 1) File.AppendAllText(logfile, msg[0]);
|
||||||
else if (msg.Length % 2 != 0) throw new Exception("incorrect array to log\n");
|
else if (msg.Length % 2 != 0) throw new Exception("incorrect array to log\n");
|
||||||
else File.AppendAllText(logfile, msg.MergeToString());
|
else File.AppendAllText(logfile, msg.MergeToString());
|
||||||
ColoredConsole.Write(msg);
|
ColoredConsole.Write(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,94 +1,94 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProjectGuid>{4784D974-A342-4202-9430-90FE5AC00FC7}</ProjectGuid>
|
<ProjectGuid>{4784D974-A342-4202-9430-90FE5AC00FC7}</ProjectGuid>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RootNamespace>updater</RootNamespace>
|
<RootNamespace>updater</RootNamespace>
|
||||||
<AssemblyName>dtlauncher</AssemblyName>
|
<AssemblyName>updater</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||||
<LangVersion>9.0</LangVersion>
|
<LangVersion>9.0</LangVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
<PublishUrl>publish\</PublishUrl>
|
<PublishUrl>publish\</PublishUrl>
|
||||||
<Install>true</Install>
|
<Install>true</Install>
|
||||||
<InstallFrom>Disk</InstallFrom>
|
<InstallFrom>Disk</InstallFrom>
|
||||||
<UpdateEnabled>false</UpdateEnabled>
|
<UpdateEnabled>false</UpdateEnabled>
|
||||||
<UpdateMode>Foreground</UpdateMode>
|
<UpdateMode>Foreground</UpdateMode>
|
||||||
<UpdateInterval>7</UpdateInterval>
|
<UpdateInterval>7</UpdateInterval>
|
||||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||||
<UpdatePeriodically>false</UpdatePeriodically>
|
<UpdatePeriodically>false</UpdatePeriodically>
|
||||||
<UpdateRequired>false</UpdateRequired>
|
<UpdateRequired>false</UpdateRequired>
|
||||||
<MapFileExtensions>true</MapFileExtensions>
|
<MapFileExtensions>true</MapFileExtensions>
|
||||||
<ApplicationRevision>0</ApplicationRevision>
|
<ApplicationRevision>0</ApplicationRevision>
|
||||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Build|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Build|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<DebugSymbols>false</DebugSymbols>
|
<DebugSymbols>false</DebugSymbols>
|
||||||
<DebugType>none</DebugType>
|
<DebugType>none</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\</OutputPath>
|
<OutputPath>bin\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ApplicationIcon>logo-D.ico</ApplicationIcon>
|
<ApplicationIcon>logo-D.ico</ApplicationIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Updater.cs" />
|
<Compile Include="Updater.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
|
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
|
||||||
<Visible>False</Visible>
|
<Visible>False</Visible>
|
||||||
<ProductName>Microsoft .NET Framework 4.8 %28x86 и x64%29</ProductName>
|
<ProductName>Microsoft .NET Framework 4.8 %28x86 и x64%29</ProductName>
|
||||||
<Install>true</Install>
|
<Install>true</Install>
|
||||||
</BootstrapperPackage>
|
</BootstrapperPackage>
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||||
<Visible>False</Visible>
|
<Visible>False</Visible>
|
||||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||||
<Install>false</Install>
|
<Install>false</Install>
|
||||||
</BootstrapperPackage>
|
</BootstrapperPackage>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="logo-D.ico" />
|
<Content Include="logo-D.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\DTLib\DTLib\DTLib.csproj">
|
<ProjectReference Include="..\..\DTLib\DTLib\DTLib.csproj">
|
||||||
<Project>{ce793497-2d5c-42d8-b311-e9b32af9cdfb}</Project>
|
<Project>{ce793497-2d5c-42d8-b311-e9b32af9cdfb}</Project>
|
||||||
<Name>DTLib</Name>
|
<Name>DTLib</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>del /f /q dtlauncher.exe.config
|
<PostBuildEvent>del /f /q updater.exe.config
|
||||||
copy dtlauncher.exe ..\..\dtlauncher-server-win\bin\share\client\dtlauncher.exe
|
copy updater.exe ..\..\dtlauncher-server-win\bin\share\client\updater.exe
|
||||||
copy DTLib.dll ..\..\dtlauncher-server-win\bin\share\client\DTLib.dll
|
copy DTLib.dll ..\..\dtlauncher-server-win\bin\share\client\DTLib.dll
|
||||||
copy dtlauncher.exe ..\..\release\dtlauncher.exe
|
copy updater.exe ..\..\release\updater.exe
|
||||||
copy DTLib.dll ..\..\release\DTLib.dll
|
copy DTLib.dll ..\..\release\DTLib.dll
|
||||||
|
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
Loading…
Reference in New Issue
Block a user