小编Ano*_*hra的帖子

以编程方式使用C#卸载软件

我想通过使用我的代码卸载软件,我已经尝试过wmic方法来执行卸载,但它无法在系统中找到我的软件.是否可以在不使用msi文件或任何设置文件的情况下卸载.我找到了这段代码,但它不起作用---

public string GetUninstallCommandFor(string productDisplayName)
{
    RegistryKey localMachine = Registry.LocalMachine;
    string productsRoot = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products";
    RegistryKey products = localMachine.OpenSubKey(productsRoot);
    string[] productFolders = products.GetSubKeyNames();

    foreach (string p in productFolders)
    {
        RegistryKey installProperties = products.OpenSubKey(p + @"\InstallProperties");
        if (installProperties != null)
        {
            string displayName = (string)installProperties.GetValue("DisplayName");
            if ((displayName != null) && (displayName.Contains(productDisplayName)))
            {
                string uninstallCommand = (string)installProperties.GetValue("UninstallString");
                return uninstallCommand;
            }
        }
    }
    return "";
}
Run Code Online (Sandbox Code Playgroud)

c# uninstall

11
推荐指数
2
解决办法
2万
查看次数

使用命令行选项将msi转换为exe ...

我想将msi文件转换为exe文件.当我使用msnxec的qn选项运行msi文件时,我的软件安静地安装.但现在我想将该msi文件转换为.exe文件,并且该exe文件使用msiexec/i"msi文件路径"/ qn选项运行msi文件,任何想法如何操作.

c# command-line windows-installer msiexec

7
推荐指数
2
解决办法
8637
查看次数

默默安装Dot net 4.5作为依赖

我有一个静默安装的设置,但它具有dot net framework 4.5的依赖性,所以我如何创建一个安装程序,以静默方式安装依赖项.

   Setup is created in Install Shield and it is  a wpf application
Run Code Online (Sandbox Code Playgroud)

c# install silent-installer

7
推荐指数
1
解决办法
3579
查看次数

错误:发布单击一次应用程序Wpf时无法连接

在此处输入图片说明发布WPF应用程序时出现错误。我正在桌面上发布,安装文件夹和发布文件夹的位置相同。\错误说-

错误1未能连接到'\ localhost \ Users \ Administrator \ Desktop \ deploy \',出现以下错误:无法创建网站'\ localhost \ Users \ Administrator \ Desktop \ deploy'。路径'\ localhost \ Users \ Administrator \ Desktop \ deploy'不存在,或者您没有访问权限。指定的路径无效。

wpf clickonce

4
推荐指数
1
解决办法
986
查看次数

c#中的系统驱动程序列表

我正在像在设备管理器中一样列出系统中已安装的驱动程序。我从 Win32_PnPSignedDriver 获得该列表,但它不提供图标。有什么方法可以找到它,或者我必须为列表添加自定义图标。我想像在设备管理器中一样生成输出。我在 C/C++ 中找到了一些参考,但在 c# 中没有。

在此处输入图片说明

c# wmi

1
推荐指数
1
解决办法
2171
查看次数