Commit 96d9d8fe1fce9a403a986b4e0394883cc93d10d2

Authored by MoraesCaio
1 parent 2fc2bf65
Exists in Au-ghub/master

Tratamento do download da lista de sinais

O download da lista, agora, antecede o download e a extração dos pacotes
de sinais.
@@ -19,6 +19,7 @@ $RECYCLE.BIN/ @@ -19,6 +19,7 @@ $RECYCLE.BIN/
19 19
20 # pastas a serem ignoradas 20 # pastas a serem ignoradas
21 */ 21 */
  22 +*.zip
22 # excecoes, adicionar: !foo/ 23 # excecoes, adicionar: !foo/
23 !Properties/ 24 !Properties/
24 25
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 12 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13 <FileAlignment>512</FileAlignment> 13 <FileAlignment>512</FileAlignment>
14 <IsWebBootstrapper>true</IsWebBootstrapper> 14 <IsWebBootstrapper>true</IsWebBootstrapper>
15 - <PublishUrl>C:\Users\Caio Moraes\Documents\AU\release\</PublishUrl> 15 + <PublishUrl>C:\Users\CaioMoraes\Documents\AU\release\</PublishUrl>
16 <Install>true</Install> 16 <Install>true</Install>
17 <InstallFrom>Web</InstallFrom> 17 <InstallFrom>Web</InstallFrom>
18 <UpdateEnabled>true</UpdateEnabled> 18 <UpdateEnabled>true</UpdateEnabled>
@@ -22,14 +22,14 @@ @@ -22,14 +22,14 @@
22 <UpdatePeriodically>false</UpdatePeriodically> 22 <UpdatePeriodically>false</UpdatePeriodically>
23 <UpdateRequired>true</UpdateRequired> 23 <UpdateRequired>true</UpdateRequired>
24 <MapFileExtensions>false</MapFileExtensions> 24 <MapFileExtensions>false</MapFileExtensions>
25 - <InstallUrl>http://atualizacao.vlibras.lavid.ufpb.br/windows/</InstallUrl>  
26 - <UpdateUrl>http://atualizacao.vlibras.lavid.ufpb.br/windows/</UpdateUrl> 25 + <InstallUrl>http://150.165.205.193:8080/</InstallUrl>
  26 + <UpdateUrl>http://150.165.205.193:8080/</UpdateUrl>
27 <ProductName>Atualizador VLibras</ProductName> 27 <ProductName>Atualizador VLibras</ProductName>
28 <PublisherName>LAVID-UFPB</PublisherName> 28 <PublisherName>LAVID-UFPB</PublisherName>
29 <MinimumRequiredVersion>5.0.0.0</MinimumRequiredVersion> 29 <MinimumRequiredVersion>5.0.0.0</MinimumRequiredVersion>
30 <OpenBrowserOnPublish>false</OpenBrowserOnPublish> 30 <OpenBrowserOnPublish>false</OpenBrowserOnPublish>
31 <TrustUrlParameters>true</TrustUrlParameters> 31 <TrustUrlParameters>true</TrustUrlParameters>
32 - <ApplicationRevision>3</ApplicationRevision> 32 + <ApplicationRevision>20</ApplicationRevision>
33 <ApplicationVersion>5.0.0.%2a</ApplicationVersion> 33 <ApplicationVersion>5.0.0.%2a</ApplicationVersion>
34 <UseApplicationTrust>true</UseApplicationTrust> 34 <UseApplicationTrust>true</UseApplicationTrust>
35 <CreateDesktopShortcut>true</CreateDesktopShortcut> 35 <CreateDesktopShortcut>true</CreateDesktopShortcut>
@@ -99,7 +99,9 @@ @@ -99,7 +99,9 @@
99 <Reference Include="System.Xml" /> 99 <Reference Include="System.Xml" />
100 </ItemGroup> 100 </ItemGroup>
101 <ItemGroup> 101 <ItemGroup>
102 - <Compile Include="BundlesManager.cs" /> 102 + <Compile Include="BundlesManager.cs">
  103 + <SubType>Component</SubType>
  104 + </Compile>
