Cosmos/source/Cosmos.Build.Windows.Config/Tasks/InstallTemplateTask.cs
mterwoord_cp 166318031b
2008-01-11 18:40:20 +00:00

28 lines
No EOL
888 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32;
using System.IO;
namespace Cosmos.Build.Windows.Config.Tasks {
public class InstallTemplateTask: Task {
public override string Name {
get {
return "Install VS Template (C#)";
}
}
public override void Execute() {
this.OnStatus(0, "Installing Template");
string xTemplateFile = Tools.Dir("CosmosBoot.zip");
string xVSTemplateFolder;
using (var xKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\9.0")) {
xVSTemplateFolder = (string)xKey.GetValue("UserProjectTemplatesLocation");
xVSTemplateFolder = Path.Combine(xVSTemplateFolder, "Visual C#");
}
File.Copy(xTemplateFile, Path.Combine(xVSTemplateFolder, "CosmosBoot.zip"), true);
this.OnStatus(100, "Installing Template");
}
}
}