master
hang 2024-01-29 16:49:42 +08:00
parent 76c301cede
commit 3a8184129d
11 changed files with 263 additions and 171 deletions

View File

@ -16,9 +16,9 @@
</PropertyGroup>
<ItemGroup>
<None Remove="Resource\EIImageViewerData.rar" />
<None Remove="Resource\EIImageViewerService.rar" />
<None Remove="Resource\EIImageViewerWeb.rar" />
<None Remove="Resource\EIMedViewerData.rar" />
<None Remove="Resource\EIMedViewerService.rar" />
<None Remove="Resource\EIMedViewerWeb.rar" />
<None Remove="Resource\UnInstall.exe" />
<None Remove="ServiceConfig.Json" />
<None Remove="Resource\Data\data.sql" />
@ -28,13 +28,13 @@
<ItemGroup>
<Content Include="favicon.ico" />
<Content Include="Resource\EIImageViewerData.rar">
<Content Include="Resource\EIMedViewerData.rar">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Resource\EIImageViewerService.rar">
<Content Include="Resource\EIMedViewerService.rar">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Resource\EIImageViewerWeb.rar">
<Content Include="Resource\EIMedViewerWeb.rar">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Resource\Data\data.sql">

View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34511.84
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EI_Med_Viewer_Installer", "EI_Med_Viewer_Installer.csproj", "{0A143F47-44C3-4F41-AC47-0C622BDE9087}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0A143F47-44C3-4F41-AC47-0C622BDE9087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0A143F47-44C3-4F41-AC47-0C622BDE9087}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A143F47-44C3-4F41-AC47-0C622BDE9087}.Debug|x64.ActiveCfg = Debug|x64
{0A143F47-44C3-4F41-AC47-0C622BDE9087}.Debug|x64.Build.0 = Debug|x64
{0A143F47-44C3-4F41-AC47-0C622BDE9087}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A143F47-44C3-4F41-AC47-0C622BDE9087}.Release|Any CPU.Build.0 = Release|Any CPU
{0A143F47-44C3-4F41-AC47-0C622BDE9087}.Release|x64.ActiveCfg = Release|x64
{0A143F47-44C3-4F41-AC47-0C622BDE9087}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5E112DA1-00FF-40F5-A027-A15C640DB1FD}
EndGlobalSection
EndGlobal

184
Main.Designer.cs generated
View File