103 <Compile Include="Form1.cs"> 105 <Compile Include="Form1.cs">
104 <SubType>Form</SubType> 106 <SubType>Form</SubType>
105 </Compile> 107 </Compile>
@@ -154,10 +156,10 @@ @@ -154,10 +156,10 @@
154 <Link>%(RecursiveDir)%(Filename)%(Extension)</Link> 156 <Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
155 <Visible>false</Visible> 157 <Visible>false</Visible>
156 </Content> 158 </Content>
157 - <Content Include="$(SolutionDir)requisitos\**\*"> 159 + <!-- <Content Include="$(SolutionDir)requisitos\**\*">
158 <Link>%(RecursiveDir)%(Filename)%(Extension)</Link> 160 <Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
159 <Visible>false</Visible> 161 <Visible>false</Visible>
160 - </Content> 162 + </Content> -->
161 <Content Include="icon_vlibras.ico" /> 163 <Content Include="icon_vlibras.ico" />
162 </ItemGroup> 164 </ItemGroup>
163 <ItemGroup> 165 <ItemGroup>
AU.csproj.user
1 <?xml version="1.0" encoding="Windows-1252"?> 1 <?xml version="1.0" encoding="Windows-1252"?>
2 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 2 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <PropertyGroup> 3 <PropertyGroup>
4 - <PublishUrlHistory>C:\Users\Caio Moraes\Documents\AU\release\|http://150.165.205.137:8000/|\\localhost\testeDeAU\|System.Deployment.Application.SystemNetDownloader.DownloadSingleFile%28DownloadQueueItem next%29\|C:\Users\Caio Moraes\Documents\AU\release\publish.htm\</PublishUrlHistory>  
5 - <InstallUrlHistory>http://atualizacao.vlibras.lavid.ufpb.br/windows/|http://150.165.205.37/windows/|http://179.185.184.75:8080/|http://179.185.184.75:8080/163.172./|http://150.165.205.137:8080/</InstallUrlHistory> 4 + <PublishUrlHistory>C:\Users\CaioMoraes\Documents\AU\release\|C:\Users\Rebecca\Documents\AU\release\|C:\Users\Caio Moraes\Documents\AU\release\|http://150.165.205.137:8000/|\\localhost\testeDeAU\</PublishUrlHistory>
  5 + <InstallUrlHistory>http://150.165.205.193:8080/|http://177.133.106.152:8089/|http://177.133.106.152:8080/|http://192.168.25.121:8089/|http://192.168.26.121:8089/</InstallUrlHistory>
