Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uninstall out-of-browser silverlight application programmatically

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)?

Edit

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/…

This can be used in:-

 dynamic cmd = AutomationFactory.CreateObject("WScript.Shell");
 cmd.Run(run, 1, true);

Is there any better solution?

like image 429
Alexander Zwitbaum Avatar asked Apr 29 '10 08:04

Alexander Zwitbaum


2 Answers

I'm not sure you can do this programmatically.

One option is to get the user to use Add/Remove programs to remove it.

Another is to use the silent installation option to remove it ( link - http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2010/03/24/silverlight-4-rc-and-the-silent-installation.aspx ) but that involves COM interop calls.

Mike.

like image 153
Mike Avatar answered Sep 28 '22 08:09

Mike


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) 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?

like image 39
Sidebp Avatar answered Sep 28 '22 07:09

Sidebp