@ -84,71 +84,71 @@
groupBox1.Controls.Add(label1);
groupBox1.Location = new Point(11, 12);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(547, 205);
groupBox1.Size = new Size(614, 205);
groupBox1.TabIndex = 0;
groupBox1.TabStop = false;
groupBox1.Text = "第一步:验证数据库";
groupBox1.Text = "Step 1: Validate Database";
//
// connectButton
//
connectButton.Location = new Point(195, 150);
connectButton.Location = new Point(223, 145);
connectButton.Name = "connectButton";
connectButton.Size = new Size(128, 40);
connectButton.Size = new Size(149, 40);
connectButton.TabIndex = 6;
connectButton.Text = "测试连接";
connectButton.Text = "Test Connection";
connectButton.UseVisualStyleBackColor = true;
connectButton.Click += connectButton_Click;
//
// passwordTextBox
//
passwordTextBox.Location = new Point(154, 113);
passwordTextBox.Location = new Point(178, 113);
passwordTextBox.Name = "passwordTextBox";
passwordTextBox.PasswordChar = '*';
passwordTextBox.Size = new Size(271, 23);
passwordTextBox.Size = new Size(303, 23);
passwordTextBox.TabIndex = 5;
//
// usernameTextBox
//
usernameTextBox.Location = new Point(156, 73);
usernameTextBox.Location = new Point(180, 73);
usernameTextBox.Name = "usernameTextBox";
usernameTextBox.Size = new Size(271, 23);
usernameTextBox.Size = new Size(303, 23);
usernameTextBox.TabIndex = 4;
usernameTextBox.Text = "sa";
//
// serverTextBox
//
serverTextBox.Location = new Point(156, 33);
serverTextBox.Location = new Point(180, 33);
serverTextBox.Name = "serverTextBox";
serverTextBox.Size = new Size(271, 23);
serverTextBox.Size = new Size(303, 23);
serverTextBox.TabIndex = 3;
serverTextBox.Text = ".";
//
// label3
//
label3.AutoSize = true;
label3.Location = new Point(107, 113);
label3.Location = new Point(76, 113);
label3.Name = "label3";
label3.Size = new Size(32, 17);
label3.Size = new Size(64, 17);
label3.TabIndex = 2;
label3.Text = "密码";
label3.Text = "Password";
//
// label2
//
label2.AutoSize = true;
label2.Location = new Point(101, 73);
label2.Location = new Point(119, 73);
label2.Name = "label2";
label2.Size = new Size(44, 17);
label2.Size = new Size(21, 17);
label2.TabIndex = 1;
label2.Text = "登录名";
label2.Text = "ID";
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(95, 33);
label1.Location = new Point(56, 33);
label1.Name = "label1";
label1.Size = new Size(56, 17);
label1.Size = new Size(84, 17);
label1.TabIndex = 0;
label1.Text = "服务器名";
label1.Text = "Server Name";
//
// groupBox2
//
@ -172,24 +172,24 @@
groupBox2.Controls.Add(label5);
groupBox2.Location = new Point(12, 223);
groupBox2.Name = "groupBox2";
groupBox2.Size = new Size(546, 468);
groupBox2.Size = new Size(613, 468);
groupBox2.TabIndex = 1;
groupBox2.TabStop = false;
groupBox2.Text = "第二步: 部署参数配置";
groupBox2.Text = "Step 2: Deployment Parameters Configuration";
//
// nginxServiceDisplayNameTbox
//
nginxServiceDisplayNameTbox.Location = new Point(151, 368);
nginxServiceDisplayNameTbox.Location = new Point(234, 368);
nginxServiceDisplayNameTbox.Name = "nginxServiceDisplayNameTbox";
nginxServiceDisplayNameTbox.Size = new Size(259, 23);
nginxServiceDisplayNameTbox.Size = new Size(260, 23);
nginxServiceDisplayNameTbox.TabIndex = 23;
nginxServiceDisplayNameTbox.Text = "EI_Nginx_Self_Starting";
//
// nginxServiceNameTbox
//
nginxServiceNameTbox.Location = new Point(151, 322);
nginxServiceNameTbox.Location = new Point(234, 322);
nginxServiceNameTbox.Name = "nginxServiceNameTbox";
nginxServiceNameTbox.Size = new Size(259, 23);
nginxServiceNameTbox.Size = new Size(260, 23);
nginxServiceNameTbox.TabIndex = 22;
nginxServiceNameTbox.Text = "EI_Nginx";
//
@ -198,142 +198,142 @@
label12.AutoSize = true;
label12.Location = new Point(27, 368);
label12.Name = "label12";
label12.Size = new Size(111, 17);
label12.Size = new Size(203, 17);
label12.TabIndex = 21;
label12.Text = "nginx服务显示名称";
label12.Text = "Displayed Name of Nginx Service";
//
// label13
//
label13.AutoSize = true;
label13.Location = new Point(51, 322);
label13.Location = new Point(104, 322);
label13.Name = "label13";
label13.Size = new Size(87, 17);
label13.Size = new Size(126, 17);
label13.TabIndex = 20;
label13.Text = "nginx服务名称";
label13.Text = "Nginx Service Name";
//
// confimDeployBtn
//
confimDeployBtn.Enabled = false;
confimDeployBtn.Location = new Point(195, 409);
confimDeployBtn.Location = new Point(222, 409);
confimDeployBtn.Name = "confimDeployBtn";
confimDeployBtn.Size = new Size(128, 40);
confimDeployBtn.Size = new Size(149, 40);
confimDeployBtn.TabIndex = 19;
confimDeployBtn.Text = "确认部署配置";
confimDeployBtn.Text = "Confirm Configuration";
confimDeployBtn.UseVisualStyleBackColor = true;
confimDeployBtn.Click += confimDeployBtn_Click;
//
// serviceDisplayNameTBox
//
serviceDisplayNameTBox.Location = new Point(152, 274);
serviceDisplayNameTBox.Location = new Point(235, 274);
serviceDisplayNameTBox.Name = "serviceDisplayNameTBox";
serviceDisplayNameTBox.Size = new Size(259, 23);
serviceDisplayNameTBox.Size = new Size(260, 23);
serviceDisplayNameTBox.TabIndex = 16;
serviceDisplayNameTBox.Text = "EI_Image_Viewer_DisplayName";
serviceDisplayNameTBox.Text = "EI_Med_Viewer_DisplayName";
//
// serviceNameTBox
//
serviceNameTBox.Location = new Point(152, 228);
serviceNameTBox.Location = new Point(235, 228);
serviceNameTBox.Name = "serviceNameTBox";
serviceNameTBox.Size = new Size(259, 23);
serviceNameTBox.Size = new Size(260, 23);
serviceNameTBox.TabIndex = 15;
serviceNameTBox.Text = "EI_Image_Viewer";
serviceNameTBox.Text = "EI_Med_Viewer";
//
// label11
//
label11.AutoSize = true;
label11.Location = new Point(11, 277);
label11.Location = new Point(2, 277);
label11.Name = "label11";
label11.Size = new Size(128, 17);
label11.Size = new Size(228, 17);
label11.TabIndex = 14;
label11.Text = "网站后端服务显示名称";
label11.Text = "Displayed Name of Back-end Service";
//
// label10
//
label10.AutoSize = true;
label10.Location = new Point(35, 231);
label10.Location = new Point(79, 231);
label10.Name = "label10";
label10.Size = new Size(104, 17);
label10.Size = new Size(151, 17);
label10.TabIndex = 13;
label10.Text = "网站后端服务名称";
label10.Text = " Back-end Service Name";
//
// selectPathBtn
//
selectPathBtn.Enabled = false;
selectPathBtn.Location = new Point(429, 43);
selectPathBtn.Location = new Point(509, 43);
selectPathBtn.Name = "selectPathBtn";
selectPathBtn.Size = new Size(95, 27);
selectPathBtn.TabIndex = 12;
selectPathBtn.Text = "选择";
selectPathBtn.Text = "Select";
selectPathBtn.UseVisualStyleBackColor = true;
selectPathBtn.Click += selectPathBtn_Click;
//
// folderPathTbox
//
folderPathTbox.Enabled = false;
folderPathTbox.Location = new Point(152, 44);
folderPathTbox.Location = new Point(235, 44);
folderPathTbox.Name = "folderPathTbox";
folderPathTbox.Size = new Size(259, 23);
folderPathTbox.Size = new Size(260, 23);
folderPathTbox.TabIndex = 11;
//
// label9
//
label9.AutoSize = true;
label9.Location = new Point(83, 48);
label9.Location = new Point(123, 48);
label9.Name = "label9";
label9.Size = new Size(56, 17);
label9.Size = new Size(107, 17);
label9.TabIndex = 10;
label9.Text = "部署路径";
label9.Text = "Deployment Path";
//
// dbNameTBox
//
dbNameTBox.Location = new Point(152, 182);
dbNameTBox.Location = new Point(235, 182);
dbNameTBox.Name = "dbNameTBox";
dbNameTBox.Size = new Size(259, 23);
dbNameTBox.Size = new Size(260, 23);
dbNameTBox.TabIndex = 9;
dbNameTBox.Text = "IRaCIS";
//
// label8
//
label8.AutoSize = true;
label8.Location = new Point(47, 185);
label8.Location = new Point(54, 185);
label8.Name = "label8";
label8.Size = new Size(92, 17);
label8.Size = new Size(176, 17);
label8.TabIndex = 8;
label8.Text = "部署数据库名称";
label8.Text = "Deployment Database Name";
//
// apiPortTBox
//
apiPortTBox.Location = new Point(152, 136);
apiPortTBox.Location = new Point(235, 136);
apiPortTBox.Name = "apiPortTBox";
apiPortTBox.Size = new Size(259, 23);
apiPortTBox.Size = new Size(260, 23);
apiPortTBox.TabIndex = 5;
apiPortTBox.Text = "7100";
//
// nginxPortTBox
//
nginxPortTBox.Location = new Point(152, 90);
nginxPortTBox.Location = new Point(235, 90);
nginxPortTBox.Name = "nginxPortTBox";
nginxPortTBox.Size = new Size(259, 23);
nginxPortTBox.Size = new Size(260, 23);
nginxPortTBox.TabIndex = 4;
nginxPortTBox.Text = "9520";
//
// label4
//
label4.AutoSize = true;
label4.Location = new Point(11, 140);
label4.Location = new Point(48, 140);
label4.Name = "label4";
label4.Size = new Size(128, 17);
label4.Size = new Size(182, 17);
label4.TabIndex = 3;
label4.Text = "网站后端服务启动端口";
label4.Text = "Back-end Service Startup Port";
//
// label5
//
label5.AutoSize = true;
label5.Location = new Point(35, 93);
label5.Location = new Point(94, 93);
label5.Name = "label5";
label5.Size = new Size(104, 17);
label5.Size = new Size(136, 17);
label5.TabIndex = 2;
label5.Text = "网站前端访问端口";
label5.Text = "Front-end Access Port";
//
// groupBox3
//
@ -344,47 +344,47 @@
groupBox3.Controls.Add(machineCodeLB);
groupBox3.Controls.Add(label6);
groupBox3.Controls.Add(label7);
groupBox3.Location = new Point(11, 714);
groupBox3.Location = new Point(11, 708);
groupBox3.Name = "groupBox3";
groupBox3.Size = new Size(544, 221);
groupBox3.Size = new Size(614, 227);
groupBox3.TabIndex = 2;
groupBox3.TabStop = false;
groupBox3.Text = "第三步:激活与部署";
groupBox3.Text = "Step 3: Activate and Deploy";
//
// btnCopy
//
btnCopy.Location = new Point(429, 39);
btnCopy.Location = new Point(503, 39);
btnCopy.Name = "btnCopy";
btnCopy.Size = new Size(93, 27);
btnCopy.TabIndex = 13;
btnCopy.Text = "复制";
btnCopy.Text = "Copy";
btnCopy.UseVisualStyleBackColor = true;
btnCopy.Click += btnCopy_Click;
//
// activeBtn
//
activeBtn.Enabled = false;
activeBtn.Location = new Point(195, 139);
activeBtn.Location = new Point(222, 149);
activeBtn.Name = "activeBtn";
activeBtn.Size = new Size(128, 40);
activeBtn.Size = new Size(149, 40);
activeBtn.TabIndex = 9;
activeBtn.Text = "激活并部署";
activeBtn.Text = "Activate and Deploy";
activeBtn.UseVisualStyleBackColor = true;
activeBtn.Click += activeBtn_Click;
//
// KeySecreteTextBox
//
KeySecreteTextBox.Location = new Point(152, 92);
KeySecreteTextBox.Location = new Point(178, 92);
KeySecreteTextBox.Name = "KeySecreteTextBox";
KeySecreteTextBox.Size = new Size(259, 23);
KeySecreteTextBox.Size = new Size(294, 23);
KeySecreteTextBox.TabIndex = 8;
//
// machineTextBox
//
machineTextBox.Location = new Point(152, 42);
machineTextBox.Location = new Point(178, 42);
machineTextBox.Name = "machineTextBox";
machineTextBox.ReadOnly = true;
machineTextBox.Size = new Size(259, 23);
machineTextBox.Size = new Size(294, 23);
machineTextBox.TabIndex = 7;
//
// machineCodeLB
@ -398,36 +398,36 @@
// label6
//
label6.AutoSize = true;
label6.Location = new Point(95, 94);
label6.Location = new Point(55, 94);
label6.Name = "label6";
label6.Size = new Size(44, 17);
label6.Size = new Size(99, 17);
label6.TabIndex = 5;
label6.Text = "激活码";
label6.Text = "Activation Code";
//
// label7
//
label7.AutoSize = true;
label7.Location = new Point(95, 44);
label7.Location = new Point(62, 44);
label7.Name = "label7";
label7.Size = new Size(44, 17);
label7.Size = new Size(92, 17);
label7.TabIndex = 4;
label7.Text = "机器码";
label7.Text = "Machine Code";
//
// groupBox4
//
groupBox4.Controls.Add(logTBox);
groupBox4.Location = new Point(570, 11);
groupBox4.Location = new Point(631, 11);
groupBox4.Name = "groupBox4";
groupBox4.Size = new Size(391, 825);
groupBox4.Size = new Size(391, 924);
groupBox4.TabIndex = 4;
groupBox4.TabStop = false;
groupBox4.Text = "部署日志";
groupBox4.Text = "Deployment Log";
//
// logTBox
//
logTBox.Location = new Point(6, 22);
logTBox.Name = "logTBox";
logTBox.Size = new Size(359, 797);
logTBox.Size = new Size(359, 899);
logTBox.TabIndex = 0;
logTBox.Text = "";
//
@ -435,14 +435,14 @@
//
AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(977, 944);
ClientSize = new Size(1034, 944);
Controls.Add(groupBox4);
Controls.Add(groupBox3);
Controls.Add(groupBox2);
Controls.Add(groupBox1);
Icon = (Icon)resources.GetObject("$this.Icon");
Name = "Main";
Text = "安装 - EI Image Viewer V1";
Text = "Install - EI-Med Viewer V1";
TopMost = true;
Load += Main_Load;
groupBox1.ResumeLayout(false);

