*.[修复]修复部分情况下打包时无法识别软件路径从而无法识别版本号的BUG。
This commit is contained in:
parent
37fda16352
commit
11ee9eb8e2
Binary file not shown.
|
@ -1,4 +1,8 @@
|
||||||
### 2020-12-10更新
|
### 2020-12-15更新
|
||||||
|
------
|
||||||
|
#### SuperDesign V2.0.2012.1501
|
||||||
|
*.[修复]修复部分情况下打包时无法识别软件路径从而无法识别版本号的BUG。
|
||||||
|
### 2020-12-10更新
|
||||||
------
|
------
|
||||||
#### SuperDesign V2.0.2012.1001
|
#### SuperDesign V2.0.2012.1001
|
||||||
- *.[新增]新增变量设置。
|
- *.[新增]新增变量设置。
|
||||||
|
|
Binary file not shown.
|
@ -469,6 +469,10 @@ namespace 开发辅助工具.Manager
|
||||||
var eng_name = ini.ReadIni("project", "engname");
|
var eng_name = ini.ReadIni("project", "engname");
|
||||||
var proglang = ini.ReadIni("project", "proglang");
|
var proglang = ini.ReadIni("project", "proglang");
|
||||||
var ouput_folder = bf_folder + "\\Bin\\" + com_mode + "\\" + eng_name;
|
var ouput_folder = bf_folder + "\\Bin\\" + com_mode + "\\" + eng_name;
|
||||||
|
if(!System.IO.Directory.Exists(ouput_folder))
|
||||||
|
{
|
||||||
|
ouput_folder = bf_folder + "\\Bin\\" + com_mode;
|
||||||
|
}
|
||||||
var file_ver = "";
|
var file_ver = "";
|
||||||
if (System.IO.File.Exists(ouput_folder + "\\" + eng_name + ".exe"))
|
if (System.IO.File.Exists(ouput_folder + "\\" + eng_name + ".exe"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
||||||
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
||||||
// 方法是按如下所示使用“*”: :
|
// 方法是按如下所示使用“*”: :
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("2.0.2012.1001")]
|
[assembly: AssemblyVersion("2.0.2012.1501")]
|
||||||
[assembly: AssemblyFileVersion("2.0.2012.1001")]
|
[assembly: AssemblyFileVersion("2.0.2012.1501")]
|
|
@ -1,252 +1,252 @@
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using ryCommon;
|
using ryCommon;
|
||||||
using ryCommonDb;
|
using ryCommonDb;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using WeifenLuo.WinFormsUI.Docking;
|
using WeifenLuo.WinFormsUI.Docking;
|
||||||
using 开发辅助工具.Manager;
|
using 开发辅助工具.Manager;
|
||||||
|
|
||||||
namespace 开发辅助工具.Tools
|
namespace 开发辅助工具.Tools
|
||||||
{
|
{
|
||||||
public partial class FrmPathInfo : DockContent
|
public partial class FrmPathInfo : DockContent
|
||||||
{
|
{
|
||||||
string SelectPath = "";
|
string SelectPath = "";
|
||||||
public FrmPathInfo(string _Path)
|
public FrmPathInfo(string _Path)
|
||||||
{
|
{
|
||||||
SelectPath = _Path;
|
SelectPath = _Path;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
LoadPath();
|
LoadPath();
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取毕方标准项目根路径
|
/// 获取毕方标准项目根路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private string GetBFFolderPath()
|
private string GetBFFolderPath()
|
||||||
{
|
{
|
||||||
var _path = SelectPath;
|
var _path = SelectPath;
|
||||||
if(System.IO.Directory.Exists(_path))
|
if(System.IO.Directory.Exists(_path))
|
||||||
{
|
{
|
||||||
if (System.IO.File.Exists(_path + "\\查看项目.ryp"))
|
if (System.IO.File.Exists(_path + "\\查看项目.ryp"))
|
||||||
{
|
{
|
||||||
return _path;
|
return _path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
_path = System.IO.Path.GetDirectoryName(_path.TrimEnd('\\')).TrimEnd('\\');
|
_path = System.IO.Path.GetDirectoryName(_path.TrimEnd('\\')).TrimEnd('\\');
|
||||||
if (System.IO.File.Exists(_path + "\\查看项目.ryp"))
|
if (System.IO.File.Exists(_path + "\\查看项目.ryp"))
|
||||||
{
|
{
|
||||||
return _path;
|
return _path;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (_path.Length < 4) { break; }
|
if (_path.Length < 4) { break; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
private void LoadPath()
|
private void LoadPath()
|
||||||
{
|
{
|
||||||
var _path = GetBFFolderPath();
|
var _path = GetBFFolderPath();
|
||||||
TxtFolder.Text = _path;
|
TxtFolder.Text = _path;
|
||||||
if (_path!="")
|
if (_path!="")
|
||||||
{
|
{
|
||||||
var folder = _path;
|
var folder = _path;
|
||||||
ryCommon.Ini ini = new Ini(folder + "\\查看项目.ryp");
|
ryCommon.Ini ini = new Ini(folder + "\\查看项目.ryp");
|
||||||
TxtUSQ_Ver.Text = ini.ReadIni("project", "usqver");
|
TxtUSQ_Ver.Text = ini.ReadIni("project", "usqver");
|
||||||
AddPath(true,"Debug输出目录", "Bin\\Debug","包含调试信息的输出目录");
|
AddPath(true,"Debug输出目录", "Bin\\Debug","包含调试信息的输出目录");
|
||||||
AddPath(true, "Release输出目录", "Bin\\Release", "不包含调试信息的输出目录");
|
AddPath(true, "Release输出目录", "Bin\\Release", "不包含调试信息的输出目录");
|
||||||
AddPath(true,"源代码目录", "Source", "含有项目源码");
|
AddPath(true,"源代码目录", "Source", "含有项目源码");
|
||||||
AddPath(true, "安装包目录", "Publish", "对外发布的安装文件");
|
AddPath(true, "安装包目录", "Publish", "对外发布的安装文件");
|
||||||
AddPath(false, " - 免安装输出包目录", "Publish\\Green", "绿色免安装版本目录,通常为zip压缩包");
|
AddPath(false, " - 免安装输出包目录", "Publish\\Green", "绿色免安装版本目录,通常为zip压缩包");
|
||||||
AddPath(false, " - 安装输出包目录", "Publish\\Install", "需要安装的版本目录,通常为exe压缩包");
|
AddPath(false, " - 安装输出包目录", "Publish\\Install", "需要安装的版本目录,通常为exe压缩包");
|
||||||
AddPath(false, " - 输出底包目录", "Publish\\OriginalFiles", "输出底包,保留完整的文件结构,绿色版、安装包都以此来制作");
|
AddPath(false, " - 输出底包目录", "Publish\\OriginalFiles", "输出底包,保留完整的文件结构,绿色版、安装包都以此来制作");
|
||||||
AddPath(false, " - 升级输出包目录", "Publish\\UpdateFile", "升级包目录,通常为zip压缩包,非完整输出包");
|
AddPath(false, " - 升级输出包目录", "Publish\\UpdateFile", "升级包目录,通常为zip压缩包,非完整输出包");
|
||||||
AddPath(true, "帮助文件目录", "Help", "帮助文档");
|
AddPath(true, "帮助文件目录", "Help", "帮助文档");
|
||||||
AddPath(true, "外部资源目录", "Res", "项目用到的资源备份,例外图标、图片、第三方项目");
|
AddPath(true, "外部资源目录", "Res", "项目用到的资源备份,例外图标、图片、第三方项目");
|
||||||
AddPath(false, " - 第三方组件项目", "Res\\ThirdParty", "包含第三方组件的项目");
|
AddPath(false, " - 第三方组件项目", "Res\\ThirdParty", "包含第三方组件的项目");
|
||||||
AddPath(false, " - 图片文件夹", "Res\\Images", "含下载的项目图片");
|
AddPath(false, " - 图片文件夹", "Res\\Images", "含下载的项目图片");
|
||||||
AddPath(true, "更新日志", "更新日志.txt", "当前项目更新日志文件");
|
AddPath(true, "更新日志", "更新日志.txt", "当前项目更新日志文件");
|
||||||
AddPath(true, "更新日志", "更新日志.md", "当前项目更新日志文件");
|
AddPath(true, "更新日志", "更新日志.md", "当前项目更新日志文件");
|
||||||
AddPath(true, "更新日志", "CHANGELOG.md", "当前项目更新日志文件");
|
AddPath(true, "更新日志", "CHANGELOG.md", "当前项目更新日志文件");
|
||||||
AddPath(true, "自述文件", "README.md", "当前项目自述文件");
|
AddPath(true, "自述文件", "README.md", "当前项目自述文件");
|
||||||
void AddPath(bool bold,string name,string path,string des)
|
void AddPath(bool bold,string name,string path,string des)
|
||||||
{
|
{
|
||||||
if (System.IO.File.Exists(folder + "\\" + path) || System.IO.Directory.Exists(folder + "\\" + path))
|
if (System.IO.File.Exists(folder + "\\" + path) || System.IO.Directory.Exists(folder + "\\" + path))
|
||||||
{
|
{
|
||||||
XPTable.Models.Row itemList = new XPTable.Models.Row
|
XPTable.Models.Row itemList = new XPTable.Models.Row
|
||||||
{
|
{
|
||||||
Tag = folder + "\\" + path
|
Tag = folder + "\\" + path
|
||||||
};
|
};
|
||||||
var cell_name = new XPTable.Models.Cell(name);
|
var cell_name = new XPTable.Models.Cell(name);
|
||||||
if(bold)
|
if(bold)
|
||||||
cell_name.ForeColor=Color.Blue;
|
cell_name.ForeColor=Color.Blue;
|
||||||
else
|
else
|
||||||
{ cell_name.ForeColor = Color.Tomato; }
|
{ cell_name.ForeColor = Color.Tomato; }
|
||||||
itemList.Cells.Add(cell_name);
|
itemList.Cells.Add(cell_name);
|
||||||
itemList.Cells.Add(new XPTable.Models.Cell(path));
|
itemList.Cells.Add(new XPTable.Models.Cell(path));
|
||||||
var cell = new XPTable.Models.Cell(des);
|
var cell = new XPTable.Models.Cell(des);
|
||||||
cell.ForeColor = Color.Gray;
|
cell.ForeColor = Color.Gray;
|
||||||
itemList.Cells.Add(cell);
|
itemList.Cells.Add(cell);
|
||||||
table1.TableModel.Rows.Add(itemList);
|
table1.TableModel.Rows.Add(itemList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void CloseApp()
|
private void CloseApp()
|
||||||
{
|
{
|
||||||
Itrycn_Db.IsCloseConfirm = false;
|
Itrycn_Db.IsCloseConfirm = false;
|
||||||
this.DockPanel.FindForm().Close();
|
this.DockPanel.FindForm().Close();
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取Notepad++路径
|
/// 获取Notepad++路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private string GetNotepadPlusPath()
|
private string GetNotepadPlusPath()
|
||||||
{
|
{
|
||||||
var path = "";
|
var path = "";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
RegistryKey LMach = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
|
RegistryKey LMach = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
|
||||||
RegistryKey softwareRun = LMach.OpenSubKey(@"SOFTWARE\Notepad++", true);
|
RegistryKey softwareRun = LMach.OpenSubKey(@"SOFTWARE\Notepad++", true);
|
||||||
if (softwareRun.GetValue("") != null)
|
if (softwareRun.GetValue("") != null)
|
||||||
{
|
{
|
||||||
string notepad_plus_path = softwareRun.GetValue("").ToString() + "\\notepad++.exe";
|
string notepad_plus_path = softwareRun.GetValue("").ToString() + "\\notepad++.exe";
|
||||||
if (System.IO.File.Exists(notepad_plus_path))
|
if (System.IO.File.Exists(notepad_plus_path))
|
||||||
{
|
{
|
||||||
path = notepad_plus_path;
|
path = notepad_plus_path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
softwareRun.Close();
|
softwareRun.Close();
|
||||||
LMach.Close();
|
LMach.Close();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FrmProject_Load(object sender, EventArgs e)
|
private void FrmProject_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void table1_DoubleClick(object sender, EventArgs e)
|
private void table1_DoubleClick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (table1.SelectedItems.Length == 0) { return; }
|
if (table1.SelectedItems.Length == 0) { return; }
|
||||||
var path = table1.SelectedItems[0].Tag.ToString();
|
var path = table1.SelectedItems[0].Tag.ToString();
|
||||||
if (System.IO.Directory.Exists(path))
|
if (System.IO.Directory.Exists(path))
|
||||||
{
|
{
|
||||||
ryCommon.RyFiles.OpenFile(path);
|
ryCommon.RyFiles.OpenFile(path);
|
||||||
}
|
}
|
||||||
else if (System.IO.File.Exists(path))
|
else if (System.IO.File.Exists(path))
|
||||||
{
|
{
|
||||||
if (System.IO.Path.GetExtension(path).ToLower() == ".txt")
|
if (System.IO.Path.GetExtension(path).ToLower() == ".txt")
|
||||||
{
|
{
|
||||||
string notepad_plus_path = GetNotepadPlusPath();
|
string notepad_plus_path = GetNotepadPlusPath();
|
||||||
if (System.IO.File.Exists(notepad_plus_path))
|
if (System.IO.File.Exists(notepad_plus_path))
|
||||||
{
|
{
|
||||||
ryCommon.RyFiles.RunFile(notepad_plus_path, "\"" + path + "\"");
|
ryCommon.RyFiles.RunFile(notepad_plus_path, "\"" + path + "\"");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ryCommon.RyFiles.OpenFile(path);
|
ryCommon.RyFiles.OpenFile(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (System.IO.Path.GetExtension(path).ToLower() == ".md")
|
else if (System.IO.Path.GetExtension(path).ToLower() == ".md")
|
||||||
{
|
{
|
||||||
ryCommon.RyFiles.OpenFile(path);
|
ryCommon.RyFiles.OpenFile(path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ryCommon.RyFiles.OpenFolderGotoFile(path);
|
ryCommon.RyFiles.OpenFolderGotoFile(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void BtnClean_Click(object sender, EventArgs e)
|
private void BtnClean_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
switch (MessageBox.Show("是否要进行清理不必要的文件,例如*.pdb", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information))
|
switch (MessageBox.Show("是否要进行清理不必要的文件,例如*.pdb", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information))
|
||||||
{
|
{
|
||||||
case DialogResult.No:
|
case DialogResult.No:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BtnClean.Enabled = false;
|
BtnClean.Enabled = false;
|
||||||
var folder = GetBFFolderPath();
|
var folder = GetBFFolderPath();
|
||||||
if(folder!="")
|
if(folder!="")
|
||||||
{
|
{
|
||||||
if (System.IO.Directory.Exists(folder + "\\Bin\\Debug"))
|
if (System.IO.Directory.Exists(folder + "\\Bin\\Debug"))
|
||||||
{
|
{
|
||||||
Itrycn_Db.DeleteFiles(folder + "\\Bin\\Debug", "*.pdb");
|
Itrycn_Db.DeleteFiles(folder + "\\Bin\\Debug", "*.pdb");
|
||||||
Itrycn_Db.DeleteFiles(folder + "\\Bin\\Debug", "*.dcu");
|
Itrycn_Db.DeleteFiles(folder + "\\Bin\\Debug", "*.dcu");
|
||||||
}
|
}
|
||||||
if (System.IO.Directory.Exists(folder + "\\Bin\\Release"))
|
if (System.IO.Directory.Exists(folder + "\\Bin\\Release"))
|
||||||
{
|
{
|
||||||
Itrycn_Db.DeleteFiles(folder + "\\Bin\\Release", "*.pdb");
|
Itrycn_Db.DeleteFiles(folder + "\\Bin\\Release", "*.pdb");
|
||||||
Itrycn_Db.DeleteFiles(folder + "\\Bin\\Release", "*.dcu");
|
Itrycn_Db.DeleteFiles(folder + "\\Bin\\Release", "*.dcu");
|
||||||
}
|
}
|
||||||
if (System.IO.Directory.Exists(folder + "\\Source"))
|
if (System.IO.Directory.Exists(folder + "\\Source"))
|
||||||
{
|
{
|
||||||
Itrycn_Db.DeleteFiles(folder + "\\Source", "*.pdb");
|
Itrycn_Db.DeleteFiles(folder + "\\Source", "*.pdb");
|
||||||
Itrycn_Db.DeleteFiles(folder + "\\Source", "*.dcu");
|
Itrycn_Db.DeleteFiles(folder + "\\Source", "*.dcu");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BtnClean.Enabled = true;
|
BtnClean.Enabled = true;
|
||||||
MessageBox.Show("清理完成。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("清理完成。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 等待进程执行完毕
|
/// 等待进程执行完毕
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="cmd_text"></param>
|
/// <param name="cmd_text"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string Read_Prog(string exe,string cmd_text)
|
public static string Read_Prog(string exe,string cmd_text)
|
||||||
{
|
{
|
||||||
String cmd = exe;
|
String cmd = exe;
|
||||||
Process p = new Process
|
Process p = new Process
|
||||||
{
|
{
|
||||||
StartInfo = new System.Diagnostics.ProcessStartInfo
|
StartInfo = new System.Diagnostics.ProcessStartInfo
|
||||||
{
|
{
|
||||||
FileName = cmd,//设定程序名
|
FileName = cmd,//设定程序名
|
||||||
Arguments = cmd_text,
|
Arguments = cmd_text,
|
||||||
UseShellExecute = false, //关闭shell的使用
|
UseShellExecute = false, //关闭shell的使用
|
||||||
RedirectStandardInput = true, //重定向标准输入
|
RedirectStandardInput = true, //重定向标准输入
|
||||||
RedirectStandardOutput = true, //重定向标准输出
|
RedirectStandardOutput = true, //重定向标准输出
|
||||||
RedirectStandardError = false, //重定向错误输出
|
RedirectStandardError = false, //重定向错误输出
|
||||||
CreateNoWindow = true//设置不显示窗口
|
CreateNoWindow = true//设置不显示窗口
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
p.Start();
|
p.Start();
|
||||||
string result = p.StandardOutput.ReadToEnd();
|
string result = p.StandardOutput.ReadToEnd();
|
||||||
p.WaitForExit(20000);
|
p.WaitForExit(20000);
|
||||||
p.Close();
|
p.Close();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
private void BtnBatchZip_Click(object sender, EventArgs e)
|
private void BtnBatchZip_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
BtnBatchZip.Enabled = false;
|
BtnBatchZip.Enabled = false;
|
||||||
Thread th = new Thread(Start);
|
Thread th = new Thread(Start);
|
||||||
th.Start();
|
th.Start();
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
RyProject project = new RyProject();
|
RyProject project = new RyProject();
|
||||||
project.OnStateChanged += Project_OnStateChanged;
|
project.OnStateChanged += Project_OnStateChanged;
|
||||||
project.Pack(GetBFFolderPath());
|
project.Pack(GetBFFolderPath());
|
||||||
this.Invoke(new Action(() =>
|
this.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
BtnBatchZip.Enabled = true;
|
BtnBatchZip.Enabled = true;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Project_OnStateChanged(object sender, string e)
|
private void Project_OnStateChanged(object sender, string e)
|
||||||
|
@ -257,144 +257,144 @@ namespace 开发辅助工具.Tools
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GetVersBySln(string path)
|
private void GetVersBySln(string path)
|
||||||
{
|
{
|
||||||
RyProject project = new RyProject();
|
RyProject project = new RyProject();
|
||||||
string update_logs_text = "";
|
string update_logs_text = "";
|
||||||
if (System.IO.File.Exists(path))
|
if (System.IO.File.Exists(path))
|
||||||
{
|
{
|
||||||
var sln_text = ryCommon.RyFiles.ReadAllLines(path);
|
var sln_text = ryCommon.RyFiles.ReadAllLines(path);
|
||||||
for (int i = 0; i < sln_text.Length; i++)
|
for (int i = 0; i < sln_text.Length; i++)
|
||||||
{
|
{
|
||||||
if(sln_text[i].StartsWith("Project"))
|
if(sln_text[i].StartsWith("Project"))
|
||||||
{
|
{
|
||||||
var item = sln_text[i].Replace(" = ",",").Split(',');
|
var item = sln_text[i].Replace(" = ",",").Split(',');
|
||||||
if (item.Length>=3)
|
if (item.Length>=3)
|
||||||
{
|
{
|
||||||
var project_name = item[1].Trim().Trim('"');
|
var project_name = item[1].Trim().Trim('"');
|
||||||
var project_path =System.IO.Path.GetDirectoryName(path).TrimEnd('\\')+"\\"+item[2].Trim().Trim('"');
|
var project_path =System.IO.Path.GetDirectoryName(path).TrimEnd('\\')+"\\"+item[2].Trim().Trim('"');
|
||||||
var ver = project.GetAssemblyVersion(project_path);
|
var ver = project.GetAssemblyVersion(project_path);
|
||||||
if (ver != "")
|
if (ver != "")
|
||||||
{
|
{
|
||||||
if (update_logs_text != "") { update_logs_text += "\r\n"; }
|
if (update_logs_text != "") { update_logs_text += "\r\n"; }
|
||||||
update_logs_text +="#### "+ project_name + " V" + ver+ "\r\n暂无\r\n";
|
update_logs_text +="#### "+ project_name + " V" + ver+ "\r\n暂无\r\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (update_logs_text != "")
|
if (update_logs_text != "")
|
||||||
{
|
{
|
||||||
var _path = GetBFFolderPath();
|
var _path = GetBFFolderPath();
|
||||||
if (_path != "")
|
if (_path != "")
|
||||||
{
|
{
|
||||||
var update_text = ryCommon.RyFiles.ReadAllText(_path + "\\CHANGELOG.md");
|
var update_text = ryCommon.RyFiles.ReadAllText(_path + "\\CHANGELOG.md");
|
||||||
RyFiles.WriteAllText(_path+ "\\CHANGELOG.md", "### " + DateTime.Now.ToString("yyyy-MM-dd") + "更新\r\n------\r\n"+ update_logs_text + update_text, Encoding.UTF8);
|
RyFiles.WriteAllText(_path+ "\\CHANGELOG.md", "### " + DateTime.Now.ToString("yyyy-MM-dd") + "更新\r\n------\r\n"+ update_logs_text + update_text, Encoding.UTF8);
|
||||||
RyFiles.OpenFile(_path + "\\CHANGELOG.md");
|
RyFiles.OpenFile(_path + "\\CHANGELOG.md");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void BtnInsertUpdate_Click(object sender, EventArgs e)
|
private void BtnInsertUpdate_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var _path = GetBFFolderPath();
|
var _path = GetBFFolderPath();
|
||||||
if (_path != "")
|
if (_path != "")
|
||||||
{
|
{
|
||||||
var files = System.IO.Directory.GetFiles(_path+"\\Source");
|
var files = System.IO.Directory.GetFiles(_path+"\\Source");
|
||||||
for (int i = 0; i < files.Length; i++)
|
for (int i = 0; i < files.Length; i++)
|
||||||
{
|
{
|
||||||
var ext = System.IO.Path.GetExtension(files[i]).ToLower();
|
var ext = System.IO.Path.GetExtension(files[i]).ToLower();
|
||||||
if(ext==".sln")
|
if(ext==".sln")
|
||||||
{
|
{
|
||||||
GetVersBySln(files[i]);
|
GetVersBySln(files[i]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var dirs = System.IO.Directory.GetDirectories(_path + "\\Source");
|
var dirs = System.IO.Directory.GetDirectories(_path + "\\Source");
|
||||||
for (int i = 0; i < dirs.Length; i++)
|
for (int i = 0; i < dirs.Length; i++)
|
||||||
{
|
{
|
||||||
var files2 = System.IO.Directory.GetFiles(dirs[i]);
|
var files2 = System.IO.Directory.GetFiles(dirs[i]);
|
||||||
for (int m = 0; m < files2.Length; m++)
|
for (int m = 0; m < files2.Length; m++)
|
||||||
{
|
{
|
||||||
var ext = System.IO.Path.GetExtension(files2[m]).ToLower();
|
var ext = System.IO.Path.GetExtension(files2[m]).ToLower();
|
||||||
if (ext == ".sln")
|
if (ext == ".sln")
|
||||||
{
|
{
|
||||||
GetVersBySln(files2[m]);
|
GetVersBySln(files2[m]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var sln_path = _path + "\\CHANGELOG.md";
|
var sln_path = _path + "\\CHANGELOG.md";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BtnUpdateDll_Click(object sender, EventArgs e)
|
private void BtnUpdateDll_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
BtnUpdateDll.Enabled = false;
|
BtnUpdateDll.Enabled = false;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
RyProject project = new RyProject
|
RyProject project = new RyProject
|
||||||
{
|
{
|
||||||
CopyDllToBin = true,
|
CopyDllToBin = true,
|
||||||
ChangedOutputPath = false
|
ChangedOutputPath = false
|
||||||
};
|
};
|
||||||
var bf_folder = GetBFFolderPath();
|
var bf_folder = GetBFFolderPath();
|
||||||
if(bf_folder!="")
|
if(bf_folder!="")
|
||||||
{
|
{
|
||||||
error+= project.UpdateCSproj(bf_folder+"\\Source");
|
error+= project.UpdateCSproj(bf_folder+"\\Source");
|
||||||
}
|
}
|
||||||
error +=project.UpdateDlls(bf_folder+"\\Bin",out string _error_str);
|
error +=project.UpdateDlls(bf_folder+"\\Bin",out string _error_str);
|
||||||
BtnUpdateDll.Enabled = true;
|
BtnUpdateDll.Enabled = true;
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
{
|
{
|
||||||
MessageBox.Show("更新dll完成。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("更新dll完成。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageBox.Show("更新dll完成,共失败"+error+ "项。\r\n\r\n" + _error_str, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
MessageBox.Show("更新dll完成,共失败"+error+ "项。\r\n\r\n" + _error_str, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void FrmPathInfo_Load(object sender, EventArgs e)
|
private void FrmPathInfo_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BtnCreateFolder_Click(object sender, EventArgs e)
|
private void BtnCreateFolder_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ryCommon.Ini ini= new Ini(TxtFolder.Text+ "\\查看项目.ryp");
|
ryCommon.Ini ini= new Ini(TxtFolder.Text+ "\\查看项目.ryp");
|
||||||
FrmCreateProject frm = new FrmCreateProject();
|
FrmCreateProject frm = new FrmCreateProject();
|
||||||
frm.TxtFolder.Text = TxtFolder.Text;
|
frm.TxtFolder.Text = TxtFolder.Text;
|
||||||
frm.ChkUnCreateProject.Checked = true;
|
frm.ChkUnCreateProject.Checked = true;
|
||||||
frm.TxtProjectEngName.Text = ini.ReadIni("project", "engname");
|
frm.TxtProjectEngName.Text = ini.ReadIni("project", "engname");
|
||||||
frm.TxtProjectName.Text = ini.ReadIni("project", "name");
|
frm.TxtProjectName.Text = ini.ReadIni("project", "name");
|
||||||
frm.StartPosition = FormStartPosition.CenterParent;
|
frm.StartPosition = FormStartPosition.CenterParent;
|
||||||
frm.ShowDialog();
|
frm.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BtnUpdateDllVer_Click(object sender, EventArgs e)
|
private void BtnUpdateDllVer_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
BtnUpdateDllVer.Enabled = false;
|
BtnUpdateDllVer.Enabled = false;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
RyProject project = new RyProject
|
RyProject project = new RyProject
|
||||||
{
|
{
|
||||||
CopyDllToBin = true,
|
CopyDllToBin = true,
|
||||||
ChangedOutputPath = false
|
ChangedOutputPath = false
|
||||||
};
|
};
|
||||||
var bf_folder = GetBFFolderPath();
|
var bf_folder = GetBFFolderPath();
|
||||||
var _error_str = "";
|
var _error_str = "";
|
||||||
if (bf_folder != "")
|
if (bf_folder != "")
|
||||||
{
|
{
|
||||||
error += project.UpdateDlls(bf_folder + "\\Bin", out _error_str);
|
error += project.UpdateDlls(bf_folder + "\\Bin", out _error_str);
|
||||||
}
|
}
|
||||||
BtnUpdateDllVer.Enabled = true;
|
BtnUpdateDllVer.Enabled = true;
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
{
|
{
|
||||||
MessageBox.Show("更新dll完成。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("更新dll完成。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageBox.Show("更新dll完成,共失败" + error + "项。\r\n\r\n"+ _error_str, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
MessageBox.Show("更新dll完成,共失败" + error + "项。\r\n\r\n"+ _error_str, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user