Jump to content
JuanFelipe

Updates for my script

Recommended Posts

JuanFelipe

Hello friends, I hope you are well, the reason for my query is to know if I can do something with Autoit and if you could guide me how to do it, some time ago I made a script which already has its graphical interface which I did with Koda, since I created the program until today I have made several updates in the version, but this has not reached everyone who uses the program since I do not have contact with them, I would like to know if I can make this program at the time of initiation verify if there is a more recent version on the internet and warn with an MsgBox ?, and there goes my other question, where can I host the updates versions? and that allow the user to download the latest version, and then how to make the connection between the program and the platform where the update is hosted?

 

 

Share this post


Link to post
Share on other sites
orbs

what you ask for is very easy to do.

first: host the updated version in a publicly available web site. if you have your own site dedicated to your program, that's best. otherwise you can use for example SourceForge to host your program files. there are many alternatives. if your program is running in an enterprise environment (i.e. no direct internet connection) then use an intranet site in a similar fashion.

next - once you have uploaded a new version, tested the download and the upgrade routine, and you are happy - update your webpage with the new version number (in a predetermined and fixed location). for example, the web page has the text:

"latest version: 1.15.38.4011"

in your program, introduce a "check for updates" feature. you can implement it silently when the program starts, or have a button for the user to click on when they wish to check for updates manually. use the internal function InetRead() to read the html content of the web page. use some string manipulation to isolate the latest version number that appears there, and compare it to the running program version number.

that was a rather long explanation to something that is actually quite straight forward. try it and feel free to ask if you encounter any issues.

  • Like 1

Share this post


Link to post
Share on other sites
JuanFelipe

Thanks, I'll try that and I'll tell you.

Share this post


Link to post
Share on other sites
JuanFelipe
4 hours ago, orbs said:

what you ask for is very easy to do.

first: host the updated version in a publicly available web site. if you have your own site dedicated to your program, that's best. otherwise you can use for example SourceForge to host your program files. there are many alternatives. if your program is running in an enterprise environment (i.e. no direct internet connection) then use an intranet site in a similar fashion.

next - once you have uploaded a new version, tested the download and the upgrade routine, and you are happy - update your webpage with the new version number (in a predetermined and fixed location). for example, the web page has the text:

"latest version: 1.15.38.4011"

in your program, introduce a "check for updates" feature. you can implement it silently when the program starts, or have a button for the user to click on when they wish to check for updates manually. use the internal function InetRead() to read the html content of the web page. use some string manipulation to isolate the latest version number that appears there, and compare it to the running program version number.

that was a rather long explanation to something that is actually quite straight forward. try it and feel free to ask if you encounter any issues.

Thank you very much, I did it and it worked perfect, it took me a little time to do it as you said, thank you teacher.

Share this post


Link to post
Share on other sites
gillesg
16 hours ago, JuanFelipe said:

Thank you very much, I did it and it worked perfect, it took me a little time to do it as you said, thank you teacher.

Hello,

interested in the process for my own tools. Can you publish some pieces of the implementation ?

 

regards

Share this post


Link to post
Share on other sites
JuanFelipe
6 hours ago, gillesg said:

Hello,

interested in the process for my own tools. Can you publish some pieces of the implementation ?

 

regards

Of course, there goes my code.

Func _actualizacion()
   Local $iPing = Ping("www.google.com", 3000)

   If $iPing Then ; first check if there is an internet connection

      Local $dData = InetRead("https://sourceforge.net/projects/sala-de-videos/files/Version.txt")
      Local $iBytesRead = @extended
      Local $sData = BinaryToString($dData)

      If $version<$sData Then
         $update1=""
         $update1&="Hay una versión más reciente del software"&@CRLF
         $update1&="Desea descargarla?"&@CRLF
         $update=MsgBox(4, "Update", $update1)
         If($update=6)Then
            Return ShellExecute("https://sourceforge.net/projects/sala-de-videos/files/Sala%20De%20Videos.exe/download")
         Exit
         Else
         EndIf
      Else
         MsgBox($MB_SYSTEMMODAL, "Update", "Usted cuenta con la última versión actualizada.")
      EndIf

   Else
      MsgBox(16, "", "No hay conexión a internet error: " & @error)
   EndIf

EndFunc

If you have any questions, please tell me

Edited by JuanFelipe

Share this post


Link to post
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

×