Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

Commit

Permalink
Merge pull request #22 from Microsoft/users/tobyhu/improv
Browse files Browse the repository at this point in the history
Users/tobyhu/improv
  • Loading branch information
tobyhu87 committed Apr 13, 2016
2 parents d015eac + 89b8cf2 commit cc45f82
Show file tree
Hide file tree
Showing 15 changed files with 656 additions and 989 deletions.
35 changes: 20 additions & 15 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
Visual Studio Uninstaller
Visual Studio Uninstaller
=========

Visual Studio Uninstallation sometimes can be unreliable and often leave out a lot of unwanted artifacts. Visual Studio Uninstaller is designed to thoroughly and reliably remove these unwanted artifacts.
This executable is designed to cleanup/scorch all Preview/RC/RTM releases of Visual Studio 2013, Visual Studio 2015 and Visual Studio vNext. It should be used as the last resort to clean up the user's system before resorting to reimaging the machine.

Running this application will break Visual Studio 2012 and earlier versions of Visual Studio because Visual Studio 2012 have some MSIs that have the same upgrade codes as Visual Studio 2013 and above.

How it works?
========

This app finds and uninstall every Preview/RC/RTM releases of Visual Studio 2013/2015/vNext. It will first execute uninstall command on the bundle, and then it will uninstall any stale MSIs. The application contains a master list of Bundle IDs and upgrade codes for every MSI ever chained in by Visual Studio 2013-vNext. It will not uninstall MSU or MSIs that marked as ReallyPermanent.

Status
========
Expand All @@ -24,12 +31,7 @@ Usage

**How to debug Total Uninstaller remotely?**

Uncommenting the following lines will not execute the actual uninstall. A debug flag will be added in the future.

//uti.bDebug = op.Debug; ip.DebugReporting = op.Debug;
//ip.DoNotExecuteProcess = true;

Note: Do not run this on your development machine without setting the `DoNotExecuteProcess` flag. This will prevent the application from uninstalling the very development environment you are working from.
IMPORTANT: Do not run this on your development machine without setting the `DoNotExecuteProcess` flag. This will prevent the application from uninstalling the very development environment you are working from.

To get the most out of the debug experience, I recommend the following:

Expand All @@ -44,14 +46,17 @@ To get the most out of the debug experience, I recommend the following:

**Using Total Uninstall:**

1. The user identifies which SKU of which release he wants to uninstall.
2. The user downloads one or more data files (from `DataFiles` folder) to a local folder.
3. The user executes Total Uninstaller and then `dir` to the directory containing the config files.
4. The user executes `load` command to the config files.
5. The user executes `list` to show which SKU and release is selected and installed.
6. The user executes `select` to select which SKU, release, version he wants to uninstall.
1. Download and unzip the zip file to a folder.
2. Open cmd.exe with Administrative privileges
2. Execute Setup.ForcedUninstall.exe
3. Press Y and hit enter to run the application.
4. If the application ask to reboot the system, please reboot the system, and rerun this application again.

**Commands:**

The user executes `uninstall` to perform the total uninstall.
1. help or /help or /? : Print usage.
2. break : run the application and pause until the user hit any key.
3. noprocess : run the application but does not uninstall anything.

Roadmap
========
Expand Down
Binary file added TotalUninstaller EULA.docx
Binary file not shown.
4 changes: 2 additions & 2 deletions Uninstaller.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Uninstall_Wrapper", "src\Uninstall_Wrapper\Uninstall_Wrapper.csproj", "{1E70C6F2-8570-4620-822E-E3F71BF1A0F7}"
EndProject
Expand Down
41 changes: 1 addition & 40 deletions src/Uninstall_Wrapper/ConsoleOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ static internal void SecurityWarning()
Console.WriteLine("\r\nPress enter to continue.");
Console.ResetColor();
Console.ReadLine();
Console.Clear();
}

static internal void SetConsoleAttributes()
{
Console.Clear();
Console.WindowHeight = Console.LargestWindowHeight < _height ? Console.LargestWindowHeight : _height;
Console.WindowWidth = _width;
Console.Title = "WixPdb sourced uninstall driver";
Expand All @@ -67,7 +65,7 @@ static internal void OpenTempDirectory()
static internal void SetUpLogging()
{
var time = DateTime.Now.ToString("MM-dd-yy-hhmmss", CultureInfo.InvariantCulture);
var logfilepath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "Microsoft.VS.Uninstaller_" + System.IO.Path.ChangeExtension(time, "log"));
var logfilepath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "dd_Microsoft.VS.Uninstaller_" + System.IO.Path.ChangeExtension(time, "log"));
Logger.LogLocation = logfilepath;
Logger.LoggingLevel = Logger.MessageLevel.Verbose;
Logger.ConsoleOutput = true;
Expand Down Expand Up @@ -187,44 +185,7 @@ static internal void SetupPrimitivesValues(bool debug, bool donotprocess)
PrimitiveObject.DebugReporting = debug;

//Initialize
Console.WriteLine(Logger.Log("Set filters in Primitives object", Logger.MessageLevel.Information, AppName));
Console.WriteLine(Logger.Log("Initializing configuration... Please wait.", Logger.MessageLevel.Information, AppName));
Console.WriteLine(Logger.Log("-----------------------------------------------------------------------", Logger.MessageLevel.Information, AppName));
PrimitiveObject.Initialize();
Console.WriteLine(Logger.Log("Calling GetUsage for dialog prompt.", Logger.MessageLevel.Information, AppName));
Console.Clear();

}

internal static void SelectReleaseFromAvailableBundles()
{
Logger.Log(String.Format(CultureInfo.InvariantCulture, "Select command started."), Logger.MessageLevel.Verbose, AppName);
MsgRelease = PrimitiveObject.GetReleases;

Console.WriteLine(PrintReleaseInfo());
Console.WriteLine("Select which releases you would like to target for uninstall. No action will be taken yet. This is only selection.\r\n");
Console.Write("Use a comma separated list if you want to target multiple releases. For a bundle to be uninstalled, it must be installed and in the package cache. ");
Console.Write("You can choose to uninstall a release you no longer have installed, but only MSIs associated will be uninstalled. The bundle uninstall will not be available.\r\n");
Console.WriteLine("i.e. 1, 2, 14, 8");
Console.Write("> ");
var userselect = Console.ReadLine();

PrimitiveObject.SelectedReleases(userselect);
PrimitiveObject.ReleaseOutput = PrimitiveObject.GetReleases;
Logger.Log(String.Format(CultureInfo.InvariantCulture, "Select command ended."), Logger.MessageLevel.Verbose, AppName);
}

internal static string PrintReleaseInfo()
{
var _sb = new StringBuilder();
MsgRelease = PrimitiveObject.ReleaseOutput;
_sb.AppendLine("Releases supported");
_sb.AppendLine("-----------------------------------------------------------------------------");
_sb.AppendLine("Product".PadRight(60) + "Status".PadRight(20));
_sb.AppendLine(MsgRelease);
Logger.Log(MsgRelease, Logger.MessageLevel.Information, AppName);
_sb.AppendLine("-----------------------------------------------------------------------------");
return _sb.ToString();
}
}
}
Binary file added src/Uninstall_Wrapper/DataFile.bin
Binary file not shown.
Loading

0 comments on commit cc45f82

Please sign in to comment.