Permalink
Browse files

Checking for updates

  • Loading branch information...
1 parent b21e4ff commit c9fdd79703ad87db87d61a2d790bf623b6cd9c82 @ibond84 ibond84 committed Sep 16, 2016
@@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "2";
public const string Build = "0";
- public const string Revision = "1311";
+ public const string Revision = "1312";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
@@ -1,4 +1,4 @@
-%COREVERSION%=0
-%REVISION%=1311
%MINOR%=2
+%REVISION%=1312
+%COREVERSION%=0
%MAJOR%=3
@@ -0,0 +1 @@
+%MAJOR%.%MINOR%.%COREVERSION%.%REVISION%
Binary file not shown.
@@ -306,6 +306,11 @@ public interface IWorkbenchRunService
void KillAll();
}
+ public interface IWorkbenchUpdateService
+ {
+ void CheckForUpdates();
+ }
+
public interface IWorkbenchBuildService
{
string Compile(string FileName, bool rebuild, string RuntimeServicesModule, bool ForRun, bool RunWithEnvironment);
@@ -386,6 +391,7 @@ public interface IWorkbenchOperationsService
void AddTextToOutputWindowSync(string fileName, string text);
void WriteToOutputBox(string message, bool is_exc);
void ClearOutputTextBoxForTabPage(ICodeFileDocument tabPage);
+ void AddTabWithUrl(string title, string url);
}
public interface IWorkbenchOptionService
@@ -420,6 +426,7 @@ public interface IWorkbenchServiceContainer
IWorkbenchRunService RunService { get; }
IWorkbenchDesignerService DesignerService { get; }
IWorkbenchOperationsService OperationsService { get; }
+ IWorkbenchUpdateService UpdateService { get; }
}
public interface IWorkbench
@@ -1 +1 @@
-!define VERSION '3.2.0.1311'
+!define VERSION '3.2.0.1312'
Oops, something went wrong.
@@ -1448,6 +1448,11 @@ private void cmHelp_Click(object sender, EventArgs e)
__showhelpinqueue();
}
+ private void miCheckUpdates_Click(object sender, EventArgs e)
+ {
+ WorkbenchServiceFactory.UpdateService.CheckForUpdates();
+ }
+
private void tsHelp_Click(object sender, EventArgs e)
{
__showhelpinqueue();
Oops, something went wrong.
@@ -391,6 +391,7 @@
</Compile>
<Compile Include="Workbench\RunnerManagerHandlers.cs" />
<Compile Include="Workbench\RunService.cs" />
+ <Compile Include="Workbench\UpdateService.cs" />
<Compile Include="Workbench\VisibilityService.cs">
<SubType>Form</SubType>
</Compile>
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Windows.Forms;
+using VisualPascalABCPlugins;
+using System.Net;
+using System.Reflection;
+
+namespace VisualPascalABC
+{
+ class WorkbenchUpdateService : IWorkbenchUpdateService
+ {
+ public WorkbenchUpdateService()
+ {
+
+ }
+
+ public void CheckForUpdates()
+ {
+ int status = 1;//1 - up to date, 0 - not up to date, -1 error
+ try
+ {
+ WebClient client = new WebClient();
+ string newVersion = client.DownloadString("http://pascalabc.net/downloads/pabcversion.txt").Trim();
+ string curVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
+ if ((new Version(curVersion)).CompareTo(new Version(newVersion)) == -1)
+ status = 0;
+ }
+ catch
+ {
+ status = -1;
+ }
+ switch (status)
+ {
+ case 1:
+ MessageBox.Show(PascalABCCompiler.StringResources.Get("VP_MF_VERSION_IS_UP_DO_DATE"), PascalABCCompiler.StringResources.Get("VP_MF_UPDATE_CHECK"), MessageBoxButtons.OK);
+ break;
+ case 0:
+ if (MessageBox.Show(PascalABCCompiler.StringResources.Get("VP_MF_UPDATE_AVAILABLE"), PascalABCCompiler.StringResources.Get("VP_MF_UPDATE_CHECK"), MessageBoxButtons.YesNo) == DialogResult.Yes)
+ {
+ WorkbenchServiceFactory.OperationsService.AddTabWithUrl("PascalABC.NET", PascalABCCompiler.StringResources.Get("VP_MF_PABC_DOWNLOAD_PAGE"));
+ }
+ break;
+ case -1:
+ MessageBox.Show(PascalABCCompiler.StringResources.Get("VP_MF_UPDATE_CHECK_ERROR"), PascalABCCompiler.StringResources.Get("VP_MF_UPDATE_CHECK"), MessageBoxButtons.OK);
+ break;
+ }
+ }
+ }
+}
@@ -206,6 +206,11 @@ public void CloseBrowserTab(string text)
OpenBrowserDocuments.Remove(text);
}
+ public void AddTabWithUrl(string title, string url)
+ {
+ AddTabWithUrl(MainDockPanel, title, url);
+ }
+
public void AddTabWithUrl(DockPanel tabControl, string title, string url)
{
WebBrowserControl tp = null;//new WebBrowserControl();
@@ -23,6 +23,11 @@ public IWorkbenchOptionService OptionsService
get { return WorkbenchServiceFactory.OptionsService; }
}
+ public IWorkbenchUpdateService UpdateService
+ {
+ get { return WorkbenchServiceFactory.UpdateService; }
+ }
+
public IEditorService EditorService
{
get { return WorkbenchServiceFactory.EditorService; }
@@ -73,6 +78,7 @@ public class WorkbenchServiceFactory
{
static IWorkbenchBuildService _buildService;
static IWorkbenchRunService _runService;
+ static IWorkbenchUpdateService _updateService;
static CodeCompletionParserController _codeCompletionParserController;
static DebugHelper _debuggerManager;
@@ -96,6 +102,16 @@ public static IWorkbenchRunService RunService
}
}
+ public static IWorkbenchUpdateService UpdateService
+ {
+ get
+ {
+ if (_updateService == null)
+ _updateService = new WorkbenchUpdateService();
+ return _updateService;
+ }
+ }
+
public static IWorkbenchOptionService OptionsService
{
get
@@ -14,6 +14,7 @@ cd ..\..
Utils\IncrementVresion\IncrementVresion.exe Configuration\Version.defs REVISION 1
Utils\ReplaceInFiles\ReplaceInFiles.exe Configuration\Version.defs Configuration\GlobalAssemblyInfo.cs.tmpl Configuration\GlobalAssemblyInfo.cs
Utils\ReplaceInFiles\ReplaceInFiles.exe Configuration\Version.defs ReleaseGenerators\PascalABCNET_version.nsh.tmpl ReleaseGenerators\PascalABCNET_version.nsh
+Utils\ReplaceInFiles\ReplaceInFiles.exe Configuration\Version.defs Configuration\pabcversion.txt.tmpl Release\pabcversion.txt
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\msbuild.exe" /t:rebuild /property:Configuration=Release PascalABCNET.sln
@IF %ERRORLEVEL% NEQ 0 GOTO ERROR
@@ -46,6 +47,7 @@ ExecHide.exe gacutil.exe /i ..\bin\Lib\PABCRtl.dll
cd ..\bin
REM MPGORunner.exe
TestRunner.exe
+
cd ..\ReleaseGenerators
PascalABCNET_ALL.bat
GOTO EXIT
View
Binary file not shown.
@@ -330,7 +330,12 @@ PRJ_COMPANY=Company
PRJ_TRADEMARK=Trademark
PRJ_COPYRIGHT=Copyright
PRJ_GENERATE_XML_DOC=Generate XML doc
-
+VERSION_IS_UP_DO_DATE=PascalABC.NET is up to date
+UPDATE_AVAILABLE=New version of PascalABC.NET is available. Do you want to visit the download page?
+UPDATE_CHECK_ERROR=An error occurred while checking for updates
+UPDATE_CHECK=Checking for updates
+PABC_DOWNLOAD_PAGE=http://pascalabc.net/en/download
+M_CHECKUPDATES=Check for updates
//Options
%PREFIX%=VP_OC_VIEWOPTIONS_
NAME=General
@@ -330,7 +330,12 @@ PRJ_COMPANY=Компания
PRJ_TRADEMARK=Торговая марка
PRJ_COPYRIGHT=Copyright
PRJ_GENERATE_XML_DOC=Генерировать XML документацию
-
+VERSION_IS_UP_DO_DATE=Вы используете актуальную версию PascalABC.NET
+UPDATE_AVAILABLE=Доступна новая версия PascalABC.NET. Перейти на страницу скачивания?
+UPDATE_CHECK_ERROR=Ошибка при проверке обновлений
+UPDATE_CHECK=Проверка обновлений
+PABC_DOWNLOAD_PAGE=http://pascalabc.net/ssyilki-dlya-skachivaniya
+M_CHECKUPDATES=Проверить обновления
//Options
%PREFIX%=VP_OC_VIEWOPTIONS_
NAME=Общие

0 comments on commit c9fdd79

Please sign in to comment.