forcefully uninstalling .msi setup from machine (control panel registery setup)

forcefully uninstalling .msi setup from machine (control panel registery setup)

31 Oct 2011 02:10:51

hey guys,

 

any idea how to forcefully uninstallation for setup (.msi) installed and regisetered with registry directory. ?

 

i tried with prodcut key and msiexe command execution from .net code but its not working for every machine. any other way ?

 

also, msizap command utility works on the machines which do have this installation on their machine.

 

please suggest the better way to do it through .NET code or command prompt

 

thank you.

Fresh   Boarder
Posts: 22
From 07-Oct-2009
You're Points: 98
Bookmark
re:forcefully uninstalling .msi setup from machine (control panel registery setup)31 Oct 2011 20:10:12

Hi,

In order remove the file fiercely, then  you have to use the OS in-built function than .net delete methods.

[DllImport("kernel32", CharSet=CharSet.Auto, SetLastError=true)]
internal static extern bool MoveFileEx(string lpExistingFileName, string lpNewFileName, int dwFlags);

Where you want to call this method, just pass first argument is path ,second will NULL and third will be 0x4.

But If you want to clear registry, then you have to use the .NET Class Registry to delete. Because, delete the registry by OS function is very tricky and at the same time, if anything goes wrong, then it will be issue.

http://msdn.microsoft.com/en-us/library/microsoft.win32.registry.aspx

thank you

RRaveen
Gold  Boarder
Posts: 156
From 03-Jun-2009
You're Points: 1106
Bookmark
^ Scroll to Top