diff --git a/SCrawler.Updater/.editorconfig b/SCrawler.Updater/.editorconfig new file mode 100644 index 0000000..3a44845 --- /dev/null +++ b/SCrawler.Updater/.editorconfig @@ -0,0 +1,3 @@ +[*.vb] +# Modifier preferences +file_header_template = Copyright (C) Andy https://github.com/AAndyProgram\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see \ No newline at end of file diff --git a/SCrawler.Updater/App.config b/SCrawler.Updater/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/SCrawler.Updater/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/SCrawler.Updater/Content/Icons/RainbowIcon_48.ico b/SCrawler.Updater/Content/Icons/RainbowIcon_48.ico new file mode 100644 index 0000000..47e29f8 Binary files /dev/null and b/SCrawler.Updater/Content/Icons/RainbowIcon_48.ico differ diff --git a/SCrawler.Updater/MainMod.vb b/SCrawler.Updater/MainMod.vb new file mode 100644 index 0000000..841984d --- /dev/null +++ b/SCrawler.Updater/MainMod.vb @@ -0,0 +1,248 @@ +' Copyright (C) Andy https://github.com/AAndyProgram +' This program is free software: you can redistribute it and/or modify +' it under the terms of the GNU General Public License as published by +' the Free Software Foundation, either version 3 of the License, or +' (at your option) any later version. +' +' This program is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY +Imports System.Net +Imports System.IO.Compression +Imports PersonalUtilities.Functions +Imports PersonalUtilities.Functions.XML +Imports PersonalUtilities.Tools.Web.Clients +Imports PersonalUtilities.Tools.Web.Documents.JSON +Public Module MainMod + Private Const NewReleaseFolderName As String = "__NewRelease" + Private MyProcessID As Integer = -1 + Private MyWorkingPath As SFile = Nothing + Private ReadOnly ProcessNames As String() = {"SCrawler", "YouTubeDownloader", "Updater"} + Private Silent As Boolean = False + Private Function GetConsoleResponse(ByVal Request As String) As String + Console.Write(Request) + Return Console.ReadLine + End Function + Private Function DownloadFile(ByVal URL As String, ByVal Destination As SFile) As Boolean + Try + Dim lastPerc% = -1 + Dim currentCursor% = Console.CursorTop + Using w As New RWebClient With {.AsyncMode = True} + AddHandler w.DownloadProgressChanged, + New DownloadProgressChangedEventHandler(Sub(ByVal Sender As Object, ByVal e As DownloadProgressChangedEventArgs) + If lastPerc < e.ProgressPercentage Then + lastPerc = e.ProgressPercentage + Console.SetCursorPosition(0, currentCursor) + Console.Write("{0}% completed", e.ProgressPercentage) + End If + End Sub) + Return w.DownloadFile(URL, Destination, EDP.ReturnValue) + End Using + Catch ex As Exception + Return False + End Try + End Function + Public Sub Main() + Try + MyWorkingPath = AppDomain.CurrentDomain.BaseDirectory.CSFileP + MyProcessID = Process.GetCurrentProcess.Id + Console.Title = "SCrawler updater" + With Environment.GetCommandLineArgs + If .ListExists(2) Then Silent = .Self()(1).FromXML(Of Boolean)(False) + End With + + Dim currentDir As SFile = MyWorkingPath.CutPath + Dim extractionDir As SFile = $"{currentDir.CSFilePS}{NewReleaseFolderName}\" + If extractionDir.Exists(SFO.Path, False) Then extractionDir.Delete(SFO.Path, SFODelete.DeletePermanently, EDP.None) + + Dim currVer As Version = GetCurrentMaxVer(currentDir) + If currVer Is Nothing Then + Console.WriteLine("The current version of the program cannot be determined") + Else + Console.WriteLine($"The current version is {currVer} (x{IIf(Environment.Is64BitProcess, 64, 86)})") + Dim release As GitRelease = GetGitRelease() + If Not release.URL.IsEmptyString And Not release.Version Is Nothing Then + If release.Version > currVer Then + Console.WriteLine($"The new version is {release.Version} ({release.Name})") + + If Not Silent AndAlso GetConsoleResponse("Do you want to update the program? (y/n): ").IfNullOrEmpty("n") = "n" Then Exit Sub + + If ActiveProcessesExist() Then + Console.WriteLine("One of the SCrawler programs is still running. Waiting for all SCrawler programs to close.") + While ActiveProcessesExist() : Threading.Thread.Sleep(100) : End While + Console.WriteLine("All SCrawler programs are closed.") + End If + + If extractionDir.Exists(SFO.Path, True) Then + Dim destFile As SFile = $"{extractionDir.CSFilePS}{New SFile(release.URL).File}" + Console.WriteLine("Downloading new version...") + If DownloadFile(release.URL, destFile) Then + Console.WriteLine("") + Console.WriteLine("New version downloaded!") + Console.WriteLine("Extracting files...") + ZipFile.ExtractToDirectory(destFile, extractionDir) + Console.WriteLine("Files extracted!") + destFile.Delete(SFO.File, SFODelete.DeletePermanently, EDP.None) + If Not MoveFiles(extractionDir, currentDir) Then GetConsoleResponse("Unable to update the program. Press Enter to exit") : Exit Sub + Else + extractionDir.Delete(SFO.Path, SFODelete.DeletePermanently, EDP.None) + Console.WriteLine("Unable to download new version") + End If + Else + Console.WriteLine("Unable to create temp directory") + End If + Else + Console.WriteLine("The program is up to date") + End If + Else + Console.WriteLine("Unable to get information about new version") + End If + End If + Catch ex As Exception + Console.WriteLine("An error occurred during update") + Console.WriteLine(ex.Message) + Finally + GetConsoleResponse("Press Enter to exit") + End Try + End Sub + Private Function MoveFiles(ByVal Source As SFile, ByVal Destination As SFile) As Boolean + Console.WriteLine("Updating files") + Try + + Dim oldFiles As List(Of SFile) = SFile.GetFiles(Destination,,, EDP.ReturnValue) + Dim oldFolders As List(Of SFile) = SFile.GetDirectories(Destination,,, EDP.ReturnValue) + + Dim newFiles As List(Of SFile) = SFile.GetFiles(Source,,, EDP.ReturnValue) + Dim newFolders As List(Of SFile) = SFile.GetDirectories(Source,,, EDP.ReturnValue) + + Dim obj As SFile = Nothing + Dim wSegment As String = MyWorkingPath.Segments.Last + Dim filesPredicate As Predicate(Of SFile) = Function(ByVal f As SFile) As Boolean + If obj = f Or obj.Name = f.Name Then + f.Delete(SFO.File, SFODelete.DeleteToRecycleBin, EDP.None) + Return True + Else + Return False + End If + End Function + Dim foldersPredicate As Predicate(Of SFile) = Function(ByVal f As SFile) As Boolean + Dim ls$ = f.Segments.Last + If ls = obj.Segments.Last And Not ls = NewReleaseFolderName And Not ls = wSegment Then + f.Delete(SFO.Path, SFODelete.DeleteToRecycleBin, EDP.None) + Return True + Else + Return False + End If + End Function + + Dim getDestFile As Func(Of SFile, Boolean, SFile) = Function(ByVal f As SFile, ByVal isFolder As Boolean) As SFile + Dim ff As SFile = f + If isFolder Then + ff = $"{Destination.PathWithSeparator}{f.Segments.Last}\" + Else + ff.Path = Destination.Path + End If + Console.WriteLine(ff) + Return ff + End Function + If newFiles.ListExists Then + If oldFiles.ListExists Then + For Each obj In newFiles : oldFiles.RemoveAll(filesPredicate) : Next + End If + newFiles.ForEach(Sub(ff) SFile.Move(ff, getDestFile(ff, False), SFO.File, True, SFODelete.DeleteToRecycleBin, EDP.None)) + End If + + If newFolders.ListExists Then + If oldFolders.ListExists Then + For Each obj In newFolders : oldFolders.RemoveAll(foldersPredicate) : Next + End If + newFolders.ForEach(Sub(ff) If Not ff.Segments.Last = wSegment Then _ + SFile.Move(ff, getDestFile(ff, True), SFO.Path, True, SFODelete.DeleteToRecycleBin, EDP.None)) + End If + + Console.WriteLine("Files updated") + Return True + Catch + Return False + End Try + End Function + Private Function ActiveProcessesExist() As Boolean + Try + Return Process.GetProcesses.Any(Function(p) ProcessNames.Contains(p.ProcessName) And Not p.Id = MyProcessID) + Catch + Return True + End Try + End Function + Private Structure GitRelease + Friend URL As String + Friend Name As String + Friend Version As Version + End Structure + Private Function GetGitRelease() As GitRelease + Try + Dim nameEnd$ = $"_x{IIf(Environment.Is64BitProcess, 64, 86)}.zip" + Dim name$, relName$, relTag$ + + Using resp As New Responser With {.Accept = "application/vnd.github.v3+json"} + Dim r$ = resp.GetResponse("https://api.github.com/repos/AAndyProgram/SCrawler/releases",, EDP.ReturnValue) + If Not r.IsEmptyString Then + Dim getver As Func(Of String, Version) = Function(ByVal input As String) As Version + Try + If Not input.IsEmptyString Then + If input.ToLower.StartsWith("scrawler") Then + Return New Version(input.Split("_")(1)) + Else + Return New Version(input) + End If + End If + Catch + End Try + Return Nothing + End Function + Using j As EContainer = JsonDocument.Parse(r, EDP.ReturnValue) + If j.ListExists Then + With j.FirstOrDefault(Function(e) Not e.Value("draft").FromXML(Of Boolean) And Not e.Value("prerelease").FromXML(Of Boolean)) + If .ListExists Then + relName = .Value("name") + relTag = .Value("tag_name") + With .Item("assets") + If .ListExists Then + For Each asset As EContainer In .Self + name = asset.Value("name") + If Not name.IsEmptyString AndAlso name.EndsWith(nameEnd) Then _ + Return New GitRelease With { + .Name = name, + .URL = asset.Value("browser_download_url"), + .Version = getver(name).IfNullOrEmpty(getver(relName).IfNullOrEmpty(getver(relTag)))} + Next + End If + End With + End If + End With + End If + End Using + End If + End Using + Catch + End Try + Return Nothing + End Function + Private Function GetCurrentMaxVer(ByVal Path As SFile) As Version + Try + If Path.Exists(SFO.Path, False) Then + Dim versions As New List(Of Version) + Dim v As FileVersionInfo + With SFile.GetFiles(Path, "*.exe",, EDP.ReturnValue).ListIfNothing.Where(Function(f) f.Name = "SCrawler" Or f.Name = "YouTubeDownloader") + If .ListExists Then + For Each f As SFile In .Self + v = FileVersionInfo.GetVersionInfo(f) + versions.Add(New Version(v.ProductVersion)) + Next + End If + End With + If versions.Count > 0 Then Return versions.LastOrDefault + End If + Catch + End Try + Return Nothing + End Function +End Module \ No newline at end of file diff --git a/SCrawler.Updater/My Project/Application.Designer.vb b/SCrawler.Updater/My Project/Application.Designer.vb new file mode 100644 index 0000000..88dd01c --- /dev/null +++ b/SCrawler.Updater/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/SCrawler.Updater/My Project/Application.myapp b/SCrawler.Updater/My Project/Application.myapp new file mode 100644 index 0000000..e62f1a5 --- /dev/null +++ b/SCrawler.Updater/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 2 + true + diff --git a/SCrawler.Updater/My Project/AssemblyInfo.vb b/SCrawler.Updater/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..79aa518 --- /dev/null +++ b/SCrawler.Updater/My Project/AssemblyInfo.vb @@ -0,0 +1,37 @@ +Imports System.Resources +Imports System +Imports System.Reflection +Imports 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. + +' Review the values of the assembly attributes + + + + + + + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' 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 Build and Revision Numbers +' by using the '*' as shown below: +' + + + + diff --git a/SCrawler.Updater/My Project/Resources.Designer.vb b/SCrawler.Updater/My Project/Resources.Designer.vb new file mode 100644 index 0000000..cef9a7b --- /dev/null +++ b/SCrawler.Updater/My Project/Resources.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("SCrawler.Updater.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + + ''' + ''' Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + ''' + Friend ReadOnly Property RainbowIcon_48() As System.Drawing.Icon + Get + Dim obj As Object = ResourceManager.GetObject("RainbowIcon_48", resourceCulture) + Return CType(obj,System.Drawing.Icon) + End Get + End Property + End Module +End Namespace diff --git a/SCrawler.Updater/My Project/Resources.resx b/SCrawler.Updater/My Project/Resources.resx new file mode 100644 index 0000000..8e7c1b8 --- /dev/null +++ b/SCrawler.Updater/My Project/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Content\Icons\RainbowIcon_48.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/SCrawler.Updater/My Project/Settings.Designer.vb b/SCrawler.Updater/My Project/Settings.Designer.vb new file mode 100644 index 0000000..8998fdc --- /dev/null +++ b/SCrawler.Updater/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.SCrawler.Updater.My.MySettings + Get + Return Global.SCrawler.Updater.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/SCrawler.Updater/My Project/Settings.settings b/SCrawler.Updater/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/SCrawler.Updater/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/SCrawler.Updater/My Project/app.manifest b/SCrawler.Updater/My Project/app.manifest new file mode 100644 index 0000000..9ce67d2 --- /dev/null +++ b/SCrawler.Updater/My Project/app.manifest @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SCrawler.Updater/SCrawler.Updater.vbproj b/SCrawler.Updater/SCrawler.Updater.vbproj new file mode 100644 index 0000000..4123e60 --- /dev/null +++ b/SCrawler.Updater/SCrawler.Updater.vbproj @@ -0,0 +1,168 @@ + + + + + Debug + AnyCPU + {71263EEE-E25F-44DD-B0A9-F09047C0BEEA} + Exe + Sub Main + SCrawler.Updater + Updater + 512 + Console + v4.6.1 + true + true + + + AnyCPU + true + full + true + true + bin\Debug\Updater\ + + + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + false + + + AnyCPU + pdbonly + false + true + true + bin\Release\Updater\ + + + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + false + + + On + + + Binary + + + Off + + + On + + + Content\Icons\RainbowIcon_48.ico + + + My Project\app.manifest + + + true + true + true + bin\x64\Debug\Updater\ + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + full + x64 + + + true + bin\x64\Release\Updater\ + true + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + pdbonly + x64 + + + true + true + true + bin\x86\Debug\Updater\ + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + full + x86 + + + true + bin\x86\Release\Updater\ + true + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + pdbonly + x86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + + + + {8405896b-2685-4916-bc93-1fb514c323a9} + PersonalUtilities + + + + \ No newline at end of file diff --git a/SCrawler.YouTube/MainModShared.vb b/SCrawler.YouTube/MainModShared.vb index b779e6a..42e42b5 100644 --- a/SCrawler.YouTube/MainModShared.vb +++ b/SCrawler.YouTube/MainModShared.vb @@ -6,6 +6,7 @@ ' ' This program is distributed in the hope that it will be useful, ' but WITHOUT ANY WARRANTY +Imports System.Threading Imports PersonalUtilities.Tools Imports PersonalUtilities.Tools.Web Imports PersonalUtilities.Functions.Messaging @@ -38,6 +39,23 @@ Public Module MainModShared End If End Try End Sub + Public Sub CheckNewReleaseFolder() + Try + Const NewReleaseFolderName$ = "__NewRelease" + Const updaterFolderName$ = "Updater\" + Dim f As SFile = NewReleaseFolderName.CSFileP + If f.Exists(SFO.Path, False) Then + Dim updater As SFile = updaterFolderName + Dim updaterNR As SFile = f.PathWithSeparator & updaterFolderName + If updaterNR.Exists(SFO.Path, False) Then + If updater.Exists(SFO.Path, False) Then updater.Delete(SFO.Path, SFODelete.DeletePermanently, EDP.ReturnValue) + SFile.Move(updaterNR, updater, SFO.Path, True, SFODelete.DeletePermanently, EDP.ReturnValue) + End If + f.Delete(SFO.Path, SFODelete.DeletePermanently, EDP.None) + End If + Catch ex As Exception + End Try + End Sub Public Sub ShowProgramInfo(ByVal ProgramText As String, ByVal CurrentVersion As Version, ByVal CheckForUpdate As Boolean, ByVal Force As Boolean, ByVal EnvirData As IDownloaderSettings, ByVal IsYouTube As Boolean, Optional ByRef NewVersionDestination As String = Nothing, Optional ByVal ShowNewVersionNotification As Boolean = True, @@ -46,11 +64,30 @@ Public Module MainModShared Dim GoToSite As New MsgBoxButton("Go to site") With {.CallBack = Sub(r, n, b) Process.Start("https://github.com/AAndyProgram/SCrawler/releases/latest")} If CheckForUpdate AndAlso GitHub.NewVersionExists(CurrentVersion, "AAndyProgram", "SCrawler", NewVersionDestination) Then If ShowNewVersionNotification Or Force Then - If MsgBoxE(New MMessage($"{ProgramText}: new version detected" & vbCr & - $"Current version: {CurrentVersion}" & vbCr & - $"New version: {NewVersionDestination}", - "New version", - {"OK", GoToSite, "Disable notifications"})) = 2 Then ShowNewVersionNotification = False + Dim b As New List(Of MsgBoxButton) + Dim updaterFile As SFile = Nothing + Dim updateBtt As New MsgBoxButton("Update", "Update the program using the updater") With { + .CallBack = Sub(r, n, btt) + Dim th As New Thread(Sub() Process.Start(New ProcessStartInfo(updaterFile, 1))) With {.IsBackground = True} + th.SetApartmentState(ApartmentState.MTA) + th.Start() + End Sub} + With SFile.GetFiles("Updater\", "*.exe",, EDP.ReturnValue).ListIfNothing + If .ListExists Then + With .FirstOrDefault(Function(f) f.Name = "Updater") + If Not .IsEmptyString Then updaterFile = .Self + End With + End If + End With + b.AddRange({"OK", GoToSite}) + If Not updaterFile.IsEmptyString Then b.Add(updateBtt) + b.Add(New MsgBoxButton("Disable notifications") With {.CallBackObject = 10}) + If AConvert(Of Integer)( + MsgBoxE(New MMessage($"{ProgramText}: new version detected" & vbCr & + $"Current version: {CurrentVersion}" & vbCr & + $"New version: {NewVersionDestination}", + "New version", b) With {.ButtonsPerRow = 4}).Button.CallBackObject, -1) = 10 Then _ + ShowNewVersionNotification = False End If Else If Force Then diff --git a/SCrawler.sln b/SCrawler.sln index 5f6a042..77a1a01 100644 --- a/SCrawler.sln +++ b/SCrawler.sln @@ -4,6 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 VisualStudioVersion = 16.0.31515.178 MinimumVisualStudioVersion = 10.0.40219.1 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SCrawler", "SCrawler\SCrawler.vbproj", "{4A016FAD-9F07-4957-8BB2-AE86C88BA342}" + ProjectSection(ProjectDependencies) = postProject + {71263EEE-E25F-44DD-B0A9-F09047C0BEEA} = {71263EEE-E25F-44DD-B0A9-F09047C0BEEA} + EndProjectSection EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "PersonalUtilities", "..\..\MyUtilities\PersonalUtilities\PersonalUtilities.vbproj", "{8405896B-2685-4916-BC93-1FB514C323A9}" EndProject @@ -22,6 +25,8 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SCrawler.YouTube", "SCrawle EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SCrawler.YouTubeDownloader", "SCrawler.YouTubeDownloader\SCrawler.YouTubeDownloader.vbproj", "{3F2F2C29-4ADB-48B5-A66E-EE0F51D0DCEF}" EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SCrawler.Updater", "SCrawler.Updater\SCrawler.Updater.vbproj", "{71263EEE-E25F-44DD-B0A9-F09047C0BEEA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -104,6 +109,18 @@ Global {3F2F2C29-4ADB-48B5-A66E-EE0F51D0DCEF}.Release|x64.Build.0 = Release|x64 {3F2F2C29-4ADB-48B5-A66E-EE0F51D0DCEF}.Release|x86.ActiveCfg = Release|x86 {3F2F2C29-4ADB-48B5-A66E-EE0F51D0DCEF}.Release|x86.Build.0 = Release|x86 + {71263EEE-E25F-44DD-B0A9-F09047C0BEEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {71263EEE-E25F-44DD-B0A9-F09047C0BEEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {71263EEE-E25F-44DD-B0A9-F09047C0BEEA}.Debug|x64.ActiveCfg = Debug|x64 + {71263EEE-E25F-44DD-B0A9-F09047C0BEEA}.Debug|x64.Build.0 = Debug|x64 + {71263EEE-E25F-44DD-B0A9-F09047C0BEEA}.Debug|x86.ActiveCfg = Debug|x86 + {71263EEE-E25F-44DD-B0A9-F09047C0BEEA}.Debug|x86.Build.0 = Debug|x86 + {71263EEE-E25F-44DD-B0A9-F09047C0BEEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {71263EEE-E25F-44DD-B0A9-F09047C0BEEA}.Release|Any CPU.Build.0 = Release|Any CPU + {71263EEE-E25F-44DD-B0A9-F09047C0BEEA}.Release|x64.ActiveCfg = Release|x64 + {71263EEE-E25F-44DD-B0A9-F09047C0BEEA}.Release|x64.Build.0 = Release|x64 + {71263EEE-E25F-44DD-B0A9-F09047C0BEEA}.Release|x86.ActiveCfg = Release|x86 + {71263EEE-E25F-44DD-B0A9-F09047C0BEEA}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SCrawler/SettingsCLS.vb b/SCrawler/SettingsCLS.vb index b1bccb0..6c0dc87 100644 --- a/SCrawler/SettingsCLS.vb +++ b/SCrawler/SettingsCLS.vb @@ -136,6 +136,8 @@ Friend Class SettingsCLS : Implements IDownloaderSettings, IDisposable Private ReadOnly BlackListFile As SFile = $"{SettingsFolderName}\BlackList.txt" Private ReadOnly UsersSettingsFile As SFile = $"{SettingsFolderName}\Users.xml" Friend Sub New() + CheckNewReleaseFolder() + Cache = CacheKeeper.Default Cache.DisposeSuspended = True