Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 2607 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi Guys,

Looking for some ideas as I'm running out.

I'm developing an offline iOS app (lets name it MyApp.fmp12) that needs to be updated from time to time. On the homescreen I have a shortcut that invokes MyApp.fmp12 using a fmp url. Currently it works as follows:

  • At startup check the HO Master_MyApp.fmp12 to see if there's an update. This is done using an external data source and checking a script.
  • When an update is available, a copy of MyApp.fmp12 on the iOS device is made called Prev_MyApp.fmp12 and an "open url" script step invokes a script in the Prev_MyApp.fmp12 to proceed the upgrade using "fmp:/~/Prev_MyApp.fmp12?script=update&$UPDATE=Download"
  • In the startup script I detect the "Prev_" in the filename and break off processing the startup script (the startup script is called after my invoked script in the script stack and I lose the parameter, by terminating the startup script I land back in the script I want, convoluted but works. I need a startup script.)
  • The update script then closes the MyApp.fmp12 as it needs to be replaced with a new copy using another fmp url calling a "close database" script in  MyApp.fmp12.

The idea is to download a new copy from the server out of a container field. That part works just fine.

The problem enters when I close MyApp.fmp12 as that also closes the script stack and therefore all my scripts terminate.

I can't update MyApp.fmp12 until it's closed. If I close MyApp I loose the stack and everything stops. What I need is a way to launch Prev_MyApp.fmp12 when MyApp.fmp12 exits. Anyone know of a way?

The app will run on remote iPads, I can''t expect staff to do manual updates, as they are likely to break it. So I'm trying to automate it as much as I can.

Let me know if I'm not clear, I've been butting my head all week against this now, trying all sorts of different approaches.

 

Posted

I would suggest a third file that handles the update, and that's all it does. That file takes charge. When your file pings and realizes it needs to update, it exports the Updater file, and opens it. That file can then close the MyApp file and take over. 

Take a look at EasySync's EasyDeploy routine.

Posted

Had a sticky beak at the EasyDeploy solution. I actually worked something similar out over the weekend. I opted for a launcher that is always fired using a shortcut on the home screen, which will check for an update. Currently every time it fires, but I intend to modify that so it only checks every x days. The launcher checks the server, and if there's an update downloads it. Otherwise it fires MyApp and closes.
Like the EasyDeploy solution, I make use of External data sources and the fmp url. Haven't figured everything out yet but getting there.
The MyApp is only small in size, once complete will only be maybe half a MB so I don't really need the segmented downloading EasyDeploy uses.
One of my previous approaches was using an updater file as well, but that failed too. The launcher seems to do the trick though.

Thanks for your reply!

This topic is 2607 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.