我想使用regasm.exe将.net dll注册为COM对象。我遇到了导致intstaller无法工作的问题。我相信这是因为我想要注册的文件在我想运行命令时没有进入已安装的目录。但有错误日志没有说明安装错误,我知道。任何想法,如何确保在运行自定义命令之前将文件移动到“程序文件”?
以下是我正在使用的内容:
<InstallExecuteSequence>
<Custom Action='comReg' After='InstallFinalize'>NOT REMOVE</Custom>
<Custom Action='comUnreg' Before='RemoveFiles'>REMOVE</Custom>
</InstallExecuteSequence>
<CustomAction Id='comReg' Directory='INSTALLDIR'
ExeCommand='"[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\regasm.exe" "[INSTALLDIR]my.dll"' Return='check' />
<CustomAction Id='comUnreg' Directory='INSTALLDIR' ExeCommand='"[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\regasm.exe" /u "[INSTALLDIR]my.dll"' Return='check' />
答案 0 :(得分:5)
你为什么要这样做?您将丢失在相应的MSI表中捕获该注册所提供的所有回滚。另外,通过该计划,您将遇到提升问题。
我高度建议使用heat.exe来捕获程序集的regasm并使用声明式方法。