卸载软件国际化修改

master
hang 2024-01-30 10:30:06 +08:00
parent 77c594de08
commit 9d4d5df81e
2 changed files with 22 additions and 16 deletions

View File

@ -15,6 +15,12 @@
<Version>1.0.0.001</Version>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Other\**" />
<EmbeddedResource Remove="Other\**" />
<None Remove="Other\**" />
</ItemGroup>
<ItemGroup>
<None Remove="Resource\EIMedViewerData.rar" />
<None Remove="Resource\EIMedViewerService.rar" />
@ -49,11 +55,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="SharpCompress" Version="0.32.2" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="6.0.0" />
<PackageReference Include="SharpCompress" Version="0.36.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="8.0.0" />
</ItemGroup>
<ItemGroup>

View File

@ -101,15 +101,15 @@ var configFolder = $@"C:\ProgramData\.xingcang\";
var configPath = Path.Combine(configFolder, "config.json");
if (!File.Exists(configPath))
{
MyLog("The current system does not have an imaging system deployed and does not need to be uninstalled.");
MyLog("EI-Med Viewer has not been installed. No need to uninstall.");
Console.ReadLine();
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
MyLog("");
MyLog("Warning: Uninstalling the EI-Med Viewer service will clear the background services, databases, website files and all running data records, so please operate with caution. Before uninstalling, make sure your data has been backed up.");
MyLog(" Are you sure you want to continue uninstalling the service?Y/N");
MyLog("Warning: uninstalling EI-Med Viewer service will clear backend service, database, website files and all data records of the operation. Please make sure data has been backed up.");
MyLog(" Continue to uninstall the service?Y/N");
Console.ResetColor();
string confirm = Console.ReadLine();
@ -118,7 +118,7 @@ else
// 执行卸载操作
try
{
MyLog("Start reading activation information...");
MyLog("Start reading the activation information...");
var appsettingsJson = File.ReadAllText(configPath);
@ -141,7 +141,7 @@ else
nginxServiceName = jObject["nginxServiceName"]?.ToString(),
nginxServiceEXEPath = jObject["nginxServiceEXEPath"]?.ToString(),
};
MyLog("The activation information has been read, and start preparing for uninstall...");
MyLog("Activation information has been read. Prepare to uninstall…");
Process process = new Process();
process.StartInfo.FileName = "cmd.exe";
@ -153,7 +153,7 @@ else
process.Start();
MyLog("Stop and uninstall nginx service...");
MyLog("Stop and uninstall Nginx service...");
await ProcessStandardInputAsync(process, $" {configObj.nginxServiceEXEPath} uninstall ", configObj.nginxStartPath);
await ProcessStandardInputAsync(process, $"sc stop {configObj.nginxServiceName}");
await ProcessStandardInputAsync(process, $"sc delete {configObj.nginxServiceName}");
@ -171,14 +171,14 @@ else
MyLog("Stop and uninstall the backend service...");
MyLog("Stop and uninstall the backend service.");
await ProcessStandardInputAsync(process, $"sc stop {configObj.serviceName}");
await ProcessStandardInputAsync(process, $"sc delete {configObj.serviceName}");
MyLog("If the database is being used by other processes or connections, deletion will fail. You can manually delete the remaining database after uninstalling.");
MyLog("Execute the command of delete database...");
MyLog("The database cannot be deleted while being used by other processes or connections. After uninstallation, please delete the remaining database manually.");
MyLog("Execute the command of deleting database.");
await ProcessStandardInputAsync(process, $@" SQLCMD -S {configObj.server} -U {configObj.user} -P {configObj.password} -Q ""DROP DATABASE {configObj.dbName}"" ");
@ -193,8 +193,8 @@ else
MyLog("Delete activation information...");
DeleteFolderContents(configFolder);
MyLog("The EI-Med Viewer uninstallation is completed.");
MyLog("Automatically exit after 3 seconds...");
MyLog("The EI-Med Viewer service has been uninstalled.");
MyLog("Will automatically exit in 3 seconds…");
await Task.Delay(3000);
string cmdArgs = $"/C ping 127.0.0.1 -n 3 & rmdir /s /q \"{configObj.deployFolder}\"";
@ -209,7 +209,7 @@ else
catch (Exception ex)
{
MyLog("Problems encountered during uninstallation:" + ex.Message + " Please check whether there are other programs occupying related resources, please confirm and then uninstall again.");
MyLog("Problems encountered during the uninstallation process: " + ex.Message + " Please check whether other applications are occupying relevant resources. Once confirmed, try to uninstall again.");
Console.ReadLine();
}