First, you need to automatically determine whether an update is needed and automatically download it from FTP if a new version is available. Obviously, we need a file to record the version number of the latest version and the files that need to be downloaded.
Like this, version is the latest version number, and filename is the file name of the file that needs to be downloaded.
Then, upload the necessary files to the server.
The necessary files include the version,txt of the record version update and the files that need to be downloaded for the updated version (take Newlua.lua for example)
Then, get the content in the Version.txt and decide if you want to update the code as follows:
Current_version is the version number of the current script, and the URL is the location of the version.txt.
Gets the version number and then compares it to the current version number, which is automatically updated if the current version number is lower than the latest version number.
Connect ftp and download updates automatically:
The file name that needs to be downloaded is matched by the contents of the Version,txt record, and the file is downloaded to the script directory via FTP (for example, iOS)
Script Run Effect:
Click the Refresh button in the upper right corner of the touch Wizard to find that the update is automatically downloaded: