[READ-ONLY] Mirror of https://github.com/jackmawer/BlueRoseClassic.
0

Configure Feed

Select the types of activity you want to include in your feed.

Migrated to native ZIP library

Zack Casey (Feb 16, 2016, 7:39 AM EST) 8374d57d 0879abdc

+44 -64
+2 -7
BlueRose.Distro/BlueRose.Distro.csproj
··· 30 30 <WarningLevel>4</WarningLevel> 31 31 </PropertyGroup> 32 32 <ItemGroup> 33 - <Reference Include="Ionic.Zip, Version=1.9.8.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL"> 34 - <HintPath>..\packages\DotNetZip.1.9.8\lib\net20\Ionic.Zip.dll</HintPath> 35 - <Private>True</Private> 36 - </Reference> 37 33 <Reference Include="System" /> 38 34 <Reference Include="System.Core" /> 35 + <Reference Include="System.IO.Compression" /> 36 + <Reference Include="System.IO.Compression.FileSystem" /> 39 37 <Reference Include="System.Windows.Forms" /> 40 38 <Reference Include="System.Xml.Linq" /> 41 39 <Reference Include="System.Data.DataSetExtensions" /> ··· 47 45 <ItemGroup> 48 46 <Compile Include="TeamCity.cs" /> 49 47 <Compile Include="Properties\AssemblyInfo.cs" /> 50 - </ItemGroup> 51 - <ItemGroup> 52 - <None Include="packages.config" /> 53 48 </ItemGroup> 54 49 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 55 50 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+8 -7
BlueRose.Distro/TeamCity.cs
··· 15 15 // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 16 16 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 17 17 18 - using Ionic.Zip; 18 + using System.IO.Compression; 19 19 using System; 20 20 using System.IO; 21 21 using System.Net; ··· 42 42 43 43 client.DownloadFileAsync(tcAddress(address, buildType), distFile); 44 44 45 - using (ZipFile buildUnpack = ZipFile.Read(distFile)) 45 + using (ZipArchive buildUnpack = ZipFile.OpenRead(distFile)) 46 46 { 47 - foreach (ZipEntry ex in buildUnpack) 47 + foreach (ZipArchiveEntry ex in buildUnpack.Entries) 48 48 { 49 - ex.Extract(Environment.CurrentDirectory, ExtractExistingFileAction.OverwriteSilently); 49 + ex.ExtractToFile(Path.Combine(Environment.CurrentDirectory, ex.FullName), true); 50 50 } 51 51 } 52 + 52 53 } 53 54 catch (Exception ex) 54 55 { ··· 62 63 /// <param name="distFile"></param> 63 64 public static void tcUnpack(string distFile = "teamcity.zip") 64 65 { 65 - using (ZipFile buildUnpack = ZipFile.Read(distFile)) 66 + using (ZipArchive buildUnpack = ZipFile.OpenRead(distFile)) 66 67 { 67 - foreach (ZipEntry ex in buildUnpack) 68 + foreach (ZipArchiveEntry ex in buildUnpack.Entries) 68 69 { 69 - ex.Extract(Environment.CurrentDirectory, ExtractExistingFileAction.OverwriteSilently); 70 + ex.ExtractToFile(Path.Combine(Environment.CurrentDirectory, ex.FullName), true); 70 71 } 71 72 } 72 73 }
-4
BlueRose.Distro/packages.config
··· 1 - <?xml version="1.0" encoding="utf-8"?> 2 - <packages> 3 - <package id="DotNetZip" version="1.9.8" targetFramework="net452" /> 4 - </packages>
+19 -21
BlueRose/BlueRose.cs
··· 16 16 17 17 using System; 18 18 using System.Diagnostics; 19 - using SysIO = System.IO; 19 + using System.IO; 20 20 using System.Windows.Forms; 21 21 using System.Text.RegularExpressions; 22 - using Ionic.Zip; 22 + using System.IO.Compression; 23 23 using System.Net; 24 24 25 25 namespace BlueRose ··· 98 98 string url = "http://servo.freeso.org/externalStatus.html?js=1"; 99 99 WebRequest wrGETURL; 100 100 wrGETURL = WebRequest.Create(url); 101 - SysIO.Stream objStream; 101 + Stream objStream; 102 102 objStream = wrGETURL.GetResponse().GetResponseStream(); 103 - SysIO.StreamReader objReader = new SysIO.StreamReader(objStream); 103 + StreamReader objReader = new StreamReader(objStream); 104 104 string sLine = ""; 105 105 string fll; 106 106 fll = objReader.ReadLine(); ··· 121 121 try 122 122 { 123 123 string buildFile = Environment.CurrentDirectory + @"/" + file; 124 - SysIO.StreamReader fileRead = new SysIO.StreamReader(buildFile); 124 + StreamReader fileRead = new StreamReader(buildFile); 125 125 while ((line = fileRead.ReadLine()) != null) 126 126 { 127 127 return "#" + line; ··· 148 148 149 149 try 150 150 { 151 - SysIO.File.WriteAllText(buildFile, localDist); 151 + File.WriteAllText(buildFile, localDist); 152 152 } 153 153 catch (Exception ex) 154 154 { ··· 161 161 /// </summary> 162 162 public static void GC() 163 163 { 164 - string htmlOutput = "downloadArtifacts.html"; 164 + string htmlOutput = "downloadArtifacts.html"; // Legacy 165 165 string brLegacyInstaller = "BlueRoseStable.exe"; 166 166 string brUpdateInstaller = "BlueRoseUpdate.exe"; 167 167 168 - if (SysIO.File.Exists(brLegacyInstaller)) 169 - SysIO.File.Delete(brLegacyInstaller); 170 - 171 - if (SysIO.File.Exists(brUpdateInstaller)) 172 - SysIO.File.Delete(brUpdateInstaller); 173 - 174 - if (SysIO.File.Exists(htmlOutput)) 175 - SysIO.File.Delete(htmlOutput); 168 + if (File.Exists(brLegacyInstaller) || File.Exists(brUpdateInstaller) || File.Exists(htmlOutput)) 169 + { 170 + File.Delete(brLegacyInstaller); 171 + File.Delete(brUpdateInstaller); 172 + File.Delete(htmlOutput); 173 + } 176 174 177 175 Wildcard wildZip = new Wildcard("*.zip", RegexOptions.IgnoreCase); 178 - string[] files = SysIO.Directory.GetFiles(Environment.CurrentDirectory); 176 + string[] files = Directory.GetFiles(Environment.CurrentDirectory); 179 177 180 178 foreach(string file in files) 181 179 { 182 180 if (wildZip.IsMatch(file)) 183 181 { 184 - SysIO.File.Delete(file); 182 + File.Delete(file); 185 183 } 186 184 } 187 185 } ··· 194 192 Wildcard unpacker = new Wildcard("*.zip", RegexOptions.IgnoreCase); 195 193 196 194 // Get a list of files in the My Documents folder 197 - string[] files = SysIO.Directory.GetFiles(Environment.CurrentDirectory); 195 + string[] files = Directory.GetFiles(Environment.CurrentDirectory); 198 196 199 197 foreach (string file in files) 200 198 { 201 199 if (unpacker.IsMatch(file)) 202 200 { 203 - using (ZipFile zip2 = ZipFile.Read(file)) 201 + using (ZipArchive zip2 = ZipFile.OpenRead(file)) 204 202 { 205 - foreach (ZipEntry ex in zip2) 203 + foreach (ZipArchiveEntry ex in zip2.Entries) 206 204 { 207 - ex.Extract(Environment.CurrentDirectory, ExtractExistingFileAction.OverwriteSilently); 205 + ex.ExtractToFile(Path.Combine(Environment.CurrentDirectory, ex.FullName), true); 208 206 } 209 207 } 210 208 }
+2 -5
BlueRose/BlueRose.csproj
··· 43 43 <StartupObject>BlueRose.Program</StartupObject> 44 44 </PropertyGroup> 45 45 <ItemGroup> 46 - <Reference Include="Ionic.Zip, Version=1.9.8.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL"> 47 - <HintPath>..\packages\DotNetZip.1.9.8\lib\net20\Ionic.Zip.dll</HintPath> 48 - <Private>True</Private> 49 - </Reference> 50 46 <Reference Include="System" /> 51 47 <Reference Include="System.Core" /> 48 + <Reference Include="System.IO.Compression" /> 49 + <Reference Include="System.IO.Compression.FileSystem" /> 52 50 <Reference Include="System.Xml.Linq" /> 53 51 <Reference Include="System.Data.DataSetExtensions" /> 54 52 <Reference Include="Microsoft.CSharp" /> ··· 84 82 <DesignTime>True</DesignTime> 85 83 </Compile> 86 84 <None Include="app.manifest" /> 87 - <None Include="packages.config" /> 88 85 <None Include="Properties\Settings.settings"> 89 86 <Generator>SettingsSingleFileGenerator</Generator> 90 87 <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+13 -16
BlueRose/BlueRoseGUI.cs
··· 18 18 using System.ComponentModel; 19 19 using System.Net; 20 20 using System.Windows.Forms; 21 - using Ionic.Zip; 21 + using System.IO; 22 + using System.IO.Compression; 22 23 using System.Diagnostics; 23 24 using BlueRose.Distro; 24 25 ··· 28 29 { 29 30 private string errorBtn = "ERROR"; 30 31 WebClient client = new WebClient(); 31 - string blueRoseFile = "bluerose.zip"; 32 + string unpackerZip = "bluerose.zip"; 32 33 string netBuild = "#" + BlueRose.distNum(); 33 34 string buildFile = "fsobuild"; 34 35 ··· 147 148 client.DownloadFileCompleted += new AsyncCompletedEventHandler(brDownloadCompleted); 148 149 149 150 client.DownloadFileAsync(BlueRose.webURL(@"https://dl.dropboxusercontent.com/u/42345729/BlueRoseUpdate.zip"), 150 - blueRoseFile); 151 + unpackerZip); 151 152 } 152 153 153 154 void brDownloadCompleted(object sender, AsyncCompletedEventArgs e) 154 155 { 155 156 btnUpdateLauncher.Text = "Unpacking"; 156 157 157 - string firstUnpack = blueRoseFile; 158 - string secondUnpack = "BlueRoseUpdate.zip"; 158 + string unpack = unpackerZip; 159 159 160 - using (ZipFile buildUnpack = ZipFile.Read(firstUnpack)) 160 + try 161 161 { 162 - foreach (ZipEntry ex in buildUnpack) 162 + using (ZipArchive buildUnpack = ZipFile.OpenRead(unpack)) 163 163 { 164 - ex.Extract(Environment.CurrentDirectory, ExtractExistingFileAction.OverwriteSilently); 164 + foreach (ZipArchiveEntry ex in buildUnpack.Entries) 165 + { 166 + ex.ExtractToFile(Path.Combine(Environment.CurrentDirectory, ex.FullName), true); 167 + } 165 168 } 166 169 } 167 - 168 - btnUpdateLauncher.Text = "Installing"; 169 - 170 - using (ZipFile instUnpack = new ZipFile(secondUnpack)) 170 + catch (Exception ex) 171 171 { 172 - foreach (ZipEntry ex in instUnpack) 173 - { 174 - ex.Extract(Environment.CurrentDirectory, ExtractExistingFileAction.OverwriteSilently); 175 - } 172 + MessageBox.Show(ex.Message); 176 173 } 177 174 178 175 Process.Start("BlueRoseUpdate.exe");
-4
BlueRose/packages.config
··· 1 - <?xml version="1.0" encoding="utf-8"?> 2 - <packages> 3 - <package id="DotNetZip" version="1.9.8" targetFramework="net452" /> 4 - </packages>