更新wix installer里的Guid

string path=@"\Setup\Installer";
var files = Directory.GetFiles(path);
foreach (var item in files)
{

string content = File.ReadAllText(item);

Regex r = new Regex("Guid=\"(\\S*)\"");
MatchCollection maches = r.Matches(content);
for (int i = maches.Count-1; i >=0; i--)
{
Match match = maches[i];
content = content.Remove(match.Index, match.Length).Insert(match.Index, "Guid=\""+Guid.NewGuid().ToString().ToUpper()+"\"");
}

Console.WriteLine(content);
File.WriteAllText(item, content);

}

上一篇:Android开发之闹钟


下一篇:有关怎样入门ACM