473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 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
http://msdn.microsoft.com/vstudio/su...l/default.aspx
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)
{
this.timer1.Enabled=false;
// test dll file info
// FileVersionInfo info =
FileVersionInfo.GetVersionInfo(@"C:\temp\Microsoft .VisualStudio.TextManager.Interop.8.0\8.0.0.0__b03 f5f7f11d50a3a\microsoft.visualstudio.textmanager.i nterop.8.0.dll");
// fileVersion "8.0.40607.16 (beta1.040607-1600)" string

string path=Environment.GetEnvironmentVariable("Windir");
path+="\\assembly";
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)
this.dirFiles(spp);
}

}
using (StreamWriter sw=new StreamWriter(@"c:\temp\delete
dirs.txt"))
foreach (string s in ddirs)
sw.WriteLine(s);
Environment.Exit(0);

}

ArrayList ddirs=new ArrayList();
public void dirFiles(string path)
{
string [] dirs=Directory.GetDirectories(path);
foreach (string dir in dirs)
dirFiles(dir);
string [] files=Directory.GetFiles(path);
bool fileDeleted=false;
foreach (string file in files)
{
string fp=file;
FileVersionInfo info =
FileVersionInfo.GetVersionInfo(fp);
if (info.FileVersion.ToLower().IndexOf("beta")>=0)
{
Trace.Assert((((TimeSpan)(System.DateTime.Now-File.GetCreationTime(fp))).Days>200),"File
too new");
File.Delete(fp);
fileDeleted=true;
}
}
files=Directory.GetFiles(path);
dirs=Directory.GetDirectories(path);
if (files.Length==0 && dirs.Length==0 && fileDeleted)
ddirs.Add(path);
}
}

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)
{
this.timer1.Enabled=false;
string s;
using (StreamReader sr=new StreamReader(@"c:\temp\delete
dirs.txt"))
{
while ((s=sr.ReadLine())!=null)
if (s.Length > 0)
{
if (Directory.Exists(s))
Directory.Delete(s);
string path = s.Substring(0,
s.LastIndexOf('\\') - 1);
if (Directory.Exists(path))
{
string[] files = Directory.GetFiles(path);
string[] dirs =
Directory.GetDirectories(path);
if (files.Length == 0 && dirs.Length == 0)
Directory.Delete(path);
}
}

}
Environment.Exit(0);
}


Jan 31 '06 #1
0 1357

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

48
by: ik | last post by:
ERROR after uninstalling SQL Server 2005 Express I get this message, SQLDMO has not been registered. Please re-run your setupand contact your system administrator. GREAT!!! ReInstalled SQL...
3
by: juanv | last post by:
When I am try to remove a corrupt .NET 2,0 Beta. the controlPanel/AddRemove programs wizard tells me that the file netfx.msi is not valid. I have extracted the file from dotNetFx.exe from two...
9
by: Marek Kurowski | last post by:
Yo! What mean when program is ALPHA or BETA version? I suppose it is not release version of program, but I don't know what it exactly mean. What it mean in your opinion? Marek Kurowski
5
by: Michael C | last post by:
While I think just about every IT expert out here agrees that the first commandment is Thou Shalt Not Install Beta Software in a Production Environment, the corollary to this would have to be that...
3
by: Benjamin.Nitschke | last post by:
Today I installed Microsoft Visual Studio 2005 Beta 2 from the Visual Studio Beta Experience Kit. After installing (which takes way to long) when I open Visual Studio 2005 I only get a message box...
14
by: Chuck | last post by:
I'm trying to install VWD Express Beta 2, but it's telling me that I need to uninstall MSDN Express Library 2005 Beta first. I uninstalled everything using the Add/Remove Programs control panel...
0
by: Jon Ripley | last post by:
I am writing a plugin for APIViewer, a popular development tool, this plugin is in the form of a Visual Basic 6.0 DLL and is based on source code from the supplied SDK. Everything seems to work...
5
by: Aziz | last post by:
Hi, I've recently contacted technical service of a web hosting company and asked them wheter or not they're gonna upgrade to PHP5 and MySQL5. Here's a quote from their response which confused me...
0
by: dtsearch | last post by:
A new beta build offers 64-bit developer access to dtSearch's "terabyte indexer," and preliminary MS Word 2007 and Excel 2007 support (in both 64-bit and 32-bit versions) BETHESDA, MD (July 22,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.