diff --git a/Kernel.cs b/Kernel.cs index 43a52d8..eebd37b 100644 --- a/Kernel.cs +++ b/Kernel.cs @@ -99,6 +99,14 @@ namespace CMLeonOS _logger.Info("Kernel", "Created system folder at 0:\\system"); } + // 检查并创建apps文件夹 + string appsFolderPath = @"0:\apps"; + if (!System.IO.Directory.Exists(appsFolderPath)) + { + System.IO.Directory.CreateDirectory(appsFolderPath); + _logger.Info("Kernel", "Created apps folder at 0:\\apps"); + } + // 初始化用户系统 _logger.Info("Kernel", "Initializing user system"); userSystem = new UserSystem(); diff --git a/shell/Shell.cs b/shell/Shell.cs index cae0044..40f3c1e 100644 --- a/shell/Shell.cs +++ b/shell/Shell.cs @@ -407,6 +407,22 @@ namespace CMLeonOS string expandedCommand = command; string expandedArgs = args; + if (command.StartsWith(":")) + { + string appName = command.Substring(1); + string appPath = "0:\\apps\\" + appName + ".lua"; + + if (System.IO.File.Exists(appPath)) + { + Commands.Script.LuaCommand.ExecuteLuaScript(appPath, fileSystem, this, ShowError, ShowWarning); + } + else + { + ShowError($"App not found: {appName}"); + } + return; + } + string aliasValue = Commands.AliasCommand.GetAlias(command); if (aliasValue != null) {