【问题标题】:Silent MSI uninstall dont remove installation folder静默 MSI 卸载不删除安装文件夹
【发布时间】:2012-09-14 15:08:55
【问题描述】:

我使用 Visual Studio msi 安装程序创建了一个空项目。在安装时,它只是为项目创建文件夹和 exe 文件。

但是当我尝试静默卸载时,它会从程序列表中删除安装,但它会离开文件夹。我还需要删除该文件夹,并且希望在不手动删除代码的情况下执行此操作。

   // This is how to uninstall a basic msi app

        // Create the uninstall process.
        Process proc = new Process();

        // Define the parameters for the process
        proc.StartInfo.FileName = "msiexec.exe";

        // This is the Product Code from your Basic MSI InstallShield Project

        proc.StartInfo.Arguments = "/x" + " " + ProductCode + " " + "/qn";

        // Start the process.
        proc.Start();

        // Wait for the uninstall process to end.
        proc.WaitForInputIdle();
        proc.WaitForExit();

        // Release resources.
        proc.Close();

【问题讨论】:

    标签: c# .net visual-studio-2010 installation


    【解决方案1】:

    使用msiexec/L logfile.txt 命令行选项指示MSI 输出日志文件。它应该告诉您为什么卸载程序无法删除安装文件。可能的原因包括文件夹被锁定(需要重新启动才能删除)或文件夹的文件权限阻止删除。请参阅Wix installer could not remove installation folderInstallshield, uninstalling program not removing all folders 了解更多信息。

    【讨论】:

      猜你喜欢
      • 2011-06-18
      • 1970-01-01
      • 1970-01-01
      • 2011-01-02
      • 2018-08-17
      • 2014-02-19
      • 2023-04-06
      • 2011-07-01
      • 2011-02-23
      相关资源
      最近更新 更多