-1

I am trying automate the unistallation of a product from Windows using C#.

I tried using

wmic product get name
wmic product where name="myAppName" call uninstall

but my product is not listed in wmic product get name output.

I have an Unistaller.exe file. So I tried calling that exe (using System.Diagnostics.Process) but a confirmation popup appears

"Are you sure you want to uninstall " with Yes/No.

This is NOT UAC

enter image description here

How to send Yes to the pop up?

Or how can I uninstall this exe programatically? This is not a msi

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
user2048204
  • 697
  • 4
  • 11
  • 26
  • have you tried /nointeractive ? - this is not a c# but a generic how to do request - google is your friend – BugFinder Feb 20 '17 at 09:43
  • http://stackoverflow.com/questions/30067976/programatically-uninstall-a-software-using-c-sharp check this already have an answer – Vikram Bose Feb 20 '17 at 09:45
  • @VikramBose Mine is not a msi setup. The Software is installed using .exe file – user2048204 Feb 20 '17 at 09:57
  • @user2048204 : This EXE is a so-called 'bootstrapper'. It doesn't perform the installation, it simply checks if the correct version of Windows Installer is present on the system, if not it launched the MSI Redistributable (MsiInstA.exe or MsiInstW.exe depending on the platform) and then launches MSIEXEC.EXE on the MSI file. – Vikram Bose Feb 20 '17 at 10:24
  • 1
    @user2048204 : In certain cases (especially Internet downloads), the MSI file and MSI redistributable are packed inside that EXE file, so you don't see they're there – Vikram Bose Feb 20 '17 at 10:26
  • @BugFinder I am unable to get the software listed in "wmic product get name". So I am not able to use "wmic product where "name like 'test%%'" call uninstall /nointeractive" – user2048204 Feb 20 '17 at 13:05
  • I resolved this. All i needed was somebody to tell me use "/S" along with uninstaller to avoid seeing the pop up. I dont know why people downvoted :( – user2048204 Feb 22 '17 at 07:51

1 Answers1

1

You could run the following shell command:

msiexec.exe /x {PRODUCT-GUID}

adding /quiet will run this in silent mode.