6 <SupportUrlHistory /> 6 <SupportUrlHistory />
7 - <UpdateUrlHistory>http://150.165.205.37/windows/|http://179.185.184.75:8080/|http://150.165.205.137:8080/|http://150.165.205.101:8080/|http://179.185.189.177:8080/</UpdateUrlHistory> 7 + <UpdateUrlHistory>http://150.165.205.193:8080/|http://177.133.106.152:8089/|http://192.168.25.121:8089/|http://192.168.26.121:8089/|http://127.0.0.1:8000/</UpdateUrlHistory>
8 <BootstrapperUrlHistory /> 8 <BootstrapperUrlHistory />
9 <ErrorReportUrlHistory /> 9 <ErrorReportUrlHistory />
10 <FallbackCulture>pt-BR</FallbackCulture> 10 <FallbackCulture>pt-BR</FallbackCulture>
BundlesManager.cs
@@ -159,11 +159,16 @@ namespace AtualizadorVLibras{ @@ -159,11 +159,16 @@ namespace AtualizadorVLibras{
159 }*/ 159 }*/
160 160
161 public static void DownloadFileIfNewer(string remote, string local, string fileName){ 161 public static void DownloadFileIfNewer(string remote, string local, string fileName){
162 - if(RemoteFileExists(remote+fileName) && (!File.Exists(local+fileName) || RemoteIsNewerThanLocal(remote+fileName, local+fileName))){  
163 - DownloadFileToPath(remote+fileName, local+fileName);  
164 - if(File.Exists(local+fileName.Remove(fileName.Length-4))){  
165 - File.Delete(local+fileName.Remove(fileName.Length-4)); 162 + try{
  163 + if(RemoteFileExists(remote+fileName) && (!File.Exists(local+fileName) || RemoteIsNewerThanLocal(remote+fileName, local+fileName))){
  164 + DownloadFileToPath(remote+fileName, local+fileName);
  165 + if(File.Exists(local+fileName.Remove(fileName.Length-4))){
  166 + File.Delete(local+fileName.Remove(fileName.Length-4));
  167 + }
166 } 168 }
  169 + }catch(Exception e){
  170 + Console.WriteLine("Aconteceu um erro no download: "+e);
  171 + Console.ReadKey();
167 } 172 }
168 } 173 }
169 public static void ExtractZip(string remote, string local, string extractPath, string fileName){ 174 public static void ExtractZip(string remote, string local, string extractPath, string fileName){
@@ -37,8 +37,10 @@ namespace AtualizadorVLibras @@ -37,8 +37,10 @@ namespace AtualizadorVLibras
37 { 37 {
38 //ENDEREÇO DE ONDE SERÃO BAIXADOS OS PACOTES (.ZIP) DE SINAIS (1.ZIP, 2.ZIP E ETC...) 38 //ENDEREÇO DE ONDE SERÃO BAIXADOS OS PACOTES (.ZIP) DE SINAIS (1.ZIP, 2.ZIP E ETC...)
39 //string url = @"http://atualizacao.vlibras.lavid.ufpb.br/windows/"; 39 //string url = @"http://atualizacao.vlibras.lavid.ufpb.br/windows/";
40 - //string url = @"http://127.0.0.1:8000/";  
41 - string url = @"http://192.168.25.121:8089/"; 40 + //string url = @"http://127.0.0.1:8000/"; //localhost
  41 + //string url = @"http://192.168.25.121:8089/"; //local: notebook bk
  42 + string url = @"http://150.165.205.148:8080/";
  43 + //string url = @"http://177.133.106.152:8089/";
42 //string url = @"http://179.185.184.75:8080/"; 44 //string url = @"http://179.185.184.75:8080/";
43 45
44 string dirAtual = Directory.GetCurrentDirectory(); 46 string dirAtual = Directory.GetCurrentDirectory();
@@ -234,6 +236,14 @@ namespace AtualizadorVLibras @@ -234,6 +236,14 @@ namespace AtualizadorVLibras
234 236
235 237
236 //DOWNLOAD DOS SINAIS 238 //DOWNLOAD DOS SINAIS
  239 + Console.WriteLine("Baixando lista de sinais");
  240 + try{
  241 + BundlesManager.DownloadListaSinais(url);
  242 + }catch(Exception e){
  243 + Console.WriteLine("Erro no download da lista de sinais.\n{0}\nAperte alguma tecla para continuar.",e);
  244 + Console.ReadKey();
  245 + }
  246 +
237 //BAIXA OS ZIPS DOS SINAIS (1.ZIP, 2.ZIP E ETC...) 247 //BAIXA OS ZIPS DOS SINAIS (1.ZIP, 2.ZIP E ETC...)
238 extractPath = @"..\Bundles\"; 248 extractPath = @"..\Bundles\";
239 int qtdDeBundles = 0; 249 int qtdDeBundles = 0;
@@ -251,7 +261,6 @@ namespace AtualizadorVLibras @@ -251,7 +261,6 @@ namespace AtualizadorVLibras
251 Console.WriteLine("Extraindo pacote de sinais."); 261 Console.WriteLine("Extraindo pacote de sinais.");
252 //try{ 262 //try{
253 BundlesManager.ExtractBundlesPackagesOverWrite(url, rootPath, extractPath, qtdDeBundles); 263 BundlesManager.ExtractBundlesPackagesOverWrite(url, rootPath, extractPath, qtdDeBundles);
254 - BundlesManager.DownloadListaSinais(url);  
255 /*}catch(Exception e){ 264 /*}catch(Exception e){
256 Console.WriteLine("Erro na extração: {0}", e); 265 Console.WriteLine("Erro na extração: {0}", e);
257 Console.ReadKey(); 266 Console.ReadKey();