I want to make in my app an automatic control of the release using FTP ( this is simple ) and then make the update of the app.
That means: control of a txt file with a release field, download the new app and substitution of the current one.
Can someone give me an idea ? Using jshell ? Creating a service ?
you can download new file after check version and save it in dir.temp and close app
befor close you can run bat file or another b4j app for copying and replace newfile
from dir.temp to dir.app with 5 second or more dely
i do this with another b4j app that copying file
actualy copy opretion run after close mainapp + 5second
B4X:
Sub Download_onSucess (Path As String,Name As String,FileSize As Long)
Log("download Finished.....")
'save newfile in File.DirTemp
fx.ShowExternalDocument(File.GetUri(File.DirTemp,"CopyTask.jar"))
ExitApplication
'CopyTask.jar copy file with 5 second dely from temp do app folder and run newFile
End Sub
second app instruction (none_ui App) ' copytask.jar
Googled for "windows programmatically restart program" and found this. Another one from Microsoft.
Just to say that eventually it could be done in a single exe:
- check&download
- rename
- restart
There are many threads on the fourm regarding Windows Services e.g. https://www.b4x.com/android/forum/threads/java-as-windows-service.65741/#content For many years Ive used "JavaService" but this is old, hasnt been updated for years and while robust isn't that friendly to set up. To be fair to...