This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
forked from 6get-xiaofan/WonderLab
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b96f7a
commit 878f90d
Showing
241 changed files
with
3,152 additions
and
504 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-674 KB
.vs/WonderLabX/FileContentIndex/2abdc92b-150d-45a4-a0be-522199a42608.vsidx
Binary file not shown.
Binary file renamed
BIN
+28.3 KB
...e6fbce5-5a45-4bf6-bcfd-09dd406dcdf9.vsidx → ...a35284c-cdcb-47fd-8d73-f9dee5d83e00.vsidx
Binary file not shown.
Binary file added
BIN
+676 KB
.vs/WonderLabX/FileContentIndex/87ffcb04-cb35-4b07-af4a-ef611dd08b84.vsidx
Binary file not shown.
Binary file added
BIN
+34.4 KB
.vs/WonderLabX/FileContentIndex/ab60c65f-a9a7-43b7-8a05-f65ea51d2ee0.vsidx
Binary file not shown.
Binary file removed
BIN
-27.1 KB
.vs/WonderLabX/FileContentIndex/ba3c7986-fdbb-4061-bfeb-09129264590c.vsidx
Binary file not shown.
Binary file renamed
BIN
+36.5 KB
...459de76-38e6-447d-ae8a-a40c24950670.vsidx → ...840509f-20a3-47c5-add6-921f1bb2cb34.vsidx
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
using System.Diagnostics; | ||
using System.IO.Compression; | ||
|
||
namespace Updataer | ||
{ | ||
public class Updataer | ||
{ | ||
/// <summary> | ||
/// 解压Zip文件到指定目录 | ||
/// </summary> | ||
/// <param name="zipPath">zip地址</param> | ||
/// <param name="folderPath">文件夹地址</param> | ||
public static void DecompressZip(string zipPath, string folderPath) | ||
{ | ||
DirectoryInfo directoryInfo = new(folderPath); | ||
|
||
if (!directoryInfo.Exists) | ||
{ | ||
directoryInfo.Create(); | ||
} | ||
|
||
try | ||
{ | ||
//Declare a temporary path to unzip your files | ||
string tempPath = Path.Combine(Directory.GetCurrentDirectory(), "tempUnzip"); | ||
string extractPath = Directory.GetCurrentDirectory(); | ||
ZipFile.ExtractToDirectory(zipPath, tempPath); | ||
|
||
//build an array of the unzipped files | ||
string[] files = Directory.GetFiles(tempPath); | ||
|
||
foreach (string file in files) | ||
{ | ||
FileInfo f = new FileInfo(file); | ||
//Check if the file exists already, if so delete it and then move the new file to the extract folder | ||
if (File.Exists(Path.Combine(extractPath, f.Name))) | ||
{ | ||
File.Delete(Path.Combine(extractPath, f.Name)); | ||
File.Move(f.FullName, Path.Combine(extractPath, f.Name)); | ||
} | ||
else | ||
{ | ||
File.Move(f.FullName, Path.Combine(extractPath, f.Name)); | ||
} | ||
} | ||
//Delete the temporary directory. | ||
Directory.Delete(tempPath); | ||
} | ||
catch (Exception) | ||
{ | ||
|
||
} | ||
} | ||
public static void Main(string[] args) | ||
{ | ||
Thread.Sleep(1000); | ||
if(args.Length == 0) | ||
{ | ||
if(File.Exists(Path.Combine(Path.GetTempPath(), "WonderLab-updata.exe"))) | ||
{ | ||
File.Delete(Path.Combine(Path.GetTempPath(), "WonderLab-updata.exe")); | ||
} | ||
File.Copy("Updata.exe", Path.Combine(Path.GetTempPath(), "WonderLab-updata.exe")); | ||
if (File.Exists(Path.Combine(Path.GetTempPath(), "Updata.dll"))) | ||
{ | ||
File.Delete(Path.Combine(Path.GetTempPath(), "Updata.dll")); | ||
} | ||
File.Copy("Updata.dll", Path.Combine(Path.GetTempPath(), "Updata.dll")); | ||
if (File.Exists(Path.Combine(Path.GetTempPath(), "Updata.deps.json"))) | ||
{ | ||
File.Delete(Path.Combine(Path.GetTempPath(), "Updata.deps.json")); | ||
} | ||
File.Copy("Updata.deps.json", Path.Combine(Path.GetTempPath(), "Updata.deps.json")); | ||
if (File.Exists(Path.Combine(Path.GetTempPath(), "Updata.runtimeconfig.json"))) | ||
{ | ||
File.Delete(Path.Combine(Path.GetTempPath(), "Updata.runtimeconfig.json")); | ||
} | ||
File.Copy("Updata.runtimeconfig.json", Path.Combine(Path.GetTempPath(), "Updata.runtimeconfig.json")); | ||
Process pro = new Process(); | ||
pro.StartInfo.FileName = Path.Combine(Path.GetTempPath(), "WonderLab-updata.exe"); | ||
pro.StartInfo.Arguments = "-updata " + Path.Combine("updata-cache", "updata.zip") + " " + Path.Combine(Environment.CurrentDirectory) + " " + Path.Combine(System.Environment.CurrentDirectory,"WonderLab.exe"); | ||
File.Delete(Path.Combine("updata-cache", "UpdataNextTime")); | ||
pro.Start(); | ||
return; | ||
} | ||
else if(args.Length == 4) | ||
{ | ||
if(args[0] == "-updata") | ||
{ | ||
DecompressZip(args[1], args[2]); | ||
Process pro = new Process(); | ||
pro.StartInfo.FileName = args[3]; | ||
pro.Start(); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"runtimeTarget": { | ||
"name": ".NETCoreApp,Version=v6.0", | ||
"signature": "" | ||
}, | ||
"compilationOptions": {}, | ||
"targets": { | ||
".NETCoreApp,Version=v6.0": { | ||
"Updata/1.0.0": { | ||
"runtime": { | ||
"Updata.dll": {} | ||
} | ||
} | ||
} | ||
}, | ||
"libraries": { | ||
"Updata/1.0.0": { | ||
"type": "project", | ||
"serviceable": false, | ||
"sha512": "" | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"runtimeOptions": { | ||
"tfm": "net6.0", | ||
"framework": { | ||
"name": "Microsoft.NETCore.App", | ||
"version": "6.0.0" | ||
} | ||
} | ||
} |
Oops, something went wrong.