2025-07-16 01:07:51 +00:00
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using QuickMsg;
|
|
|
|
|
using ryCommon;
|
2024-12-21 06:16:03 +00:00
|
|
|
|
using System;
|
2021-09-03 09:36:09 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
2024-12-20 06:14:48 +00:00
|
|
|
|
using 开发辅助工具.Controls;
|
2021-09-03 09:36:09 +00:00
|
|
|
|
|
|
|
|
|
namespace 开发辅助工具
|
|
|
|
|
{
|
|
|
|
|
public class Init
|
|
|
|
|
{
|
2024-12-20 06:14:48 +00:00
|
|
|
|
static System.Threading.Mutex run;
|
2021-09-03 09:36:09 +00:00
|
|
|
|
public static void Show(string[] args)
|
|
|
|
|
{
|
|
|
|
|
if (args.Length >= 2)
|
|
|
|
|
{
|
|
|
|
|
if (args[0] == "ver")
|
|
|
|
|
{
|
|
|
|
|
string ProjectDir = args[1];
|
|
|
|
|
Manager.RyProject.UpdateVer(ProjectDir.Trim('"') + "\\Properties\\AssemblyInfo.cs");
|
|
|
|
|
}
|
|
|
|
|
else if (args[0] == "get")
|
|
|
|
|
{
|
|
|
|
|
string ProjectPath = args[1];
|
2025-07-16 01:07:51 +00:00
|
|
|
|
var bf_path = SuperDesign.Manager.APIManager.GetBFFolderPath(ProjectPath);
|
|
|
|
|
run = new System.Threading.Mutex(true, "S_"+rySafe.MD5Sha1.GetMD5(bf_path), out bool runone);
|
2024-12-20 06:14:48 +00:00
|
|
|
|
if (!runone) //已经运行了
|
|
|
|
|
{
|
2025-07-16 01:07:51 +00:00
|
|
|
|
object mainHandle = RyMemoryShare.ReadFromMemory(1024, typeof(Int64), "S_" + rySafe.MD5Sha1.GetMD5( bf_path) + ".z");
|
|
|
|
|
if (mainHandle != null)
|
2024-12-20 06:14:48 +00:00
|
|
|
|
{
|
2025-07-16 01:07:51 +00:00
|
|
|
|
JObject jo= new JObject();
|
|
|
|
|
jo["type"] = "project_update";
|
|
|
|
|
jo["path"] = ProjectPath;
|
|
|
|
|
MyDb.RyWin32.SendMsg(IntPtr.Zero,(IntPtr)(long)mainHandle, MyDb.RyWin32.Sys_chanel_id, jo.ToString());
|
2024-12-20 06:14:48 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2025-07-16 01:07:51 +00:00
|
|
|
|
Application.Run(new Form1(ProjectPath, "get"));
|
2024-12-20 06:14:48 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Application.Run(new Form1(ProjectPath, "get"));
|
|
|
|
|
}
|
2021-09-03 09:36:09 +00:00
|
|
|
|
}
|
|
|
|
|
else if (args[0] == "open")
|
|
|
|
|
{
|
|
|
|
|
string ProjectPath = args[1];
|
|
|
|
|
Application.Run(new Form1(ProjectPath, "open"));
|
|
|
|
|
}
|
2023-02-21 01:46:13 +00:00
|
|
|
|
}
|
|
|
|
|
else if(args.Length == 1)
|
|
|
|
|
{
|
2024-12-20 00:14:33 +00:00
|
|
|
|
Application.Run(new Form1("", ""));
|
2023-02-21 01:46:13 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Application.Run(new Form1("", ""));
|
|
|
|
|
//Application.Run(new FrmMainEditor());
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-09-03 09:36:09 +00:00
|
|
|
|
}
|
|
|
|
|
}
|