public static void AbortRemoveUserAddInOnNextStart(string identity)
{
string removeFile = Path.Combine(addInInstallTemp, "remove.txt");
if (!File.Exists(removeFile)) {
return;
}
List<string> removeEntries = new List<string>();
using (StreamReader r = new StreamReader(removeFile)) {
string addInName;
while ((addInName = r.ReadLine()) != null) {
addInName = addInName.Trim();
if (addInName.Length > 0)
removeEntries.Add(addInName);
}
}
if (removeEntries.Remove(identity)) {
using (StreamWriter w = new StreamWriter(removeFile)) {
removeEntries.ForEach(w.WriteLine);
}
}
}