diff --git a/Build/VSIP/install.bat b/Build/VSIP/install.bat
index c2a0fb967..d0e74d026 100644
--- a/Build/VSIP/install.bat
+++ b/Build/VSIP/install.bat
@@ -36,7 +36,8 @@ xcopy /Y ..\..\source\Cosmos\Cosmos.Sys.Plugs\bin\Debug\Cosmos.Sys.Plugs.* .
xcopy /Y ..\..\source\Cosmos.Kernel.FileSystems\bin\debug\Cosmos.Sys.FileSystem.* .
xcopy /Y ..\..\source2\VSIP\Cosmos.VS.Package\bin\Debug\Cosmos.VS.Package.* .
xcopy /Y "..\..\source2\VSIP\Cosmos.VS.Package\obj\Debug\CosmosProject (C#).zip" .
-xcopy /Y "..\..\source2\VSIP\Cosmos.VS.Package\obj\Debug\CosmosExpress.zip" .
+xcopy /Y "..\..\source2\VSIP\Cosmos.VS.Package\obj\Debug\Cosmos.zip" .
+xcopy /Y "..\..\source2\VSIP\Cosmos.VS.Package\obj\Debug\CosmosKernel (C#).zip" .
REM splitup compiler:
xcopy /Y ..\..\source2\Compiler\Cosmos.Compiler.Assembler\bin\debug\Cosmos.Compiler.Assembler.* .
xcopy /Y ..\..\source2\Compiler\Cosmos.Compiler.Assembler.X86\bin\debug\Cosmos.Compiler.Assembler.X86.* .
diff --git a/Setup2/BuildUserKit.bat b/Setup2/BuildUserKit.bat
index 1188f69f5..b96c55d92 100644
--- a/Setup2/BuildUserKit.bat
+++ b/Setup2/BuildUserKit.bat
@@ -36,7 +36,9 @@ xcopy /Y ..\..\source\Cosmos\Cosmos.Sys.Plugs\bin\Debug\Cosmos.Sys.Plugs.* .
xcopy /Y ..\..\source\Cosmos.Kernel.FileSystems\bin\debug\Cosmos.Sys.FileSystem.* .
xcopy /Y ..\..\source2\VSIP\Cosmos.VS.Package\bin\Debug\Cosmos.VS.Package.* .
xcopy /Y "..\..\source2\VSIP\Cosmos.VS.Package\obj\Debug\CosmosProject (C#).zip" .
-xcopy /Y "..\..\source2\VSIP\Cosmos.VS.Package\obj\Debug\CosmosExpress.zip" .
+xcopy /Y "..\..\source2\VSIP\Cosmos.VS.Package\obj\Debug\Cosmos.zip" .
+xcopy /Y "..\..\source2\VSIP\Cosmos.VS.Package\obj\Debug\CosmosKernel (C#).zip" .
+xcopy /Y "..\..\source2\VSIP\Cosmos.VS.Package\obj\Debug\CosmosKernel (C#).zip" ".\CosmosKernel (C#) 2.zip"
REM splitup compiler:
xcopy /Y ..\..\source2\Compiler\Cosmos.Compiler.Assembler\bin\debug\Cosmos.Compiler.Assembler.* .
xcopy /Y ..\..\source2\Compiler\Cosmos.Compiler.Assembler.X86\bin\debug\Cosmos.Compiler.Assembler.X86.* .
@@ -53,4 +55,4 @@ IF EXIST "C:\Program Files\Inno Setup 5\ISCC.exe" (
) ELSE (
"C:\Program Files (x86)\Inno Setup 5\ISCC" /Q ..\..\Setup2\Cosmos.iss /dBuildConfiguration=Userkit
)
-cd ..\..\Setup2
\ No newline at end of file
+cd ..\..\Setup2
diff --git a/Setup2/Code.inc b/Setup2/Code.inc
index 995ff267d..bb88f4997 100644
--- a/Setup2/Code.inc
+++ b/Setup2/Code.inc
@@ -18,7 +18,8 @@ var
__VSNET2008_PATH,
__VSNET2010_PATH,
__VSNET2008_BASE_PATH,
- __VSNET2010_BASE_PATH: string;
+ __VSNET2010_BASE_PATH,
+ __CSharpExpress2008ProjectTemplatePath: string;
procedure InitializePaths;
begin
@@ -59,6 +60,10 @@ __NET_FRAMEWORK4_INSTALLED := ExpandConstant('{reg:HKLM\SOFTWARE\Microsoft\.NETF
__VSNET2008_BASE_PATH := ExpandFilename(AddBackslash(__VSNET2008_PATH)+'..\..');
if __VSNET2010 then
__VSNET2010_BASE_PATH := ExpandFilename(AddBackslash(__VSNET2010_PATH)+'..\..');
+
+ RegQueryStringValue(HKCU, 'SOFTWARE\Microsoft\VCSExpress\9.0', 'UserProjectTemplatesLocation', __CSharpExpress2008ProjectTemplatePath);
+
+ StringChangeEx(__CSharpExpress2008ProjectTemplatePath, '%USERPROFILE%', GetEnv('USERPROFILE'), False);
end;
@@ -120,12 +125,20 @@ end;
function Vb2010_Installed: Boolean;
begin
- result := RegValueExists(HKLM,'SOFTWARE\Microsoft\VisualStudio\10.0\Projects\{F184B08F-C81C-45f6-A57F-5ABD9991F28F}','Package');
+ result := RegValueExists(HKLM,'SOFTWARE\Microsoft\VisualStudio\10.0\Projects\{F184B08F-C81C-45f6-A57F-5ABD9991F28F}','Package');
end;
-function csharp2008_Installed: Boolean;
+function booltostr(value: Boolean) : string;
begin
- result := RegValueExists(HKLM,'SOFTWARE\Microsoft\VisualStudio\9.0\Projects\{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}','Package');
+ if value then
+ Result := 'true'
+ else
+ Result := 'false';
+end;
+
+function csharp2008_Installed(test: string): Boolean;
+begin
+ result := RegValueExists(HKLM,'SOFTWARE\Microsoft\VisualStudio\9.0\Projects\{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}','Package');
end;
function csharp2010_Installed: Boolean;
@@ -210,6 +223,20 @@ begin
Result := __NET_FRAMEWORK4_INSTALLED;
end;
+function IsCSharpExpress2008Installed(dummy: string): boolean;
+begin
+ if (Length(Trim(__CSharpExpress2008ProjectTemplatePath)) > 0) then
+ Result := True
+ else
+ Result := False;
+end;
+
+function GetCSharpExpress2008ProjectTemplatePath(dummy: string) : string;
+begin
+ InitializePaths;
+ Result := __CSharpExpress2008ProjectTemplatePath;
+ SaveStringToFile('c:\setup.log', Format('C# Express TemplatePath: "%s"'#13#10, [Result]), true);
+end;
function InitializeSetup: Boolean;
begin
diff --git a/Setup2/Cosmos.iss b/Setup2/Cosmos.iss
index 7ff5053ee..5f4abbabe 100644
--- a/Setup2/Cosmos.iss
+++ b/Setup2/Cosmos.iss
@@ -56,6 +56,7 @@ UninstallLogMode=overwrite
ChangesAssociations=yes
#include "Code.inc"
+#include "Events.inc"
[Languages]
Name: en; MessagesFile: compiler:Default.isl; InfoBeforeFile: .\setup2\Readme.txt
@@ -129,6 +130,7 @@ tw.BeveledLabel=Chinese Traditional
[Dirs]
Name: {code:VSNET2008_PATH|}\ProjectTemplates\Cosmos; Flags: uninsalwaysuninstall
+Name: {app}; Flags: uninsalwaysuninstall;
[Files]
Source: .\Build\Tools\*.exe; DestDir: {app}\Build\Tools; Flags: ignoreversion uninsremovereadonly
@@ -147,10 +149,13 @@ Source: .\Build\ISO\isolinux.*; DestDir: {app}\Build\ISO
Source: .\Build\ISO\mboot.c32; DestDir: {app}\Build\ISO
; Templates
-Source: ".\Build\VSIP\CosmosProject (C#).zip"; DestDir: {code:VSNET2008_PATH|}\ProjectTemplates\Cosmos; Flags: ignoreversion uninsremovereadonly; Check: csharp2008_Installed;
-Source: ".\Build\VSIP\CosmosExpress.zip"; DestDir: {code:VSNET2008_PATH|}\ProjectTemplates\Cosmos; Flags: ignoreversion uninsremovereadonly;
-
-
+; ; Install files into VS Integrated Shell (which includes full Visual Studio)
+Source: ".\Build\VSIP\CosmosProject (C#).zip"; DestDir: {code:VSNET2008_PATH|}\ProjectTemplates\Cosmos; Flags: ignoreversion uninsremovereadonly; Check: csharp2008_Installed('dummy');
+Source: ".\Build\VSIP\Cosmos.zip"; DestDir: {code:VSNET2008_PATH|}\ProjectTemplates\Cosmos; Flags: ignoreversion uninsremovereadonly;
+Source: ".\Build\VSIP\CosmosKernel (C#).zip"; DestDir: {code:VSNET2008_PATH|}\ProjectTemplates\Cosmos; Flags: ignoreversion uninsremovereadonly; Check: csharp2008_Installed('dummy');
+; ; Install templates into C# Express
+Source: ".\Build\VSIP\CosmosKernel (C#).zip"; DestDir: {code:GetCSharpExpress2008ProjectTemplatePath|}; DestName: "CosmosKernel (C#).zip"; Flags: ignoreversion uninsremovereadonly; Check: IsCSharpExpress2008Installed('dummy');
+Source: ".\Build\VSIP\Cosmos.zip"; DestDir: c:\; Flags: ignoreversion uninsremovereadonly
[Registry]
@@ -253,5 +258,4 @@ Root: HKCR; SubKey: Cosmos.ProjectFile\shell\open\command; ValueType: string; Va
[Run]
Filename: {code:VSNET2008_PATH|}\devenv.exe; Parameters: /setup; Flags: waituntilterminated
-[UninstallRun]
-Filename: {code:VSNET2008_PATH|}\devenv.exe; Parameters: /setup; Flags: waituntilterminated
+
diff --git a/source2/Build/Cosmos.Build.MSBuild/IL2CPU.cs b/source2/Build/Cosmos.Build.MSBuild/IL2CPU.cs
index 1a71d69bc..7fc563e64 100644
--- a/source2/Build/Cosmos.Build.MSBuild/IL2CPU.cs
+++ b/source2/Build/Cosmos.Build.MSBuild/IL2CPU.cs
@@ -235,17 +235,20 @@ namespace Cosmos.Build.MSBuild
if (xType.Name == "Kernel")
{
var xMethod = xType.GetMethod("Boot");
- if (!xMethod.IsStatic)
+ if (xMethod != null)
{
- continue;
+ if (!xMethod.IsStatic)
+ {
+ continue;
+ }
+ if (xInitMethod != null)
+ {
+ // already found an init method. log error.
+ Log.LogError("Project has multiple Kernel.Boot methods!");
+ return false;
+ }
+ xInitMethod = xMethod;
}
- if (xInitMethod != null)
- {
- // already found an init method. log error.
- Log.LogError("Project has multiple Kernel.Boot methods!");
- return false;
- }
- xInitMethod = xMethod;
}
}
}
diff --git a/source2/VSIP/Cosmos.VS.Package/Cosmos.VS.Package.csproj b/source2/VSIP/Cosmos.VS.Package/Cosmos.VS.Package.csproj
index 917aeea31..ec926da1a 100644
--- a/source2/VSIP/Cosmos.VS.Package/Cosmos.VS.Package.csproj
+++ b/source2/VSIP/Cosmos.VS.Package/Cosmos.VS.Package.csproj
@@ -175,6 +175,25 @@
+
+
+ Templates\Projects\CosmosKernel %28C#%29
+
+
+ Templates\Projects\CosmosKernel %28C#%29
+
+
+ Templates\Projects\CosmosKernel %28C#%29
+
+
+ Templates\Projects\CosmosKernel %28C#%29
+
+
+ Templates\Projects\CosmosKernel %28C#%29
+
+
+ Templates\Projects\CosmosKernel %28C#%29
+
Templates\Projects\CosmosProject %28C#%29
@@ -190,17 +209,16 @@
Templates\Projects\CosmosProject %28C#%29
-
- Templates\Projects\CosmosExpress
-
-
- Templates\Projects\CosmosExpress
+
+ Templates\Projects\Cosmos
-
- Templates\Projects\CosmosExpress
-
-
-
+
+ Templates\Projects\Cosmos
+
+
+ Templates\Projects\Cosmos
+
+
Templates\Projects\CosmosProject %28C#%29
diff --git a/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosExpress/CosmosExpress.vstemplate b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/Cosmos/Cosmos.vstemplate
similarity index 91%
rename from source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosExpress/CosmosExpress.vstemplate
rename to source2/VSIP/Cosmos.VS.Package/Templates/Projects/Cosmos/Cosmos.vstemplate
index 12b044743..f6c2aff3d 100644
--- a/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosExpress/CosmosExpress.vstemplate
+++ b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/Cosmos/Cosmos.vstemplate
@@ -1,6 +1,6 @@
- Cosmos Express Project
+ Cosmos Project
A project for running your code as operating system. Does not include any language.
Kernel.ico
Cosmos
diff --git a/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosExpress/CosmosProject.Cosmos b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/Cosmos/CosmosProject.Cosmos
similarity index 100%
rename from source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosExpress/CosmosProject.Cosmos
rename to source2/VSIP/Cosmos.VS.Package/Templates/Projects/Cosmos/CosmosProject.Cosmos
diff --git a/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosExpress/Kernel.ico b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/Cosmos/Kernel.ico
similarity index 100%
rename from source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosExpress/Kernel.ico
rename to source2/VSIP/Cosmos.VS.Package/Templates/Projects/Cosmos/Kernel.ico
diff --git a/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/AssemblyInfo.cs b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/AssemblyInfo.cs
new file mode 100644
index 000000000..8c251fe82
--- /dev/null
+++ b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Package Name")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Company")]
+[assembly: AssemblyProduct("Package Name")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: ComVisible(false)]
+[assembly: CLSCompliant(false)]
+[assembly: NeutralResourcesLanguage("en-US")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+
+
+
diff --git a/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/CSharpProj.vstemplate b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/CSharpProj.vstemplate
new file mode 100644
index 000000000..57ab7c293
--- /dev/null
+++ b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/CSharpProj.vstemplate
@@ -0,0 +1,19 @@
+
+
+ Cosmos Kernel (C#)
+ A project for creating a Cosmos Kernel
+ Kernel.ico
+ CSharp
+
+ true
+ CSharpKernel
+ true
+
+
+
+ AssemblyInfo.cs
+ Kernel.cs
+
+
+
\ No newline at end of file
diff --git a/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/CSharpProject.csproj b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/CSharpProject.csproj
new file mode 100644
index 000000000..d2671f664
--- /dev/null
+++ b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/CSharpProject.csproj
@@ -0,0 +1,55 @@
+
+
+
+ Debug
+ AnyCPU
+ 8.0.30703
+ 2.0
+ $guid1$
+ Library
+ Properties
+ $safeprojectname$
+ $safeprojectname$
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/Kernel.cs b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/Kernel.cs
new file mode 100644
index 000000000..7e678a4ea
--- /dev/null
+++ b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/Kernel.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace $safeprojectname$
+{
+ public class Kernel
+ {
+ public static void Boot()
+ {
+ // Boot the Cosmos kernel:
+ Cosmos.Sys.Boot xBoot = new Cosmos.Sys.Boot();
+ xBoot.Execute();
+
+ Console.WriteLine("Cosmos booted successfully. Type a line of text to get it echoed back:");
+ string xResult = Console.ReadLine();
+ Console.Write("Text typed: ");
+ Console.WriteLine(xResult);
+ }
+ }
+}
diff --git a/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/Kernel.ico b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/Kernel.ico
new file mode 100644
index 000000000..fcdc40183
Binary files /dev/null and b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/Kernel.ico differ
diff --git a/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/Readme.txt b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/Readme.txt
new file mode 100644
index 000000000..8bcd39958
--- /dev/null
+++ b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/CosmosKernel (C#)/Readme.txt
@@ -0,0 +1,2 @@
+$GeneratedGuid1$ .Cosmos id
+$GeneratedGuid2$ .csproj id
\ No newline at end of file
diff --git a/source2/VSIP/Cosmos.VS.Package/Templates/Projects/Readme.txt b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/Readme.txt
new file mode 100644
index 000000000..a02977a03
--- /dev/null
+++ b/source2/VSIP/Cosmos.VS.Package/Templates/Projects/Readme.txt
@@ -0,0 +1,8 @@
+Overview of templates.
+
++ Cosmos
+ Only generates a .Cosmos file
++ CosmosKernel (C#)
+ Only generates a .csproj file
++ CosmosProject (C#)
+ Generates both a .csproj and a .Cosmos file.
\ No newline at end of file