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

1.22.4.16将更新程序嵌入主程序

上级 2db74547
......@@ -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.8")>
<Assembly: AssemblyFileVersionAttribute("1.22.4.8")>
\ No newline at end of file
<Assembly: AssemblyVersion("1.22.4.16")>
<Assembly: AssemblyFileVersionAttribute("1.22.4.16")>
\ No newline at end of file
B 更新日志
......
......@@ -42,9 +42,13 @@ Public NotInheritable Class frmAbout
'NewUpdater.UpDater2(True)
IsShowUpdateMsg = True
Dim frmupdate As New frmUpdate
frmupdate.ShowDialog()
'IsShowUpdateMsg = True
'Dim frmupdate As New frmUpdate
'frmupdate.ShowDialog()
If NewUpdater.CreateInAIUpdate() = True Then
NewUpdater.Update3()
End If
End Sub
Private Sub btnGit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGit.Click
......
......@@ -4,7 +4,7 @@ Module NewUpdater
Const InNewVisonTXT As String = "\\Likai-pc\发行版\2011\NewVersion.txt"
Const GitWeb As String = "https://codechina.csdn.net/leaky114/inventoraddin"
Public Sub UpDater1()
Public Sub UpDate1()
Try
' Updater.CheckUpdateSimple("\\likai-pc\发行版\更新包\{0}", "update.xml")
......@@ -32,7 +32,7 @@ Module NewUpdater
End Try
End Sub
Public Sub UpDater2(ByVal IsPutOutMsg As Boolean)
Public Sub UpDate2(ByVal IsPutOutMsg As Boolean)
Try
Dim fileReader As System.IO.StreamReader
......@@ -90,4 +90,42 @@ Module NewUpdater
Return ShortVersion
End Function
Public Function CreateInAIUpdate() As Boolean
Dim path As String = My.Application.Info.DirectoryPath & "\InAIUpdate.exe" '文件释放路径
Dim resources As System.Resources.ResourceManager = My.Resources.ResourceManager
Dim b() As Byte = resources.GetObject("InAIUpdate")
Dim s As IO.Stream
Try
s = IO.File.Create(path)
s.Write(b, 0, b.Length)
s.Close()
'MessageBox.Show("资源释放成功")
Return True
Catch ex As Exception
'MessageBox.Show("资源释放失败!Result=" + ex.Message)
End Try
End Function
Public Sub Update3()
Try
Dim path As String = My.Application.Info.DirectoryPath & "\InAIUpdate.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
\ No newline at end of file
......@@ -60,6 +60,16 @@ Namespace My.Resources
End Set
End Property
'''<summary>
''' 查找 System.Byte[] 类型的本地化资源。
'''</summary>
Friend ReadOnly Property InAIUpdate() As Byte()
Get
Dim obj As Object = ResourceManager.GetObject("InAIUpdate", resourceCulture)
Return CType(obj,Byte())
End Get
End Property
'''<summary>
''' 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
'''</summary>
......
......@@ -117,6 +117,10 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="InAIUpdate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\InAIUpdate.exe;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="inventor" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\inventor.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
......@@ -238,7 +242,6 @@
<data name="微信" type="System.Resources.ResXFileRef, System.Windows.Forms">
<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="快速打开161624" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\快速打开161624 .ICO;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
......
B'设置为一个动作,可一次撤销
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册