145
Main.cs
View File

@ -33,6 +33,7 @@ using System.Web;
namespace Start
{
public partial class Main : Form
{
@ -77,7 +78,7 @@ namespace Start
connection.Open();
});
WinformLog("数据库连接测试成功", Color.Green);
WinformLog("Database connection test successful", Color.Green);
isCanDBConfig = false;
serverTextBox.Enabled = isCanDBConfig;
@ -96,7 +97,7 @@ namespace Start
catch (Exception ex)
{
WinformLog($"数据库连接测试失败{ex.Message}", Color.Red);
WinformLog($"Database connection test failed{ex.Message}", Color.Red);
}
}
@ -114,26 +115,26 @@ namespace Start
if (int.TryParse(nginxPortTBox.Text, out vuePort) == false || int.TryParse(apiPortTBox.Text, out apiPort) == false)
{
WinformLog($"请输入合法的端口", Color.Red);
WinformLog($"Please enter a valid port", Color.Red);
return;
}
if (IsPortInUse(vuePort))
{
WinformLog($"服务设置的前端端口被占用,请选择其他端口", Color.Red);
WinformLog($"The front-end port set by the service is occupied, please choose another port", Color.Red);
return;
}
if (IsPortInUse(apiPort))
{
WinformLog($"服务设置的后端端口被占用,请选择其他端口", Color.Red);
WinformLog($"The back-end port set by the service is occupied, please choose another port", Color.Red);
return;
}
WinformLog("端口测试成功", Color.Green);
WinformLog("Port test successful", Color.Green);
isPortTestOk = true;
@ -147,24 +148,24 @@ namespace Start
{
if (ServiceController.GetServices().Any(t => t.ServiceName == serviceNameTBox.Text))
{
WinformLog($"设置的后端服务名称已存在,请更换", Color.Red);
WinformLog($"The set backend service name already exists, please replace it", Color.Red);
return;
}
if (ServiceController.GetServices().Any(t => t.ServiceName == nginxServiceNameTbox.Text))
{
WinformLog($"设置的nginx服务名称已存在,请更换", Color.Red);
WinformLog($"The nginx service name already exists. Please change it", Color.Red);
return;
}
WinformLog($"测试服务名称成功", Color.Green);
WinformLog($"Service name test successful", Color.Green);
isServiceTestOk = true;
}
private void testNetcoreRuntime()
private void testNetcoreRuntime()
{
string runtimeListCommand = "dotnet --list-runtimes";
@ -215,7 +216,7 @@ namespace Start
{
// 执行逻辑,表示大于等于 6.0.0 的 .NET 运行时已安装
WinformLog("当前系统>= 6.0.0 NetCore 运行时已安装", Color.Green);
WinformLog("Current system >= 6.0.0 NetCore runtime is installed", Color.Green);
isRuntimeTestOk = true;
@ -224,13 +225,13 @@ namespace Start
{
WinformLog("当前系统>= 6.0.0 NetCore 运行时未安装,请安装后,再运行该程序", Color.Red);
WinformLog("The current system >= 6.0.0 NetCore runtime is not installed, please install it before running the program", Color.Red);
connectButton.Enabled = false;
//await Task.Run(() =>
// {
// WinformLog("现在为您启动安装Net core 运行时...", Color.Orange);
// WinformLog("Now start installing the Net core runtime for you...", Color.Orange);
// string runtimePath = Path.Combine(AppContext.BaseDirectory, "Resource/NetCoreRuntime/dotnet-hosting-6.0.0-win.exe");
@ -246,7 +247,7 @@ namespace Start
// otherProcess.Start();
// otherProcess.WaitForExit();
// WinformLog("Net core 6.0.0 运行时安装完成", Color.Green);
// WinformLog("Net core 6.0.0 runtime installation completed", Color.Green);
// });
@ -258,7 +259,7 @@ namespace Start
{
if (string.IsNullOrWhiteSpace(dbNameTBox.Text))
{
WinformLog($"请输入部署的数据库名称", Color.Red);
WinformLog($"Please enter the deployed database name", Color.Red);
return;
}
@ -280,14 +281,14 @@ namespace Start
if (rowCount > 0)
{
WinformLog($"{dbNameTBox.Text.Trim()}该数据库已存在。", Color.Red);
WinformLog($"{dbNameTBox.Text.Trim()}The database already exists.", Color.Red);
return;
}
}
WinformLog($"数据库名称测试成功", Color.Green);
WinformLog($"Database name test successful", Color.Green);
isDBNameTestOK = true;
@ -295,7 +296,7 @@ namespace Start
private void confimDeployBtn_Click(object sender, EventArgs e)
private void confimDeployBtn_Click(object sender, EventArgs e)
{
portBtn_Click(null, null);
@ -305,17 +306,17 @@ namespace Start
if (string.IsNullOrWhiteSpace(this.folderPathTbox.Text))
{
WinformLog($"请选择部署路径,测试的端口,数据库名,服务名都成功才可以进行确认", Color.Red);
WinformLog($"Confirmation can only be made after selecting the deployment path, test port, database name, and service name.", Color.Red);
return;
}
if (isDBNameTestOK == false || isPortTestOk == false || isServiceTestOk == false)
{
WinformLog($"测试的端口,数据库名,服务名都成功才可以进行确认", Color.Red);
WinformLog($"Confirmation can only be made after the test port, database name, and service name are all test successful.", Color.Red);
return;
}
WinformLog($"部署配置确认成功", Color.Green);
WinformLog($"Deployment configuration confirmed successfully", Color.Green);
activeBtn.Enabled = true;
@ -403,7 +404,7 @@ namespace Start
{
if (Md5($"{machineTextBox.Text}_XINGCANG") != KeySecreteTextBox.Text.Trim())
{
WinformLog($"秘钥不正确,请联系供应商", Color.Red);
WinformLog($"The secret key is incorrect, please contact the supplier", Color.Red);
return;
}
@ -421,10 +422,10 @@ namespace Start
var deployFoder = this.folderPathTbox.Text;
string nginxExtractName = "EIImageViewerWeb";
string apiExtractName = "EIImageViewerService";
string nginxExtractName = "EIMedViewerWeb";
string apiExtractName = "EIMedViewerService";
string dataExtraName = "EIImageViewerData";
string dataExtraName = "EIMedViewerData";
string nginxStartPath = Path.Combine(deployFoder, @$"{nginxExtractName}\");
var nginxConfigPath = Path.Combine(nginxStartPath, @$"conf\nginx.conf");
@ -434,14 +435,14 @@ namespace Start
var apiBinPath = Path.Combine(deployFoder, "EIImageViewerService/EI_Image_Viewer.exe");
var apiJsonConfigPath = Path.Combine(deployFoder, "EIImageViewerService/appsettings.CertificateApply.json");
var apiBinPath = Path.Combine(deployFoder, "EIMedViewerService/EI_Med_Viewer.exe");
var apiJsonConfigPath = Path.Combine(deployFoder, "EIMedViewerService/appsettings.Test_510K.json");
string nginxRarFilePath = Path.Combine(AppContext.BaseDirectory, $@"Resource\EIImageViewerWeb.rar");
string apiRarFilePath = Path.Combine(AppContext.BaseDirectory, "Resource/EIImageViewerService.rar");
string nginxRarFilePath = Path.Combine(AppContext.BaseDirectory, $@"Resource\EIMedViewerWeb.rar");
string apiRarFilePath = Path.Combine(AppContext.BaseDirectory, "Resource/EIMedViewerService.rar");
string dataRarFilePath = Path.Combine(AppContext.BaseDirectory, "Resource/EIImageViewerData.rar");
string dataRarFilePath = Path.Combine(AppContext.BaseDirectory, "Resource/EIMedViewerData.rar");
@ -468,7 +469,7 @@ namespace Start
#region 解压nginx 和前端部署的文件
WinformLog($"开始解压 nginx 及前端部署压缩文件...", Color.Green);
WinformLog($"Start decompressing nginx and front-end deployment compressed files...", Color.Green);
string extractPath = Path.Combine(deployFoder, nginxExtractName);
if (!Directory.Exists(extractPath))
@ -493,7 +494,7 @@ namespace Start
}
WinformLog($"nginx 及前端部署压缩文件已成功解压缩到: {extractPath}", Color.Green);
WinformLog($"The nginx and front-end deployment compressed files have been successfully decompressed to: {extractPath}", Color.Green);
@ -503,10 +504,10 @@ namespace Start
if (!File.Exists(nginxConfigPath))
{
WinformLog("预设路径不存在nginx", Color.Red);
WinformLog("No nginx exist under the default path", Color.Red);
}
WinformLog("准备写入nginx配置...", Color.Green);
WinformLog("Prepare to write nginx configuration...", Color.Green);
var nginxConfig = File.ReadAllText(nginxConfigPath);
@ -515,12 +516,12 @@ namespace Start
File.WriteAllText(nginxConfigPath, nginxConfig);
WinformLog("nginx部署配置写入完成", Color.Green);
WinformLog("nginx deployment configuration writing completed", Color.Green);
#region nginxservice
WinformLog("准备nginx自启动服务配置文件...", Color.Green);
WinformLog("Prepare nginx self-starting service configuration file...", Color.Green);
var nginxServiceConfig = File.ReadAllText(nginxServiceXMLPath);
@ -532,25 +533,25 @@ namespace Start
File.WriteAllText(nginxServiceXMLPath, nginxServiceConfig);
WinformLog("nginx自启动服务配置写入完成", Color.Green);
WinformLog("nginx self-starting service configuration writing completed", Color.Green);
#endregion
WinformLog($"准备创建自启动nginx服务...", Color.Green);
WinformLog($"Prepare to create a self-starting nginx service...", Color.Green);
var nginxCreateStr = $@"{nginxServiceEXEPath} install ";
// 执行 sc create 命令来创建服务
await ProcessStandardInputAsync(process, nginxCreateStr);
WinformLog($"服务{nginxServiceName}创建执行结束", Color.Green);
WinformLog($"The execution of creating service {nginxServiceName} ends", Color.Green);
await Task.Delay(2000);
#region nginx 服务
WinformLog($"启动部署的{nginxServiceName}服务...", Color.Green);
WinformLog($"Start the deployed {nginxServiceName} service...", Color.Green);
await ProcessStandardInputAsync(process, $"sc start {nginxServiceName}");
@ -569,11 +570,11 @@ namespace Start
if (scNginx.Status == ServiceControllerStatus.Running)
{
WinformLog($"nginx服务启动成功", Color.Green);
WinformLog($"nginx service started successfully", Color.Green);
}
else
{
WinformLog($"nginx服务启动失败", Color.Red);
WinformLog($"nginx service failed to start", Color.Red);
}
#endregion
@ -585,7 +586,7 @@ namespace Start
//// 指定工作目录即进入nginx.exe所在的目录
//psi.WorkingDirectory = nginxStartPath;
//WinformLog(" 开始启动 nginx 服务...", Color.Green);
//WinformLog(" Start nginx service...", Color.Green);
//// 启动可执行文件
//Process.Start(psi);
@ -594,11 +595,11 @@ namespace Start
//if (Process.GetProcesses().Any(t => t.ProcessName.Contains("nginx") && t.MainModule.FileName.Contains(nginxStartPath)))
//{
// WinformLog(" nginx 服务启动成功", Color.Green);
// WinformLog(" nginx service started successfully", Color.Green);
//}
//else
//{
// WinformLog(" nginx 服务启动失败", Color.Red);
// WinformLog(" nginx service failed to start", Color.Red);
// return;
//}
@ -615,7 +616,7 @@ namespace Start
{
#region 解压后端部署的文件
WinformLog($"开始解压后端部署压缩文件...", Color.Green);
WinformLog($"Start decompressing the backend deployment compressed file...", Color.Green);
string apiExtractPath = Path.Combine(deployFoder, apiExtractName);
@ -642,7 +643,7 @@ namespace Start
}
WinformLog($"后端部署压缩文件已成功解压缩到: {apiExtractPath}", Color.Green);
WinformLog($"The backend deployment compressed file was successfully extracted to: {apiExtractPath}", Color.Green);
#endregion
});
@ -650,7 +651,7 @@ namespace Start
await Task.Run(() =>
{
#region 解压模板文件
WinformLog($"开始解压部署依赖模板压缩文件...", Color.Green);
WinformLog($"Start decompressing the deployment dependency template compressed file...", Color.Green);
string extractPath = Path.Combine(deployFoder, dataExtraName);
if (!Directory.Exists(extractPath))
@ -671,7 +672,7 @@ namespace Start
}
WinformLog($"依赖模板压缩文件已成功解压缩到: {extractPath}", Color.Green);
WinformLog($"The dependency template compressed file was successfully extracted to: {extractPath}", Color.Green);
#endregion
@ -704,7 +705,7 @@ namespace Start
}
}
}
WinformLog($"文档资源释放成功", Color.Green);
WinformLog($"Document resources released successfully", Color.Green);
#endregion
});
@ -744,11 +745,11 @@ namespace Start
File.WriteAllText(Path.Combine(directoryPath, "config.json"), JsonConvert.SerializeObject(configObj));
WinformLog("写入激活秘钥完成", Color.Green);
WinformLog("Writing the activation key is completed", Color.Green);
}
catch (Exception ex)
{
WinformLog("写入激活秘钥失败,请用管理员方式启动该程序,保证程序可以", Color.Red);
WinformLog("Failed to write the activation key. Please start the program in administrator mode to ensure that the program has sufficient permissions.", Color.Red);
}
#endregion
@ -764,16 +765,16 @@ namespace Start
#region 创建服务
WinformLog($"开始创建服务{serviceName}...", Color.Green);
WinformLog($"Start creating a service {serviceName}...", Color.Green);
var createTestStr = $"sc create {serviceName} binPath= \"{apiBinPath} --urls=\"http://127.0.0.1:{apiPort}\" --env CertificateApply\" DisplayName= \"{serviceDisplayName}\" start= auto";
var createTestStr = $"sc create {serviceName} binPath= \"{apiBinPath} --urls=\"http://*:{apiPort}\" --env Test_510K\" DisplayName= \"{serviceDisplayName}\" start= auto";
var createStr = $@"sc create {serviceName} binPath= ""{apiBinPath} --urls=""http://127.0.0.1:{apiPort}"" --env CertificateApply"" DisplayName= ""{serviceDisplayName}"" start= auto";
var createStr = $@"sc create {serviceName} binPath= ""{apiBinPath} --urls=""http://*:{apiPort}"" --env Test_510K"" DisplayName= ""{serviceDisplayName}"" start= auto";
// 执行 sc create 命令来创建服务
await ProcessStandardInputAsync(process, createStr);
WinformLog($"服务{serviceName}创建执行结束", Color.Green);
WinformLog($"The execution of creating service{serviceName}ends", Color.Green);
#endregion
@ -782,7 +783,7 @@ namespace Start
#region 初始化数据库脚本
WinformLog($"执行初始化数据库脚本...", Color.Green);
WinformLog($"Execute initialization database script...", Color.Green);
//执行数据库脚本
@ -793,14 +794,14 @@ namespace Start
await ProcessStandardInputAsync(process, $@" SQLCMD -v dbName = ""{dbNameTBox.Text}"" -i ""{AppContext.BaseDirectory}Resource\Data\data.sql"" ");
WinformLog($"初始化数据库脚本执行结束", Color.Green);
WinformLog($"The execution of the initialization database script ends", Color.Green);
#endregion
#region 部署网站配置文件写入
WinformLog("开始写入部署网站服务配置文件...", Color.Green);
WinformLog("Start writing the deployment website service configuration file...", Color.Green);
var appsettingsJson = File.ReadAllText(apiJsonConfigPath);
@ -828,13 +829,13 @@ namespace Start
catch (SqlException ex)
{
WinformLog($"连接字符串错误", Color.Red);
WinformLog($"Connection string error", Color.Red);
return;
}
WinformLog("部署网站服务配置文件写入并测试OK", Color.Green);
WinformLog("Deploy the website service configuration file, write and test OK", Color.Green);
#endregion
@ -851,7 +852,7 @@ namespace Start
#region 启动后端服务
WinformLog($"启动部署的后端服务...", Color.Green);
WinformLog($"Start the deployed backend service...", Color.Green);
await ProcessStandardInputAsync(process, $"sc start {serviceName}");
@ -877,14 +878,14 @@ namespace Start
if (sc.Status == ServiceControllerStatus.Running)
{
WinformLog($"后端服务启动成功", Color.Green);
WinformLog($"Backend service started successfully", Color.Green);
WinformLog($"部署工作已完成", Color.Green);
WinformLog($"Deployment completed", Color.Green);
try
{
WinformLog($"现在准备打开浏览器...", Color.Green);
WinformLog($"Now ready to open the browser...", Color.Green);
await Task.Delay(2000);
// Use ProcessStartInfo class
@ -893,7 +894,7 @@ namespace Start
UseShellExecute = true,
Verb = "open"
};
var urlProcess= Process.Start(start);
var urlProcess = Process.Start(start);
urlProcess.WaitForExit(); // 等待进程结束
}
@ -905,7 +906,7 @@ namespace Start
}
else
{
WinformLog($"后端服务启动失败,您可手动启动{serviceDisplayName}尝试,如若手动尝试还是无法启动,请联系技术人员确认部署环境", Color.Red);
WinformLog($"The backend service failed to start. You can try to start {serviceDisplayName}manually. If you still cannot start after trying manually, please contact technical personnel to confirm the deployment environment.", Color.Red);
}
#endregion
@ -929,7 +930,7 @@ namespace Start
}
private void selectPathBtn_Click(object sender, EventArgs e)
private void selectPathBtn_Click(object sender, EventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
if (dialog.ShowDialog() == DialogResult.OK)
@ -938,7 +939,7 @@ namespace Start
confimDeployBtn.Enabled = true;
WinformLog($"部署路径选择成功", Color.Green);
WinformLog($"Deployment path selected successfully", Color.Green);
}
@ -948,7 +949,7 @@ namespace Start
{
Clipboard.SetText(machineTextBox.Text);
WinformLog("机器码拷贝到剪切板成功!", Color.Green);
WinformLog("The machine code was copied to the clipboard successfully!", Color.Green);
}
private void Main_Load(object sender, EventArgs e)
@ -980,13 +981,13 @@ namespace Start
{
foreach (var instanceName in key.GetValueNames())
{
WinformLog($"当前系统SQL Server 已安装实例: {instanceName}", Color.Green);
WinformLog($"The current system SQL Server installed instance: {instanceName}", Color.Green);
}
}
}
else
{
WinformLog("SQL Server 未安装,请安装后再运行该部署程序", Color.Red);
WinformLog("SQL Server is not installed, please install it before running the deployment program.", Color.Red);
}

View File

@ -1,4 +1,64 @@
<root>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">

Binary file not shown.

Binary file not shown.