1

I created an empty project, with a visual studio msi installer. On install it just creates the folder and the exe file to the project.

But when i am trying to silent uninstall, it remove the installation from program list, but it leaves the folder. I need to remove the folder as well and want to do this without deleting it manually in code.

   // This is how to uninstall a basic msi app

        // Create the uninstall process.
        Process proc = new Process();

        // Define the parameters for the process
        proc.StartInfo.FileName = "msiexec.exe";

        // This is the Product Code from your Basic MSI InstallShield Project

        proc.StartInfo.Arguments = "/x" + " " + ProductCode + " " + "/qn";

        // Start the process.
        proc.Start();

        // Wait for the uninstall process to end.
        proc.WaitForInputIdle();
        proc.WaitForExit();

        // Release resources.
        proc.Close();
syncis
  • 1,395
  • 4
  • 25
  • 43

1 Answers1

0

Instruct the MSI to output a log file using the /L logfile.txt command line option for msiexec. It should tell you why the uninstaller cannot remove the installation file. Possible causes include the folder being locked (requiring a reboot to remove) or file permissions on the folder preventing deletion. See Wix installer could not remove installation folder or Installshield, uninstalling program not removing all folders for more information.

Community
  • 1
  • 1
akton
  • 14,148
  • 3
  • 43
  • 47