Uninstall ClickOnce application with PowerShell?

Is it possible to uninstall a click once client app using windows powershell?

Get-WmiObject Win32_Product -Filter "name='xxxx'"

When I use above, click once application doesn't show up. But it works with other apps. (Getting everything without filter also doesn't contain the click once application. But its visible in add/remove program UI).

Please help.

Thanks in advance.

Answers


read this:

http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/51a44139-2477-4ebb-8567-9189063cf340/

EDIT after comment:

$InstalledApplicationNotMSI = Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall | foreach-object {Get-ItemProperty $_.PsPath}


$UninstallString = $InstalledApplicationNotMSI | ? { $_.displayname -eq "YourAppicationDisplayName" } | select uninstallstring


cmd /c $UninstallString.UninstallString

the problem is that is not an Silent unistallation. You have to add code for sendkey() TAB + ENTER to made it silently.


Here is a simple PowerShell script which uninstall the ClickOnce app (where DisplayName = your app process name]) and handles the UI:

$InstalledApplicationNotMSI = Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall | foreach-object {Get-ItemProperty $_.PsPath}
$UninstallString = $InstalledApplicationNotMSI | ? { $_.displayname -match "[your app process name]" } | select UninstallString 
$wshell = new-object -com wscript.shell
$selectedUninstallString = $UninstallString.UninstallString
$wshell.run("cmd /c $selectedUninstallString")
Start-Sleep 5
$wshell.sendkeys("`"OK`"~")

Need Your Help

How can I hide empty grid columns?

twitter-bootstrap twitter-bootstrap-3 responsive-design

I'm using bootstrap to make a responsive template for a CMS. I want to have a three column grid in the main area, but sometimes, there isn't content in all three columns. The CMS will add a class t...

Trigger Mouse Dragging in jQuery UI

javascript jquery user-interface triggers drag

Using jQuery 1.2.x and jQuery UI 1.5.x, one was able to trigger dragging manually like so: