asp.net – Web安装项目无法安装动态数据站点:“安装程序被中断”

安装程序的最后一个阶段失败,显示以下消息:

Installation Incomplete

The installer was interrupted before [project] could be installed. You need to restart the installer to try again.

运行msiexec / i installer.msi / l * vx setup.log在安装日志中显示以下条目:

INFO   : [...] [ApplyWebFolderProperties]: Getting web folder property token...
INFO   : [...] [ApplyWebFolderProperties]: Token is '/LM/W3SVC/1/ROOT/ProjectDir/DynamicData/Filters'.
INFO   : [...] [ApplyWebFolderProperties]: Getting METADATA_HANDLE for the directory '/LM/W3SVC/1/ROOT/ProjectDir/DynamicData/Filters'.
ERROR  : [...] [ApplyWebFolderProperties]: FAILED:  -2147024893
ERROR  : [...] [ApplyWebFolderProperties]: FAILED:  -2147024893
ERROR  : [...] [ApplyWebFolderProperties]: Custom Action failed with code: '3'
ERROR  : [...] [ApplyWebFolderProperties]: Custom Action failed with code: '3'
INFO   : [...] [ApplyWebFolderProperties]: Custom Action completed with return code: '3'

以前使用Web安装项目安装相同的Web应用程序没有任何问题.将Web应用程序从.NET 3.5 SP1升级到.NET 4.0后,问题就出现了.

最佳答案
This blog entry指出问题:

Which got me started thinking, I have
a subfolder named filters. Changing
nothing else but renaming the filters
subfolder made it finish properly. I’m
assuming you might have the same
problems with folders named apppools,
info, or 1 as well.

(强调我的)

不幸的是,Filters是动态数据中的硬编码文件夹名称.如果你看一下FilterFactory,似乎没有任何方法来覆盖那个值,看看MetaModel的FilterFactory属性是如何标记为虚拟的.如果我们无法更改文件夹名称,那么我们必须查看修复安装程序…

ApplyWebFolderProperties自定义操作引发了安装程序错误.该操作不是Windows Installer内置的 – 它是由Web Setup Project添加的.这很有帮助,因为这意味着我们可以用WiRunSQL.vbs删除它:

cscript WiRunSQL.vbs installer.msi "DELETE FROM CustomAction WHERE Action='WEBCA_ApplyWebFolderProperties'" 

请注意,ApplyWebFolderProperties的实际名称是WEBCA_ApplyWebFolderProperties.看到行动似乎没有记录在任何地方,请注意.但它似乎并不太重要.

要自动执行变通方法,您可以将命令添加到安装项目的PostBuildEvent中,如下所示:

cscript.exe "$(ProjectDir)..\WiRunSQL.vbs" "$(BuiltOuputPath)" "DELETE FROM CustomAction WHERE Action='WEBCA_ApplyWebFolderProperties'"

如果有人知道安装名为Filters的文件夹的更好方法,我很乐意听到它.

点赞