简体   繁体   English

RegAsm.exe无法通过InstallShield 2016注册Dll

[英]RegAsm.exe unable to register Dll through installshield 2016

We have installshield 2016 and inside this we are running installer script. 我们有installshield 2016,在其中运行安装程序脚本。 That script is call through custom action. 该脚本是通过自定义操作调用的。

So we are written following commnad to register "mydll.dll" as below mentioned command, C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\regasm.exe /codebase mydll.dll The above command works perfectly fine when run manually through command prompt with administrative access.But fails through installer created using installshield script custom action. 因此,我们按照下面的命令编写,以注册“ mydll.dll”,如下所述:C:\\ Windows \\ Microsoft.NET \\ Framework \\ v4.0.30319 \\ regasm.exe / codebase mydll.dll手动运行时,上述命令运行良好通过具有管理访问权限的命令提示符进行操作,但通过使用installshield脚本自定义操作创建的安装程序失败。

To run command we use LaunchApplicationAndWait() and LaunchApplication() functions as strcmd = "path to cmd.exe" + "cmd.exe" strcmdopt = "path to regasm.exe" + "regasm.exe " + /codebase + path and name of dll 要运行命令,我们使用LaunchApplicationAndWait()和LaunchApplication()函数作为strcmd =“ cmd.exe的路径” +“ cmd.exe” strcmdopt =“ regasm.exe的路径” +“ regasm.exe” + / codebase +路径和dll名称

ret = LaunchApplication(strcmd, strcmdopt, windir, sw_normal, infinite, LAAW_OPTION_WAIT | LAAW_OPTION_SHELLEXECUTE) ret = LaunchApplication(strcmd,strcmdopt,windir,sw_normal,infinite,LAAW_OPTION_WAIT | LAAW_OPTION_SHELLEXECUTE)

similarly ret = LaunchApplicationAndWait(strcmd ,strcmdopt,LAAW_OPTION_WAIT | LAAW_OPTION_HIDDEN) 同样是ret = LaunchApplicationAndWait(strcmd,strcmdopt,LAAW_OPTION_WAIT | LAAW_OPTION_HIDDEN)

My Question is why both command not work when run through installshield custom action scripts 我的问题是,当通过installshield自定义操作脚本运行时,两个命令为何都不起作用

Is the dll distributed with the installation? dll是否随安装一起分发? if so, is the file present in the installdir (or wherever) when the script is called? 如果是这样,那么在调用脚本时文件是否存在于installdir中(或任何位置)? Maybe add some msg box for debug purposes to see if this condition is met. 也许添加一些msg框用于调试,以查看是否满足此条件。

Im using deferred custom action to register .dll via regasm and it works just fine. 我使用延迟的自定义操作通过regasm注册.dll,它工作得很好。

You shouldn't be calling Regasm during the install. 在安装过程中,您不应该致电Regasm。 You should put the DLL as a key file in it's own component and set the COM Interop = True attribute. 您应该将DLL作为密钥文件放入其自己的组件中,并设置COM Interop = True属性。 This will cause InstallShield to perform a regasm /regfile during the build and take the output and dynamically author it into the Registry table. 这将导致InstallShield在构建过程中执行regasm / regfile,并获取输出并将其动态编写到注册表表中。 During the install, MSI will simply copy the file and apply the registry entries and your done. 在安装过程中,MSI只需复制文件并应用注册表项即可。

Note: Per MSDN doco custom functions are not called during regasm /regfile so if you are doing any wierd self registration inside your class you'll need to author that into the installer. 注意:在regasm / regfile期间不会调用每个MSDN doco自定义函数,因此,如果您正在类中进行任何奇怪的自注册,则需要将其编写到安装程序中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Inno Setup RegAsm.exe错误 - Inno Setup RegAsm.exe Errors 从x64系统上的msi启动Regasm.exe时安装失败 - Regasm.exe fails in setup when launched from msi on x64 systems 使用 PowerShell 静默安装 InstallShield EXE 文件 - Silently install InstallShield EXE file with PowerShell 如何从installshield获取EXE目录? - How to get EXE directory from installshield? 来自源媒体的installshield启动exe - installshield launch exe from source media 如何从 Visual Studio 2008 安装项目使用 regasm 注册 .NET CCW - How to register a .NET CCW with regasm from a Visual Studio 2008 Setup project 在 InnoSetup 中注册 DLL/OCX - Register DLL/OCX in InnoSetup “错误 1324。无法更新密码。” 在 InstallShield 中运行使用命令行界面 (ISCmdBld.exe) 构建的安装程序时出现消息 - "Error 1324. Unable to update the password." message appears when running installer built using command line interface (ISCmdBld.exe) in InstallShield 无法通过自定义操作浏览/引用.net类库dll文件(这是产品部署和.Net exe文件的依赖关系的一部分) - Unable to browse/refer a .net class library dll file (which is part of product deployment and dependency of an .Net exe file) from custom action 使用 InstallShield 创建的 Setup.exe 文件已成功安装,但应用程序没有更新,它保留以前安装的版本 - Setup.exe file created with InstallShield is installed successfully but application doesnt update, it keeps previous installed version
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM