Outlook 2003 加载项安装项目存在 COM DLL 部署问题

发布于 2024-08-27 18:53:34 字数 696 浏览 8 评论 0原文

我开发了一个 Outlook 2003 加载项,它使用 com dll 赎回。我创建了一个 Visual Studio 2008 安装项目,添加了一个自定义操作来运行“caspol.exe -machine -addgroup 1 -strong -hex [key] -noname -noversion FullTrust -n \"Name\" -description \"desc\"并将软件下的注册表项移至 HKLM,如 http:// msdn.microsoft.com/en-us/library/cc136646.aspx#AutoDeployVSTOse_InstallingtheAddinforAllUsers 为确保所有用户兼容性,

设置中(vsdrfCOM 引发了错误)。

我将 redemption.dll 包含在 vsdrfCOMSelfReg的 当在管理员帐户下的测试计算机上安装安装程序时,它在所有用户下运行良好,但是当我们使用在系统帐户下运行的公司范围的软件部署时,安装程​​序会执行,但如果我修复,则加载项不会加载。再次使用管理员帐户进行安装,系统帐户不应该具有安装所有组件所需的权限吗?我有什么选择? 感谢您的任何建议。

I developed an Outlook 2003 add-in which uses the com dll redemption. I created a visual studio 2008 setup project, added a custom action to run "caspol.exe -machine -addgroup 1 -strong -hex [key] -noname -noversion FullTrust -n \"Name\" -description \"desc\" and moved the registry keys under software to HKLM as described in http://msdn.microsoft.com/en-us/library/cc136646.aspx#AutoDeployVSTOse_InstallingtheAddinforAllUsers to ensure all-users compatibility.

I included the redemption.dll in the setup with vsdrfCOMSelfReg (vsdrfCOM throwed an error).

My problem is: When installing the setup on a test machine under an admin account, it runs fine under all users, however when we use the company wide software deployment which runs under a system account the setup executes but the add-in wont load. If I repair the installation with an admin account again it loads just fine. Shouldn't a system account have the required permissions to install all of the components? What options do I have?
Thanks for any suggestions.

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

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

发布评论

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

评论(2

歌枕肩 2024-09-03 18:53:34

在系统帐户下运行安装后,您是否在 HKCR 中看到 Redemption 注册表项?例如 HKEY_CLASSES_ROOT\Redemption.RDOSession ?

After the install runs under the system account, do you see the Redemption registry entries in HKCR? E.g. HKEY_CLASSES_ROOT\Redemption.RDOSession ?

非要怀念 2024-09-03 18:53:34

经过几个漫长的夜晚,我终于找到了问题所在。这实际上是关于代码访问安全性和 caspol.exe
部署 Outlook 2003 加载项的一些提示(Outlook 2007 有所不同)。
首先,在您的测试客户端上,请务必设置 Windows 环境变量 VSTO_LOGALERTS=1,因为这会将加载项的所有错误写入位于目标安装目录中的日志文件中。同样重要的是要知道,如果您的加载项在启动期间引发异常,则下次启动 Outlook 时它将在注册表中禁用(请参阅此处 什么会导致 Outlook 将 COM 插件的 LoadBehavior 更改为 2 - 除了未处理的异常?)。当您没有意识到时,这可能会引起一些混乱。

现在让我们继续讨论 caspol 问题。请务必首先使用强名称密钥对您的程序集进行签名。接下来,您需要确保您的程序集获得客户端的完全信任。为此,您可以使用以下设置运行 caspol.exe:“caspol.exe -machine -addgroup 1 -strong -hex [key] -noname -noversion FullTrust -n \"Name\" -description \"desc\"通过这些参数,您将给予之前用您的密钥签名的所有程序集对计算机的完全信任,这比

在生产环境中 给予整个目录 FullTrust 更好。 -In。您还可以为您的安装项目创建一个自定义操作来自动执行所有 caspol 操作,您可以使用此处提供的示例代码“http://msdn.microsoft.com/en-us/library/cc136646.aspx#AutoDeployVSTOse_CreatingtheCASPolicy" 但要注意:检查 -pp off如果策略更改提示打开,则自动安装将失败,因为它需要用户交互将 -pp 设置为关闭,执行策略并将其重新设置为打开。再次注意:示例代码不会等待进程退出。

在我弄清楚所有这些之后,即使对于“所有用户”安装,加载项的部署也很容易。希望对那里的任何人都有帮助。

After some endless nights I finally figured out the problem. It really was all about Code Access Security and the caspol.exe
Some tips for deploying Outlook 2003 Add-Ins (Outlook 2007 is different).
First of all, on your test client, be sure to set the Windows environment variable VSTO_LOGALERTS=1, since this will write all the errors of the Add-In to a log file which is located in your target install directory. It is also very important to know, that if your Add-In throws an exception during startup, it will be disabled in the registry on the next launch of Outlook (see here What can cause Outlook to change a COM-addin's LoadBehavior to 2 - other than unhandled exceptions?). This can cause some confusion when you're not aware of it.

Now let's move on to the caspol problems. Be sure to sign your assemblies with a strong name key first. Next, you need to make sure that your assemblies gain full trust on the client. To do this you may run the caspol.exe with the following settings: "caspol.exe -machine -addgroup 1 -strong -hex [key] -noname -noversion FullTrust -n \"Name\" -description \"desc\". With these arguments, you will give all the assemblies signed with your key earlier, full trust on the machine. This is way better than giving a whole directory FullTrust.

In a production environment, you will certainly want to create a setup for your Add-In. You might also create a custom action for your setup project to do all the caspol stuff automatically. You can use the sample code provided here "http://msdn.microsoft.com/en-us/library/cc136646.aspx#AutoDeployVSTOse_CreatingtheCASPolicy" but watch out: Check for -pp off in the caspol arguments. If the policy change prompt is on then you're automatic installation will fail since it requires user interaction. set -pp to off, execute the policy and set it back on. Watch out again: The sample code does not wait for exit of the process.

After I figured all that out, the deployment of the Add-In was easy, even for an "all users" installation. Hope that helps anyone out there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文