在 x64 系统上从 msi 启动时,Regasm.exe 安装失败

发布于 2024-10-20 10:21:06 字数 484 浏览 5 评论 0原文

我的安装有问题。安装运行命令行选项,通过 /codebase 选项来 regasm.exe 一个 .net com dll。

当我从 Setup.exe 运行安装(由 installshield 构建)时,一切正常。

当我从 .msi 运行安装时,regasm 调用不成功,没有注册任何内容,程序也不会运行。

此问题似乎仅影响基于 x64 的系统,而在 x86 系统上,任一方法都有效。

有什么想法可能是什么问题吗?

编辑

问题似乎是即使以管理员身份登录,msi 也不会以管理员身份执行。我仍然会看到 UAC 对话框,但只是在向导进行到一半时出现。当从 setup.exe 启动时,我会在向导出现之前看到 UAC 面板。如果我从管理命令提示符中运行 .msi,那么我不会看到 UAC 面板,并且一切都会按预期工作。

所以我想一切都按预期进行,是吗?为了让自定义安装操作正常工作,msi 必须以管理权限运行?

I have an issue with an installation. The installation runs a command line option to regasm.exe a .net com dll with the /codebase option.

When I run the installation (built by installshield) from the Setup.exe then everything works fine.

When I run the installation from the .msi instead then the regasm call does not succeed, nothing is registered and the program does not run.

This problem only seems to affect x64 based systems, and on x86 systems either method works.

Any ideas what the problem might be?

EDIT

The problem seems to be that even when logged in as an administrator the msi is not executed as an administrator. I still get a UAC dialog, but only mid way through the wizard. When launched from the setup.exe I get the UAC panel before the wizard appears. If I run the .msi from and an administrative command prompt then I get no UAC panel and everything works as expected.

So I imagine that everything is working as expected is it? And that to have the custom install actions work correctly the msi must be run with administrative privileges?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷乱花海 2024-10-27 10:21:06

这篇博文讨论了运行的必要性来自安装程序上下文的具有管理员权限的可执行文件。有问题的可执行文件是不同的(appcmd.exe,与您的情况下的regasm.exe),但问题听起来相似。

我认为该帖子中与您相关的部分是:

事实证明,默认情况下,自定义操作会模拟启动安装的用户,而无需安装程序本身运行的管理员权限。这可以通过将 CustomAction 的 Impersonate 属性设置为“no”来更改。这还需要添加 Execute=”deferred”,因此,在 InstallFinalize 之前而不是之后运行自定义操作。

我对 InstallShield 不熟悉,但看看是否有办法标记运行 regasm.exe 的自定义操作。您想要查找可设置的选项,其措辞类似于以下之一(这些都是表达同一事物的不同方式):

  • 设置 msidbCustomActionTypeNoImpersonate
  • 设置自定义操作为“系统上下文中的延迟执行”
  • 设置“不模拟的延迟执行”的自定义操作

This blog post discusses the need to run an executable with administrator priveleges from the context of an installer. The executable in question is different (appcmd.exe, versus regasm.exe in your case), but the problem sounds similar.

The piece of that post that I think is relevant to you is this:

It turns out that by default, custom actions impersonate the user that started the install, without the administrator elevation that the installer itself runs under. This can be changed by setting the CustomAction’s Impersonate attribute to “no”. That also required adding Execute=”deferred”, and as a result, having the custom action run before InstallFinalize rather than after.

I'm not familiar with InstallShield, but see if there is a way to mark the custom action that runs regasm.exe. You want to look for option(s) that you can set that are phrased similarly to one of the following (these are all different ways of saying the same thing):

  • Set the msidbCustomActionTypeNoImpersonate bit
  • Set the custom action for "deferred execution in system context"
  • Set the custom action for "deferred execution with no impersonation"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文