以编程方式卸载浏览器外的Silverlight应用程序 [英] Uninstall out-of-browser silverlight application programmatically
问题描述
如何通过编程方式卸载浏览器外Silverlight 4应用程序而不使用contextmenu(例如,如果我要替换上下文菜单)?
How to uninstall out-of-browser silverlight 4 application programmatically instead of using the contextmenu (e.g. if I want to replace the context menu)?
编辑
我在在不涉及浏览器的情况下安装Silverlight应用程序 如何通过调用命令行进行卸载:
I have found in "Installing Silverlight applications without the browser involved" how to uninstall by calling the command-line:
%ProgramFiles%\Microsoft Silverlight\sllauncher.exe / uninstall/origin:silverlight.net/content/samples/apps/…
"%ProgramFiles%\Microsoft Silverlight\sllauncher.exe" /uninstall /origin:silverlight.net/content/samples/apps/…
这可用于:-
dynamic cmd = AutomationFactory.CreateObject("WScript.Shell");
cmd.Run(run, 1, true);
有没有更好的解决方案?
Is there any better solution?
推荐答案
可以肯定的是,如Mike所说,如果不诉诸COM interop,这是不可能的,我也想问一下这是否是个好主意,因为:
Pretty certain this isn't possible without resorting to COM interop as Mike says, also I'd question if it's a good idea since:
1)无疑,删除卸载选项将使许多用户烦恼,这是一种不好的做法。
2)您说您要实现一个新的上下文菜单吗?除非这不是LOB应用程序,否则我将对此保持警惕,因为许多用户将不会习惯于访问Web应用程序中的上下文菜单,而对我而言,该菜单的HCI较差。如果它是LOB应用程序,那么添加/删除程序将是一个好的解决方案?
1) Removing the uninstall option will no doubt annoy many users and is bad practice. 2) You say you are looking to implement a new context menu? Unless this is a LOB application I'd be wary of this as many users won't be used to accessing context menus in a web app which to me is poor HCI. If it is a LOB application then Add/remove programs would be an OK solution?
这篇关于以编程方式卸载浏览器外的Silverlight应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!