COM+使用命令行部署应用程序

发布于 2024-09-01 02:41:31 字数 141 浏览 9 评论 0原文

我需要将 COM dll 部署为 COM+ 应用程序。我曾经通过组件服务管理器 (dcomcnfg.exe) 执行此操作。但我的要求是从命令行部署它。有命令可以做到这一点吗?

更新:如何卸载?

谢谢。

I need to deploy my COM dll as a COM+ application. I used to do that from Component Services manager (dcomcnfg.exe). But my requirement is to deploy it from command-line. Is there a command to do that?

Update: And how to uninstall the same?

Thanks.

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

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

发布评论

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

评论(2

笑红尘 2024-09-08 02:41:31

这里还有几个脚本,它们将 COM+ 应用程序的设置转储到 XML 文件as 从 XML 文件安装应用程序。它为我提供了一个很好的框架,让我可以在不久前做类似的事情。它包含如何使用 COM+ 管理 API 创建和删除 COM+ 应用程序的示例代码。

Here are a couple of scripts that dump a COM+ application's settings to an XML file, as well as installs applications from and XML file. It provided me a good framework for doing something similar a while back. It contains example code of how to create and remove COM+ applications using the COM+ administration API.

只为守护你 2024-09-08 02:41:31

此 vbscript 片段创建一个应用程序并安装一个组件:

Dim catalog
Dim applications
Dim application
Set catalog = CreateObject("COMAdmin.COMAdminCatalog")
Set applications = catalog.GetCollection("Applications")
Call applications.Populate
Set application = applications.Add()


' ID is an arbitrary GUID, that you can create using uuidgen
application.Value("ID") = "{da2d72e3-f402-4f98-a415-66d21dafc0a9}"
application.Value("Name") = "SampleApp"
application.Value("Activation") = 0' COMAdmin.COMAdminActivationOptions.COMAdminActivationLocal
application.Value("ApplicationAccessChecksEnabled") = 0 'COMAdmin.COMAdminAccessChecksLevelOptions.COMAdminAccessChecksApplicationComponentLevel
application.Value("Description") = "Sample Application"
'application.Value("Identity") = "machine\administrator"
'application.Value("Password") = "YourPassword"
application.Value("RunForever") = True

Call applications.SaveChanges

catalog.InstallComponent "SampleApp", "C:\Documents and Settings\me\My Documents\Test\MyTestProj.dll", "", ""


Set application = Nothing
Set applications = Nothing
Set catalog = Nothing

它在 Windows XP 上运行 - 其他操作系统可能有不同的行为。而且看起来确实很有气质。如果它不起作用,那么错误就非常模糊且无益。

要删除,我认为您必须迭代应用程序中的组件并从列表中删除 按照此示例。我认为需要类似的方法来删除整个应用程序。

参考资料

请参阅配置 COM+ 以获得一篇易于理解的好文章(但不在脚本中)。 MSDN 有一个关于自动化 COM+ 管理 以及完整的 COM+ 管理参考

This vbscript snippet creates an application and installs a component:

Dim catalog
Dim applications
Dim application
Set catalog = CreateObject("COMAdmin.COMAdminCatalog")
Set applications = catalog.GetCollection("Applications")
Call applications.Populate
Set application = applications.Add()


' ID is an arbitrary GUID, that you can create using uuidgen
application.Value("ID") = "{da2d72e3-f402-4f98-a415-66d21dafc0a9}"
application.Value("Name") = "SampleApp"
application.Value("Activation") = 0' COMAdmin.COMAdminActivationOptions.COMAdminActivationLocal
application.Value("ApplicationAccessChecksEnabled") = 0 'COMAdmin.COMAdminAccessChecksLevelOptions.COMAdminAccessChecksApplicationComponentLevel
application.Value("Description") = "Sample Application"
'application.Value("Identity") = "machine\administrator"
'application.Value("Password") = "YourPassword"
application.Value("RunForever") = True

Call applications.SaveChanges

catalog.InstallComponent "SampleApp", "C:\Documents and Settings\me\My Documents\Test\MyTestProj.dll", "", ""


Set application = Nothing
Set applications = Nothing
Set catalog = Nothing

This is running on Windows XP -- other OS's may have different behavior. And it does seem to be pretty temperamental. If it doesn't work the errors are really vague and unhelpful.

To delete I think you will have to iterate over the the components in the application and remove from the list as per this example. I think a similar approach would be required to remove the entire application.

References

See Configurating COM+ for a good easy to understand article (but is not in script). MSDN has a good reference on Automating COM+ Administration and also the complete COM+ Administration Reference.

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