Jump to content

add a file version


Recommended Posts

 

[En]
I am creating an update system and on the server I saved a text file with ex: Server updater file "Updater.txt" "file.txt | 1.0.0.2 "file.rc" | 5.0.2.1 "file.a" 2.0.0.20 My problem is .. I need to compare the user's local file with the version saved in the online updater.txt, but so far, file version only works with ".exe"


[Pt-br]
 

Eu estou criando um sistema de update e no servidor eu salvo um arquivo de texto com 
ex:

Server updater file "Updater.txt"
"arquivo.txt|1.0.0.2
"arquivo.rc"|5.0.2.1
"arquivo.a"|2.0.0.20

Meu problema é..Eu preciso comparar o arquivo local do usuário com a versão salva no updater.txt online, mas até agora, versão de arquivo só funciona com arquivos ".exe"

Link to comment
Share on other sites

2 minutes ago, Subz said:

Text files don't have versions, just use the date of the file to compare.

 

[en]

I tried to put date, but I noticed that the date of the file is based on the time it was downloaded, so it is not aligned with the server.

 

[pt]

Eu tentei colocar data, mas eu reparei que a data do arquivo é baseado na hora que ele foi baixado, dessa forma não fica alinhado com o server.

Link to comment
Share on other sites

One thing to look at for text file versions is called Alternate Data Streams, which are a way to attach something to a file that isn't seen in a normal text file, but can be retrieved to do what you're looking for.

Here's another

 

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Simple solution is to add to begin of TXT file one line with actual "file version" (for example: version=1.32)

so later you can read first line of TXT to get its version and do comparing.

 

Of course this can be done only when original TXT files can be modified

Another variant is to use some type of HASH to compare if file is latest version or not.

Edited by Zedna
Link to comment
Share on other sites

5 hours ago, Zedna said:

Simple solution is to add to begin of TXT file one line with actual "file version" (for example: version=1.32)

so later you can read first line of TXT to get its version and do comparing.

 

Of course this can be done only when original TXT files can be modified

Another variant is to use some type of HASH to compare if file is latest version or not.

[en-google translate]
I made it. When the file is downloaded, the new version is saved to a text file. The comparison is done by a local text file X remote text file. I would like to compare with files and not TXT x TXT.

 

[pt]
Eu fiz isso .Quando o arquivo é baixado, a nova versão é salva em um arquivo de texto. A comparação é feita por um arquivo de texto local X arquivo de texto remoto. Eu gostaria de comparar com arquivos locais e não TXT x TXT, mas ficou legal assim. Obrigado.

Edited by PedroWarlock
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...