diff --git a/Compiler/Compiler.cs b/Compiler/Compiler.cs index 454d633b6..afd3aa104 100644 --- a/Compiler/Compiler.cs +++ b/Compiler/Compiler.cs @@ -774,6 +774,10 @@ namespace PascalABCCompiler { return sourceFilesProvider; } + set + { + sourceFilesProvider = value; + } } private List errorsList = new List(); diff --git a/Compiler/ICompiler.cs b/Compiler/ICompiler.cs index cd830155d..e6e3fb72c 100644 --- a/Compiler/ICompiler.cs +++ b/Compiler/ICompiler.cs @@ -94,7 +94,7 @@ namespace PascalABCCompiler SourceFilesProviderDelegate SourceFilesProvider { - get; + get; set; } event ChangeCompilerStateEventDelegate OnChangeCompilerState; diff --git a/ReleaseGenerators/PascalABCNETMini.bat b/ReleaseGenerators/PascalABCNETMini.bat index 98f47c8bf..2e20d88c4 100644 --- a/ReleaseGenerators/PascalABCNETMini.bat +++ b/ReleaseGenerators/PascalABCNETMini.bat @@ -1 +1,2 @@ -"..\utils\NSIS\Unicode\makensis.exe" PascalABCNETMini.nsi +rem "..\utils\NSIS\Unicode\makensis.exe" PascalABCNETMini.nsi +"..\utils\NSIS2\makensis.exe" PascalABCNETMini.nsi diff --git a/ReleaseGenerators/PascalABCNETStandart.bat b/ReleaseGenerators/PascalABCNETStandart.bat index 94324dc7c..99e37bdc4 100644 --- a/ReleaseGenerators/PascalABCNETStandart.bat +++ b/ReleaseGenerators/PascalABCNETStandart.bat @@ -1 +1,2 @@ -"..\utils\NSIS\Unicode\makensis.exe" PascalABCNETStandart.nsi +rem "..\utils\NSIS\Unicode\makensis.exe" PascalABCNETStandart.nsi +"..\utils\NSIS2\makensis.exe" PascalABCNETStandart.nsi \ No newline at end of file diff --git a/ReleaseGenerators/PascalABCNETWithDotNet.bat b/ReleaseGenerators/PascalABCNETWithDotNet.bat index 17b509455..a55fc7de4 100644 --- a/ReleaseGenerators/PascalABCNETWithDotNet.bat +++ b/ReleaseGenerators/PascalABCNETWithDotNet.bat @@ -1 +1,2 @@ -"..\utils\NSIS\Unicode\makensis.exe" PascalABCNETWithDotNet.nsi +rem "..\utils\NSIS\Unicode\makensis.exe" PascalABCNETWithDotNet.nsi +"..\utils\NSIS2\makensis.exe" PascalABCNETWithDotNet.nsi diff --git a/ReleaseGenerators/PascalABCNETWithDotNet47.bat b/ReleaseGenerators/PascalABCNETWithDotNet47.bat index b82befc20..3603dca27 100644 --- a/ReleaseGenerators/PascalABCNETWithDotNet47.bat +++ b/ReleaseGenerators/PascalABCNETWithDotNet47.bat @@ -1 +1,2 @@ -"..\utils\NSIS\Unicode\makensis.exe" PascalABCNETWithDotNet47.nsi +rem "..\utils\NSIS\Unicode\makensis.exe" PascalABCNETWithDotNet47.nsi +"..\utils\NSIS2\makensis.exe" PascalABCNETWithDotNet47.nsi \ No newline at end of file diff --git a/ReleaseGenerators/PascalABCNET_DotNetHelp.bat b/ReleaseGenerators/PascalABCNET_DotNetHelp.bat index c4332ffd3..2e5f91671 100644 --- a/ReleaseGenerators/PascalABCNET_DotNetHelp.bat +++ b/ReleaseGenerators/PascalABCNET_DotNetHelp.bat @@ -1 +1,2 @@ -"..\utils\NSIS\makensis.exe" DotNetHelp.nsi +rem "..\utils\NSIS\makensis.exe" DotNetHelp.nsi +"..\utils\NSIS2\makensis.exe" DotNetHelp.nsi diff --git a/ReleaseGenerators/PascalABCNET_RusLib.bat b/ReleaseGenerators/PascalABCNET_RusLib.bat index aebe6f15c..6900e467e 100644 --- a/ReleaseGenerators/PascalABCNET_RusLib.bat +++ b/ReleaseGenerators/PascalABCNET_RusLib.bat @@ -1 +1,2 @@ -"..\utils\NSIS\makensis.exe" RussianHelpFramework.nsi +rem "..\utils\NSIS\makensis.exe" RussianHelpFramework.nsi +"..\utils\NSIS2\makensis.exe" RussianHelpFramework.nsi \ No newline at end of file diff --git a/Utils/NSIS2/Bin/GenPat.exe b/Utils/NSIS2/Bin/GenPat.exe new file mode 100644 index 000000000..d8afd4967 Binary files /dev/null and b/Utils/NSIS2/Bin/GenPat.exe differ diff --git a/Utils/NSIS2/Bin/MakeLangId.exe b/Utils/NSIS2/Bin/MakeLangId.exe new file mode 100644 index 000000000..2e09094a8 Binary files /dev/null and b/Utils/NSIS2/Bin/MakeLangId.exe differ diff --git a/Utils/NSIS2/Bin/RegTool-x86.bin b/Utils/NSIS2/Bin/RegTool-x86.bin new file mode 100644 index 000000000..e7abee087 Binary files /dev/null and b/Utils/NSIS2/Bin/RegTool-x86.bin differ diff --git a/Utils/NSIS2/Bin/makensis.exe b/Utils/NSIS2/Bin/makensis.exe new file mode 100644 index 000000000..99b650b8a Binary files /dev/null and b/Utils/NSIS2/Bin/makensis.exe differ diff --git a/Utils/NSIS2/Bin/zip2exe.exe b/Utils/NSIS2/Bin/zip2exe.exe new file mode 100644 index 000000000..b3eeb57b9 Binary files /dev/null and b/Utils/NSIS2/Bin/zip2exe.exe differ diff --git a/Utils/NSIS2/Bin/zlib1.dll b/Utils/NSIS2/Bin/zlib1.dll new file mode 100644 index 000000000..afe71c1d4 Binary files /dev/null and b/Utils/NSIS2/Bin/zlib1.dll differ diff --git a/VisualPlugins/TraningControlPlugin/TeacherControlPlugin.cs b/VisualPlugins/TraningControlPlugin/TeacherControlPlugin.cs index 2f27b525d..f85b8a535 100644 --- a/VisualPlugins/TraningControlPlugin/TeacherControlPlugin.cs +++ b/VisualPlugins/TraningControlPlugin/TeacherControlPlugin.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Windows.Forms; using System.IO; using VisualPascalABCPlugins.DBAccess; +using PascalABCCompiler; namespace VisualPascalABCPlugins { @@ -41,7 +42,7 @@ namespace VisualPascalABCPlugins public VisualPascalABCPlugin_TeacherControlPlugin(IWorkbench Workbench) { this.Workbench = Workbench; - VisualEnvironmentCompiler = Workbench.VisualEnvironmentCompiler; + VisualEnvironmentCompiler = Workbench.VisualEnvironmentCompiler; User = new SiteAccessProvider(); @@ -58,8 +59,28 @@ namespace VisualPascalABCPlugins // Регистрация обработчика this.Workbench.ServiceContainer.RunService.Starting += RunStartingHandler; this.Workbench.ServiceContainer.RunService.ChangeArgsBeforeRun += ChangeArgsBeforeRunHandler; + VisualEnvironmentCompiler.Compiler.SourceFilesProvider = TeacherSourceFilesProvider; //Workbench.ServiceContainer.BuildService.BeforeCompile += BeforeCompileHandler; } + + public object TeacherSourceFilesProvider(string FileName, SourceFileOperation FileOperation) + { + switch (FileOperation) + { + case SourceFileOperation.GetText: + if (!File.Exists(FileName)) return null; + string Text = FileReader.ReadFileContent(FileName, null); + // Здесь можно дешифровать когда надо + //File.AppendAllText("d:\\aaaa.txt", FileName + "\n"); + return Text; + case SourceFileOperation.Exists: + return File.Exists(FileName); + case SourceFileOperation.GetLastWriteTime: + return File.GetLastWriteTime(FileName); + } + return null; + } + public void Execute() { loginForm.SiteProvider = User;