首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何以提升的权限从WiX运行ngen?

如何以提升的权限从WiX运行ngen?
EN

Stack Overflow用户
提问于 2011-04-08 23:44:04
回答 1查看 1K关注 0票数 1

我正在尝试使用this article在我的安装程序中包含ngen。我希望在安装过程中(与priority=0)同步运行ngen,但它需要管理员权限才能运行。因此,现在我在日志中有以下消息:

代码语言:javascript
复制
MSI (s) (74:2C) [18:30:14:310]: Invoking remote custom action. DLL: C:\windows\Installer\MSI60B0.tmp, Entrypoint: ExecNetFx
ExecNetFx:  Microsoft (R) CLR Native Image Generator - Version 4.0.30319.1
ExecNetFx:  Copyright (c) Microsoft Corporation.  All rights reserved.
ExecNetFx:  Installing assembly C:\myapp\myapp.exe
ExecNetFx:  Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
ExecNetFx:  Administrator permissions are needed to use the selected options.  Use an administrator command prompt to complete these tasks.
ExecNetFx:  Error 0xffffffff: Command line returned an error.
ExecNetFx:  failed to execute Ngen command (with error 0xffffffff): C:\windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe install "C:\myapp\myapp.exe", continuing anyway
ExecNetFx:  Microsoft (R) CLR Native Image Generator - Version 4.0.30319.1
ExecNetFx:  Copyright (c) Microsoft Corporation.  All rights reserved.
ExecNetFx:  Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
ExecNetFx:  Administrator permissions are needed to use the selected options.  Use an administrator command prompt to complete these tasks.
ExecNetFx:  Error 0xffffffff: Command line returned an error.
ExecNetFx:  failed to execute Ngen command (with error 0xffffffff): C:\windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe update /queue, continuing anyway

当ngen正在启动时,有没有简单的方法来询问用户管理权限(使用标准的UAC提示符)?如果用户按下"No",我想在没有ngen的情况下继续。如果是-运行ngen并预编译我的应用程序。有什么想法吗?

谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-04-09 00:30:07

WiX已经运行了提升的NGen自定义操作(Execute="deferred“Impersonate="no")。您的.msi包必须针对每台机器才能运行它们。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5597524

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档