Hello all;
I coding app for my company. (I am not programmer, only for the department and jobs I work with.)
My app use on 8-10 pc on company LAN. And I publish a new version every week. it takes a lot of time to do it manually for the 8-10 computer.I decided to do an automatic update. Of course.. Before, I wanted from @Erel for IDE. ( my wish just open https://www.b4x.com/android/forum/threads/update-system-like-android-app.100783/)
Finaly I added library and an example. This library support LAN and WEB download (no secure) & FTP
update : V.1.57
update "FinishDownlaod";
Now you can restart application after complate download
update : V.1.3
Adding secure FTP update.
adding CheckingResult
adding IsInitializedFTP
adding UseFTP
Author: Tayfur
Version: 1.3
#Event:
#Properties:
#Sub & Fuctions:
I coding app for my company. (I am not programmer, only for the department and jobs I work with.)
My app use on 8-10 pc on company LAN. And I publish a new version every week. it takes a lot of time to do it manually for the 8-10 computer.I decided to do an automatic update. Of course.. Before, I wanted from @Erel for IDE. ( my wish just open https://www.b4x.com/android/forum/threads/update-system-like-android-app.100783/)
Finaly I added library and an example. This library support LAN and WEB download (no secure) & FTP
update : V.1.57
update "FinishDownlaod";
Now you can restart application after complate download
update : V.1.3
Adding secure FTP update.
adding CheckingResult
adding IsInitializedFTP
adding UseFTP
Author: Tayfur
Version: 1.3
#Event:
- DownloadError (info as String)
- DownloadComplete (TempFolder as String, TempFile as String)
- CheckingResult (Success As Boolean, updatetype As String)
- Success: file found, connections is ok, everthing is ok, etc. general control
- upodatetype : "LAN", "WEB","FTP"
#Properties:
- FolderNameLAN as String
- FolderNameWEB as String
- TargetExtLAN as String
- TargetFileLAN as String
- VerisonLimit As Int
- VerFractionLimit As Int
- AppVersion as String
- AppLogger as Boolean
#Sub & Fuctions:
- Initialize (Callback As Object, EventName As String)
autoupdate.Initialize(Me,"autoupdate")
- IsInitializedWEB As Boolean
- IsInitializedLAN As Boolean
- IsInitializedFTP As Boolean
- UseWEB (AnaForm As Form, Version As String,FileName As String,FileExtension As String,SourceFolder As String)
'Version : (only number and point) Own app verision. Code find upper version on WEB destination, if You use empty; The program checks the file dates. It works if the file in the destination is newer.
'FileName: its file name on destination folder. it s not inculded file extension
'FileExtension: its need for cheking file name.
'SourceFolder : Source folder on web.
'Note: be careful, have big and small character sensitivity.
autoupdate.UseWEB(MainForm,"1.1","Choqok","png","https://upload.wikimedia.org/wikipedia/tr/0/0c")
'FileName: its file name on destination folder. it s not inculded file extension
'FileExtension: its need for cheking file name.
'SourceFolder : Source folder on web.
'Note: be careful, have big and small character sensitivity.
autoupdate.UseWEB(MainForm,"1.1","Choqok","png","https://upload.wikimedia.org/wikipedia/tr/0/0c")
- UseLan (AnaForm As Form, Version As String,FileName As String,FileExtension As String,SourceFolder As String)
'Version : (only number and point) Own app verision. Code find upper version on LAN destination, if You use empty; The program checks the file dates. It works if the file in the destination is newer.
'FileName: its file name on destination folder. it s not inculded file extension
'FileExtension: its need for cheking file name.
'SourceFolder : Source folder on lan.
autoupdate.UseLan(MainForm,"1.2","test","jar","\\192.168.1.31\app\new")
'FileName: its file name on destination folder. it s not inculded file extension
'FileExtension: its need for cheking file name.
'SourceFolder : Source folder on lan.
autoupdate.UseLan(MainForm,"1.2","test","jar","\\192.168.1.31\app\new")
- UseFTP (Mainform As Form,Version As String,FileName As String,FileExtension As String,serverftp As String, serverfolder As String, user As String,psw As String,port As Int)
Version: your own application version. This lib searches for a larger version number.(your app 1.3, on ftp file name is SampleB4J_1.4.jar)
FileName: your target and own file name (ex: SampleB4J.jar >> SampleB4J)
FileExtension:your target and own file name extension (ex: SampleB4J.jar >> jar)
serverftp: its frtp server name or ip adress
serverfolder: its your subfolder in ftp server
user: user name for ftp connection
psw: password for ftp connection
port: port number for ftp connection
FileName: your target and own file name (ex: SampleB4J.jar >> SampleB4J)
FileExtension:your target and own file name extension (ex: SampleB4J.jar >> jar)
serverftp: its frtp server name or ip adress
serverfolder: its your subfolder in ftp server
user: user name for ftp connection
psw: password for ftp connection
port: port number for ftp connection
- StartDownlaodWEB
start download process
- StartDownlaodLan
start download process
- FinishDownlaod(aftermilisecond As Int, RunJar as Boolean, Package as String) as Boolean
After works it form closed. its will copying from temp file after close app. Re-open updated jar file (only JAVA app)
aftermilisecond : re-open delay time 5000-10000 (5-10sec)
RunJar: if you want to open downloaded file (TRUE)
Package: if you want to open downloaded , this value is your package name of download file. (b4j.example.main)
aftermilisecond : re-open delay time 5000-10000 (5-10sec)
RunJar: if you want to open downloaded file (TRUE)
Package: if you want to open downloaded , this value is your package name of download file. (b4j.example.main)
- CheckingLan
its cheking folder on LAN
- CheckingWEB
it s cheking web connection with target web site
- CheckingFTP
it s cheking FTP connection with target web site
Attachments
Last edited: