此 windows 安装程序包有问题。无法完成此安装所需的程序 运行

There is a problem with this windows installer package. A program required for this install to complete could not be run

我使用 WiX 创建了一个安装程序,安装过程顺利进行。然后我开始卸载,所以我创建了一个 bat 文件来删除创建的文件夹。但是我得到了这个错误:“There is a problem with this windows installer package. a program required for this install to complete could not be run”,但现在即使安装也不起作用。我撤消了我的工作并返回到以前的代码,但我仍然遇到同样的问题。

我删除了创建的文件,但一定有我遗漏的东西。

Custom Action Failure: That error message indicates a failing custom action. - summary of how to do MSI logging and many links for how to interpret log files.

删除文件夹:如果您不需要自定义操作,则不应使用它们。 . There are built-in MSI constructs to remove folders and files and also custom constructs in WiX and commercial MSI tools 这样做。关键问题是:您需要删除文件夹吗?如果它们在用户个人资料中,则不应该 - 那么它们就是用户数据。

WiX: Removing Files and Folders: a write-up on file and folder removal. Top Tip (as Edd China says): search github.com for samples.

  • RemoveFile (MSI built-in)
  • RemoveFolderEx (WiX-specific)

Un-Uninstallable MSI Packages:自定义卸载操作失败可能导致软件包似乎无法删除,但有很多选择- I would recommend trying Microsoft Fix It 首先。这里有更多选项(但 fixit 应该这样做):

  • MSI Failure to Uninstall
  • I screwed up, how can I uninstall my program?

Virtual Machine: 如果你是用虚拟机测试的话,直接把机器还原成"undo"的问题反而。当然,一定要使用虚拟机进行测试——特别是如果这项技术对你来说是新的的话。当然也特别适合在 "clean systems" 上测试安装。这样你就可以解决先决条件了。