some fixes
This commit is contained in:
parent
c201f11ce1
commit
4ae26cab92
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using DTLib.Filesystem;
|
||||
|
||||
namespace dtlauncher_client_win
|
||||
{
|
||||
@ -12,23 +13,21 @@ namespace dtlauncher_client_win
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
base.OnStartup(e);
|
||||
string[] args = e.Args;
|
||||
try
|
||||
{
|
||||
if (args.Length > 0 && args[0] == "updated")
|
||||
if (e.Args.Length > 0 && e.Args[0] == "updated")
|
||||
{
|
||||
LoginWindow window = new();
|
||||
window.ShowDialog();
|
||||
}
|
||||
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)
|
||||
{
|
||||
MessageBox.Show($"STARTUP ERROR:\n{ex.Message}\n{ex.StackTrace}");
|
||||
}
|
||||
{ MessageBox.Show($"STARTUP ERROR:\n{ex.Message}\n{ex.StackTrace}"); }
|
||||
//Current.Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,6 +65,7 @@
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LauncherConfig.cs" />
|
||||
<Compile Include="LauncherWindow.xaml.cs">
|
||||
<DependentUpon>LauncherWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@ -51,11 +51,11 @@ namespace updater
|
||||
// обновление апдейтера
|
||||
if (args.Length == 0 || args[0] != "updated")
|
||||
{
|
||||
fsp.DownloadFile("dtlauncher.exe", "TEMP\\dtlauncher.exe");
|
||||
Log("g", "dtlauncher.exe downloaded\n");
|
||||
fsp.DownloadFile("updater.exe", "TEMP\\updater.exe");
|
||||
Log("g", "updater.exe downloaded\n");
|
||||
fsp.DownloadFile("DTLib.dll", "TEMP\\DTLib.dll");
|
||||
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
|
||||
{
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<ProjectGuid>{4784D974-A342-4202-9430-90FE5AC00FC7}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>updater</RootNamespace>
|
||||
<AssemblyName>dtlauncher</AssemblyName>
|
||||
<AssemblyName>updater</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<LangVersion>9.0</LangVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
@ -83,10 +83,10 @@
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>del /f /q dtlauncher.exe.config
|
||||
copy dtlauncher.exe ..\..\dtlauncher-server-win\bin\share\client\dtlauncher.exe
|
||||
<PostBuildEvent>del /f /q updater.exe.config
|
||||
copy updater.exe ..\..\dtlauncher-server-win\bin\share\client\updater.exe
|
||||
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
|
||||
|
||||
</PostBuildEvent>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user