如何在“开始"->“程序"中显示已安装的Exe? [英] How to Show installed Exe in Start->Programs?
问题描述
大家好,
我想在开始"->程序"->
中显示已安装的exe.
例如:开始->程序-> TeamViewer-> TeamViewer5
卸载TeamViewer5
表示我只想运行exe以及从开始"->程序"中卸载exe.
我知道如何将Exe添加到开始->程序中,但不能卸载.
让我知道解决方法.
这是卸载代码.
Hi All,
I want to show the installed exe in Start->Programs->
Exa:Start->Programs->TeamViewer->TeamViewer5
UninstallTeamViewer5
means i want to run the exe as well as uninstall the exe From Start->Programs only.
I know how to add an Exe to start->Programs, but not uninstall.
Let me know the solution.
Here is code for uninstallation.
private void Uninstall()
{
try
{
string[] arguments = Environment.GetCommandLineArgs();
foreach (string argument in arguments)
{
if (argument.Split('=')[0].ToLower() == "/u")
{
string guid = argument.Split('=')[1];
string path = Environment.GetFolderPath(Environment.SpecialFolder.System);
ProcessStartInfo si = new ProcessStartInfo(path + "/msiexec.exe", "/x " + guid);
Process.Start(si);
Close();
Application.Exit();
}
}
}
catch (Exception ex)
{
DataClass.LogError(ex);
}
}
但我收到以下异常.
DSIL has encountered a problem and needs to close. We are sorry for the inconvenience.
问候,
Pawan.
but i am getting the below Exception.
DSIL has encountered a problem and needs to close. We are sorry for the inconvenience.
Regards,
Pawan.
推荐答案
在解决方案中创建一个安装项目并阅读文档.
Create a setup project in your solution and read the documentation.
这篇关于如何在“开始"->“程序"中显示已安装的Exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!