This commit is contained in:
mterwoord_cp 2008-01-11 18:40:20 +00:00
parent ea060c0479
commit 166318031b
7 changed files with 51 additions and 48 deletions

View file

@ -13,37 +13,28 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Cosmos.Build.Windows.Config {
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window {
public Window1()
{
InitializeComponent();
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1: Window {
public Window1() {
InitializeComponent();
}
}
void q_Status(object sender, Cosmos.Build.Windows.Config.Tasks.TaskStatusEventArgs e)
{
EventHandler<Cosmos.Build.Windows.Config.Tasks.TaskStatusEventArgs> del = new EventHandler<Cosmos.Build.Windows.Config.Tasks.TaskStatusEventArgs>(q_Status_Invoke);
this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, del, sender, e);
}
void q_Status(object sender, Cosmos.Build.Windows.Config.Tasks.TaskStatusEventArgs e) {
taskLabel.Content = new Bold(new Run(e.TaskName));
statusLabel.Content = new Run(e.Message);
progressBar.Value = e.Percentage;
}
void q_Status_Invoke(object sender, Cosmos.Build.Windows.Config.Tasks.TaskStatusEventArgs e)
{
taskLabel.Content = new Bold(new Run(e.TaskName));
statusLabel.Content = new Run(e.Message);
progressBar.Value = e.Percentage;
}
private void beginButton_Click(object sender, RoutedEventArgs e)
{
beginButton.Visibility = Visibility.Hidden;
private void beginButton_Click(object sender, RoutedEventArgs e) {
beginButton.Visibility = Visibility.Hidden;
Tasks.TaskQueue q = new Cosmos.Build.Windows.Config.Tasks.TaskQueue();
q.Add(new Tasks.InstallAssembliesTask());
q.Add(new Tasks.InstallAssembliesTask());
q.Add(new Tasks.InstallTemplateTask());
q.Status += new EventHandler<Cosmos.Build.Windows.Config.Tasks.TaskStatusEventArgs>(q_Status);
q.BeginExecute();
}
}
q.Status += new EventHandler<Cosmos.Build.Windows.Config.Tasks.TaskStatusEventArgs>(q_Status);
q.Execute();
}
}
}

View file

@ -17,18 +17,23 @@ namespace Cosmos.Build.Windows.Config.Tasks {
string xBaseDir = Tools.Dir("GAC");
string xTargetDir;
OnStatus(0, "Installing Cosmos Assemblies");
using (var xKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\9.0", false)) {
xTargetDir = (string)xKey.GetValue("InstallDir");
xTargetDir = Path.Combine(xTargetDir, "PublicAssemblies");
}
var xKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\9.0", false);
xTargetDir = (string)xKey.GetValue("InstallDir");
xTargetDir = Path.Combine(xTargetDir, "PublicAssemblies");
string[] xItems = Directory.GetFiles(xBaseDir);
int xCurrent = 1;
foreach (string xFile in Directory.GetFiles(xBaseDir)) {
OnStatus(100 - (xItems.Length / xCurrent), "Copying " + Path.GetFileNameWithoutExtension(xFile));
OnStatus(100 - ((xItems.Length + 1) / xCurrent), "Copying " + Path.GetFileNameWithoutExtension(xFile));
File.Copy(xFile, Path.Combine(xTargetDir, Path.GetFileName(xFile)), true);
xCurrent++;
OnStatus(100 - (xItems.Length / xCurrent), "Copying " + Path.GetFileNameWithoutExtension(xFile));
}
xKey = Registry.CurrentUser.OpenSubKey(@"Software\Cosmos", true);
if (xKey == null) {
xKey = Registry.CurrentUser.CreateSubKey(@"Software\Cosmos");
}
xKey.SetValue("Build Path", Path.GetDirectoryName(typeof(InstallAssembliesTask).Assembly.Location));
xKey.Flush();
OnStatus(100, "Installing Cosmos Assemblies");
}
}

View file

@ -21,7 +21,7 @@ namespace Cosmos.Build.Windows.Config.Tasks {
xVSTemplateFolder = (string)xKey.GetValue("UserProjectTemplatesLocation");
xVSTemplateFolder = Path.Combine(xVSTemplateFolder, "Visual C#");
}
File.Copy(xTemplateFile, Path.Combine(xVSTemplateFolder, "CosmosBoot.zip"));
File.Copy(xTemplateFile, Path.Combine(xVSTemplateFolder, "CosmosBoot.zip"), true);
this.OnStatus(100, "Installing Template");
}
}

View file

@ -22,12 +22,6 @@ namespace Cosmos.Build.Windows.Config.Tasks
get { return _name; }
}
public void BeginExecute()
{
ThreadStart start = new ThreadStart(Execute);
start.BeginInvoke(null, null);
}
public override void Execute()
{
lock (_tasks)
@ -45,6 +39,7 @@ namespace Cosmos.Build.Windows.Config.Tasks
}
OnStatus(100, "Done");
} catch (Exception E) {
System.Windows.Clipboard.SetText(E.ToString());
OnStatus(100, "Error: " + E.Message);
}
}

View file

@ -16,12 +16,19 @@ namespace Cosmos.Build.Windows {
protected string mAsmPath;
public static string GetBuildPath() {
var xKey = Registry.CurrentUser.OpenSubKey(@"Software\Cosmos");
var xResult = (string)xKey.GetValue("Build Path");
if (!xResult.EndsWith(@"\")) {
xResult = xResult + @"\";
}
return xResult;
try {
var xKey = Registry.CurrentUser.OpenSubKey(@"Software\Cosmos");
var xResult = (string)xKey.GetValue("Build Path");
if (String.IsNullOrEmpty(xResult)) {
throw new Exception();
}
if (!xResult.EndsWith(@"\")) {
xResult = xResult + @"\";
}
return xResult;
} catch (Exception E) {
throw new Exception("Error while getting Cosmos Build Path!", E);
}
}
public Builder() {

View file

@ -25,7 +25,7 @@ namespace IL2CPU {
private Type nativeType = typeof(NativeOpCodeMap);
private static bool ParseArguments(IEnumerable<string> aArgs) {
Console.WriteLine("Indy IL2CPU");
Console.WriteLine("Initializing IL2CPU... This may take a minute so please wait for further status...");
Console.WriteLine();
foreach (string x in aArgs) {
// MtW: Slash added for powershell compatibility

View file

@ -11,5 +11,10 @@ del /Q "..\Build\setup.pdb"
del /Q "..\Build\ISO\output.bin"
del /Q "..\Build\Tools\asm\*.*"
del /Q "..\Build\Tools\Cosmos.Kernel.Plugs\*.pdb"
"..\Tools\7zip\7z.exe" a -tzip Test.zip "..\Build\*.*" -r
rmdir /S /Q "..\Pack"
mkdir "..\Pack"
mkdir "..\Pack\Cosmos"
xcopy /S "..\Build\*.*" "..\Pack\Cosmos"
"..\Tools\7zip\7z.exe" a -tzip Test.zip "..\Pack\*.*" -r
rmdir /S /Q "..\Pack"
pause