提交 2b610981 编写于 作者: leaky114's avatar leaky114

1.22.5.13

 [+]优化快速打开文件查询速度
 [+]更新升级策略
上级 dba4b88b
......@@ -28,5 +28,5 @@ Imports System.Runtime.InteropServices
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
<Assembly: AssemblyVersion("1.22.4.16")>
<Assembly: AssemblyFileVersionAttribute("1.22.4.16")>
\ No newline at end of file
<Assembly: AssemblyVersion("1.22.5.11")>
<Assembly: AssemblyFileVersionAttribute("1.22.5.11")>
\ No newline at end of file
B 更新日志
......
......@@ -137,9 +137,9 @@ Partial Class frmAbout
'
'btnCheckUpdate
'
Me.btnCheckUpdate.Location = New System.Drawing.Point(192, 233)
Me.btnCheckUpdate.Location = New System.Drawing.Point(127, 233)
Me.btnCheckUpdate.Name = "btnCheckUpdate"
Me.btnCheckUpdate.Size = New System.Drawing.Size(75, 28)
Me.btnCheckUpdate.Size = New System.Drawing.Size(140, 28)
Me.btnCheckUpdate.TabIndex = 44
Me.btnCheckUpdate.Text = "检查更新"
Me.btnCheckUpdate.UseVisualStyleBackColor = True
......
......@@ -24,6 +24,12 @@ Public NotInheritable Class frmAbout
Me.txtDescription.Text = My.Application.Info.Description & vbCrLf & _
vbCrLf & _
My.Application.Info.DirectoryPath & "\" & My.Application.Info.AssemblyName & ".dll"
'释放更新程序
NewUpdater.CreateUpdate()
NewUpdater.UpDater2(btnCheckUpdate)
End Sub
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
......@@ -31,24 +37,19 @@ Public NotInheritable Class frmAbout
End Sub
Private Sub btnCheckUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheckUpdate.Click
'Try
' Dim simupdate As String
' simupdate = My.Application.Info.DirectoryPath & "\simupdater.exe"
' Process.Start(simupdate)
'Catch ex As Exception
' MsgBox(ex.Message)
'End Try
'NewUpdater.UpDater2(True)
'启动更新程序
NewUpdater.Update3()
'IsShowUpdateMsg = True
'Dim frmupdate As New frmUpdate
'frmupdate.ShowDialog()
If NewUpdater.CreateUpdate() = True Then
NewUpdater.Update3()
End If
'If NewUpdater.CreateUpdate() = True Then
'NewUpdater.Update3()
''End If
Me.Close()
End Sub
Private Sub btnGit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGit.Click
......
......@@ -56,6 +56,7 @@ Partial Class frmQuitOpen
Me.lvwFileListView.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1})
Me.lvwFileListView.FullRowSelect = True
Me.lvwFileListView.Location = New System.Drawing.Point(12, 12)
Me.lvwFileListView.MultiSelect = False
Me.lvwFileListView.Name = "lvwFileListView"
Me.lvwFileListView.Size = New System.Drawing.Size(663, 118)
Me.lvwFileListView.Sorting = System.Windows.Forms.SortOrder.Ascending
......
Imports FSLib.App.SimpleUpdater
Imports System.Windows.Forms
Module NewUpdater
Const InNewVisonTXT As String = "\\Likai-pc\发行版\2011\NewVersion.txt"
Const GitWeb As String = "https://codechina.csdn.net/leaky114/inventoraddin"
Public NewVersion As String
Public MyVersion As String
Public Sub UpDate1()
Try
' Updater.CheckUpdateSimple("\\likai-pc\发行版\更新包\{0}", "update.xml")
Dim UpdaterInstance = FSLib.App.SimpleUpdater.Updater.CreateUpdaterInstance()
'Public Sub UpDater1()
' Try
With UpdaterInstance.Context
.UpdateDownloadUrl = "\\likai-pc\发行版\更新包\{0}" '获得或设置用于更新的模板地址
.UpdateInfoFileName = "update.xml" '获得或设置更新时使用的 XML 文件名
' ' Updater.CheckUpdateSimple("\\likai-pc\发行版\更新包\{0}", "update.xml")
.MultipleDownloadCount = 5 '获得或设置同时下载的文件数,默认为 3
' Dim UpdaterInstance = FSLib.App.SimpleUpdater.Updater.CreateUpdaterInstance()
End With
' With UpdaterInstance.Context
' .UpdateDownloadUrl = "\\likai-pc\发行版\更新包\{0}" '获得或设置用于更新的模板地址
' .UpdateInfoFileName = "update.xml" '获得或设置更新时使用的 XML 文件名
'开始更新
' .MultipleDownloadCount = 5 '获得或设置同时下载的文件数,默认为 3
UpdaterInstance.BeginCheckUpdateInProcess()
' End With
UpdaterInstance.Dispose()
' '开始更新
Catch ex As Exception
' UpdaterInstance.BeginCheckUpdateInProcess()
' UpdaterInstance.Dispose()
'MsgBox(ex.Message)
' Catch ex As Exception
' 'MsgBox(ex.Message)
' End Try
'End Sub
End Try
End Sub
Public Sub UpDate2(ByVal IsPutOutMsg As Boolean)
Public Sub UpDater2(ByVal btnCheckUpDate As Button)
Try
Dim NewVersionInfo As String = "\\Likai-pc\发行版\2011\NewVersion.txt"
Dim fileReader As System.IO.StreamReader
fileReader = My.Computer.FileSystem.OpenTextFileReader(InNewVisonTXT)
Dim NewVersion As String
fileReader = My.Computer.FileSystem.OpenTextFileReader(NewVersionInfo)
NewVersion = fileReader.ReadLine()
fileReader.Close()
'MsgBox(NewVersion)
Dim MyVersion As String = _
MyVersion = _
My.Application.Info.Version.Major & "." & _
My.Application.Info.Version.Minor & "." & _
Format(My.Application.Info.Version.Build, "00") & "." & _
Format(My.Application.Info.Version.Revision, "00")
Format(My.Application.Info.Version.Build, "00") & "." & _
Format(My.Application.Info.Version.Revision, "00")
'MsgBox(MyVersion)
......@@ -58,29 +58,24 @@ Module NewUpdater
shortNewVersion = ShortVersion(NewVersion)
If shortNewVersion > shortMyversion Then
MsgBox("InventorAddIn插件" & vbCrLf & "当前版本:" & MyVersion & vbCrLf & "检查到 新版本:" & NewVersion, MsgBoxStyle.OkOnly, " 检查更新")
'MsgBox("InventorAddIn插件" & vbCrLf & "当前版本:" & MyVersion & vbCrLf & "检查到 新版本:" & NewVersion, MsgBoxStyle.OkOnly, " 检查更新")
'simupdate = My.Application.Info.DirectoryPath & "\simupdater.exe"
'Process.Start(simupdate)
Dim simupdate As String
simupdate = My.Application.Info.DirectoryPath & "\simupdater.exe"
If IsFileExsts(simupdate) = True Then
Process.Start(simupdate)
Else
MsgBox("缺失升级程序 simupdater.exe,请到本软件仓库下载。", MsgBoxStyle.OkOnly, "检查更新")
Process.Start(GitWeb)
End If
btnCheckUpDate.Text = "检查到新版" & NewVersion
Else
If IsPutOutMsg = True Then
MsgBox("当前是最新版本。", MsgBoxStyle.OkOnly, "检查更新")
End If
With btnCheckUpDate
.Text = "当前为最新版"
.Visible = False
End With
End If
End If
Catch ex As Exception
'MsgBox(ex.Message)
'MsgBox("未链接到服务器。", MsgBoxStyle.OkOnly, "检查更新")
End Try
End Sub
Public Function ShortVersion(ByVal LongVesion As String) As Long
......@@ -90,53 +85,58 @@ Module NewUpdater
Return ShortVersion
End Function
Public Function CreateUpdate() As Boolean
Public Sub UpDate3()
Try
Dim strSimpleUpdater As String
Dim path As String = My.Application.Info.DirectoryPath & "\simupdater.exe" '文件释放路径
Dim resources As System.Resources.ResourceManager = My.Resources.ResourceManager
Dim b() As Byte = resources.GetObject("simupdater")
Dim s As IO.Stream
s = IO.File.Create(path)
s.Write(b, 0, b.Length)
s.Close()
strSimpleUpdater = ThisApplication.InstallPath & "\Bin\SimpleUpdater.exe"
Dim DisplayVersion As String
DisplayVersion = ThisApplication.SoftwareVersion.DisplayVersion
path = My.Application.Info.DirectoryPath & "\SimpleUpdater.dll" '文件释放路径
Dim strArguments As String
b = resources.GetObject("SimpleUpdater")
s = IO.File.Create(path)
s.Write(b, 0, b.Length)
s.Close()
'SimpleUpdater.exe /startupdate /cv "1.2.3.4" /url "\\likai-pc\发行版\更新包\2015\{0}" /infofile "update.xml" /p "Inventor.exe" /hideCheckUI
strArguments = "/startupdate /cv """ & MyVersion & """ /url ""\\likai-pc\发行版\更新包\" & DisplayVersion & "\{0}"" /infofile ""update.xml"" /p ""Inventor.exe"" /hideCheckUI"
If IsFileExsts(strSimpleUpdater) = True Then
Process.Start(strSimpleUpdater, strArguments)
End If
'MessageBox.Show("资源释放成功")
Return True
Catch ex As Exception
'MessageBox.Show("资源释放失败!Result=" + ex.Message)
MsgBox(ex.Message)
End Try
End Function
End Sub
Public Sub Update3()
Public Function CreateUpdate() As Boolean
Try
Dim path As String = My.Application.Info.DirectoryPath & "\simupdater.exe '文件释放路径"
Dim DisplayVersion As String
DisplayVersion = ThisApplication.SoftwareVersion.DisplayVersion
Dim path As String = ThisApplication.InstallPath & "Bin\SimpleUpdater.exe" '文件释放路径
Dim MyVersion As String = _
My.Application.Info.Version.Major & "." & _
My.Application.Info.Version.Minor & "." & _
Format(My.Application.Info.Version.Build, "00") & "." & _
Format(My.Application.Info.Version.Revision, "00")
If IsFileExsts(path) = False Then
Dim arguments As String
arguments = DisplayVersion & " " & MyVersion
Dim resources As System.Resources.ResourceManager = My.Resources.ResourceManager
Dim b() As Byte = resources.GetObject("SimpleUpdaterexe")
Dim s As IO.Stream
s = IO.File.Create(path)
s.Write(b, 0, b.Length)
s.Close()
Process.Start(path, arguments)
Catch ex As Exception
path = ThisApplication.InstallPath & "Bin\SimpleUpdater.exe.config" '文件释放路径
b = resources.GetObject("SimpleUpdaterexeconfig")
s = IO.File.Create(path)
s.Write(b, 0, b.Length)
s.Close()
End If
'MessageBox.Show("资源释放成功")
Return True
Catch ex As Exception
'MessageBox.Show("资源释放失败!Result=" + ex.Message)
End Try
End Function
End Sub
End Module
\ No newline at end of file
End Module
此差异已折叠。
......@@ -482,10 +482,10 @@
<value>..\Resources\支付宝.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="SimpleUpdater" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Release\SimpleUpdater.dll;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="SimpleUpdaterexe" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Release\SimpleUpdater.exe;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="simupdater" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\simupdater.exe;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="SimpleUpdaterexeconfig" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Release\SimpleUpdater.exe.config;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</value>
</data>
</root>
\ No newline at end of file
<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
B'设置为一个动作,可一次撤销
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册