Skip to content

Commit

Permalink
Update download.4dm
Browse files Browse the repository at this point in the history
  • Loading branch information
e-marchand committed Aug 2, 2023
1 parent c6adf38 commit 0b6b9f4
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Documentation/download.4dm
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@

var $url : Text
$url:="https://github.com/4d/4D-Mobile-App/releases/latest/download/4D.Mobile.App.4dbase.zip"

If (Folder(fk database folder).folder("Components").folder("4D Mobile App.4dbase").exists)
ALERT("Please close 4D and remove the component (and restart 4D)")
SHOW ON DISK(Folder(fk database folder).folder("Components").folder("4D Mobile App.4dbase").platformPath)
return
End if
var $response : Object
$response:=4D.HTTPRequest.new($url).wait().response

If ($response.status=200)

var $archiveFile : 4D.File
$archiveFile:=Folder(fk database folder).folder("Components").file("4D.Mobile.App.4dbase.zip")
$archiveFile.setContent($response.body)
Expand All @@ -20,10 +26,11 @@ If ($response.status=200)
$archiveFolder.copyTo(Folder(fk database folder).folder("Components"); "4D Mobile App.4dbase")
$archive:=Null
$archiveFolder:=Null

$archiveFile.delete()

RESTART 4D

Else
ALERT("Cannot download from latest release")
End if
End if

0 comments on commit 0b6b9f4

Please sign in to comment.