Jump to content

Updates for my script


Recommended Posts

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?

 

 

Link to comment
Share on other sites

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.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
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...