Browse Source

修改解压BUG

章政 7 years ago
parent
commit
2a54d72bf2

+ 5 - 5
UAS_AutoUpdate/CheckUpdateWindow.cs

@@ -16,10 +16,10 @@ namespace UAS_AutoUpdate
         private void CheckUpdateWindow_Load(object sender, EventArgs e)
         {
             //使用WebClient从指定位置下载文件,然后进行解压缩覆盖
-            MessageBox.Show(Application.StartupPath);
             WebClient wc = new WebClient();
             wc.DownloadProgressChanged += Wc_DownloadProgressChanged;
-            wc.DownloadFileAsync(new Uri("http://218.17.158.219:8888/Debug.zip"), "Debug.zip");
+            wc.DownloadFileAsync(new Uri("http://218.17.158.219:8888/UAS_MES.zip"), "UAS_MES.zip");
+        
         }
 
         private void Wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
@@ -33,9 +33,9 @@ namespace UAS_AutoUpdate
                 this.Invoke(act);
             if (e.ProgressPercentage == 100)
             {
-                ZipHelper.UnZip(Application.StartupPath + @"\Debug.zip", @"F:\TEST");
+                ZipHelper.UnZip(Application.StartupPath + @"\UAS_MES.zip", Application.StartupPath);
+                File.Delete(Application.StartupPath + @"\UAS_MES.zip");
             }
-            //Close();
         }
     }
 
@@ -81,8 +81,8 @@ namespace UAS_AutoUpdate
                             byte[] data = new byte[size];
                             while (size > 0)
                             {
-                                streamWriter.Write(data, 0, size);
                                 size = s.Read(data, 0, data.Length);
+                                streamWriter.Write(data, 0, size);
                             }
                         }
                     }

+ 13 - 17
UAS_AutoUpdate/Properties/Settings.Designer.cs

@@ -1,28 +1,24 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
 //
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace UAS_AutoUpdate.Properties
-{
-
-
+namespace UAS_AutoUpdate.Properties {
+    
+    
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
-    {
-
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
-        public static Settings Default
-        {
-            get
-            {
+        
+        public static Settings Default {
+            get {
                 return defaultInstance;
             }
         }

+ 2 - 4
UAS_AutoUpdate/Properties/Settings.settings

@@ -1,7 +1,5 @@
 <?xml version='1.0' encoding='utf-8'?>
 <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
-  <Profiles>
-    <Profile Name="(Default)" />
-  </Profiles>
+  <Profiles />
   <Settings />
-</SettingsFile>
+</SettingsFile>

+ 1 - 0
UAS_AutoUpdate/UAS_AutoUpdate.csproj

@@ -88,6 +88,7 @@
       <DependentUpon>Resources.resx</DependentUpon>
       <DesignTime>True</DesignTime>
     </Compile>
+    <None Include="app.config" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>

+ 5 - 0
UAS_AutoUpdate/app.config

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <configSections>
+    </configSections>
+</configuration>