472,121 Members | 1,454 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,121 software developers and data experts.

removing Beta versions

My PC was a completely screwed up mess. Nieither the unistall
tool or the manual uninstall at
worked. I also tried the VS 2005 beta cleanup tool at
http://blogs.msdn.com/astebner/archi...25/411974.aspx. This
tool was designed to remove Beta 1 in preparation for Beta 2. I
needed to remove Beta 1 in preparation for VS2005 Pro, not exactly the
same thing. No matter what I did VS2005 still crashed on startup;
though I think the 3 steps: uninstall tool, manual uninstall, and VS
2005 beta cleanup tool did move me closer.

In despiration I wrote me own tool to remove anything in the GAC
whose File Version included the word "beta" That was an extension of
what the VS 2005 beta cleanup tool did. To my shock it worked!

Here is the VS2003 code to remove "beta":

private void timer1_Tick(object sender, System.EventArgs e)
// test dll file info
// FileVersionInfo info =
FileVersionInfo.GetVersionInfo(@"C:\temp\Microsoft .VisualStudio.TextManager.Interop.8.0\ f5f7f11d50a3a\microsoft.visualstudio.textmanager.i nterop.8.0.dll");
// fileVersion "8.0.40607.16 (beta1.040607-1600)" string

string path=Environment.GetEnvironmentVariable("Windir");
string [] dirs=Directory.GetDirectories(path);
foreach (string pp in dirs)
if (pp.Substring(pp.LastIndexOf('\\')+1,3)=="GAC")
string [] sdirs=Directory.GetDirectories(pp);
foreach (string spp in sdirs)

using (StreamWriter sw=new StreamWriter(@"c:\temp\delete
foreach (string s in ddirs)


ArrayList ddirs=new ArrayList();
public void dirFiles(string path)
string [] dirs=Directory.GetDirectories(path);
foreach (string dir in dirs)
string [] files=Directory.GetFiles(path);
bool fileDeleted=false;
foreach (string file in files)
string fp=file;
FileVersionInfo info =
if (info.FileVersion.ToLower().IndexOf("beta")>=0)
too new");
if (files.Length==0 && dirs.Length==0 && fileDeleted)

Here is the VS2005 Pro code to delete empty directories from the GAC
that I ran after I got VS2005 working with the above code:

private void timer1_Tick(object sender, System.EventArgs e)
string s;
using (StreamReader sr=new StreamReader(@"c:\temp\delete
while ((s=sr.ReadLine())!=null)
if (s.Length > 0)
if (Directory.Exists(s))
string path = s.Substring(0,
s.LastIndexOf('\\') - 1);
if (Directory.Exists(path))
string[] files = Directory.GetFiles(path);
string[] dirs =
if (files.Length == 0 && dirs.Length == 0)


Jan 31 '06 #1
0 1286

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by juanv | last post: by
9 posts views Thread by Marek Kurowski | last post: by
5 posts views Thread by Michael C | last post: by
3 posts views Thread by Benjamin.Nitschke | last post: by
14 posts views Thread by Chuck | last post: by
reply views Thread by Jon Ripley | last post: by
5 posts views Thread by Aziz | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.