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

1.22.5.13

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