Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/IDE/Deployment Manager/Deployment    [ Add a report in this area ]  
Report #:  125481   Status: Closed
[iOS] [Android] Deploying files doesn't overwrite existing ones
Project:  Delphi Build #:  20.0.15596.9843
Version:    20.0 Submitted By:   Stefan Westner
Report Type:  Basic functionality failure Date Reported:  6/16/2014 4:28:33 AM
Severity:    Serious / Highly visible problem Last Updated: 7/11/2014 7:57:28 AM
Platform:    All platforms Internal Tracking #:   51943
Resolution: As Designed (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 10
Description
If files that are added in the Deployment Manager are modified and a new version is installed, the new files don't overwrite the existing ones.
The new files are only installed on the fresh install of the app. This happens on both, iOS and Android.
Steps to Reproduce:
1. compile/deploy attached project, create IPA for iOS or APK for Android
2. install the IPA/APK on the device
3. the file test.txt gets deployed on the device
4. run project: clicking on the button should show the content of test.txt
5. modify the test.txt
6. increased the version numbers of the app
7. recompile the project, create IPA for iOS or APK for Android
8. update the app with the IPA/APK on the device
9. run project: clicking on the button still shows the content of the first version of test.txt, not the current modified one

I didn't install/deploy the app through the IDE itself, to test the real updating process from the appstore.
Workarounds
None
Attachment
DeployTest.zip
Comments

Tomohiro Takahashi at 6/16/2014 7:16:17 PM -
Could you provide more specific/detailed [Steps] and attach sample project to reproduce/confirm your issue?

Stefan Westner at 6/17/2014 4:43:34 AM -
Steps to reproduce:

- compile/deploy attached project, create IPA for iOS or APK for Android
- install the IPA/APK on the device
- the file test.txt gets deployed on the device
- run project: clicking on the button should show the content of test.txt

- modify the test.txt
- increased the version numbers of the app
- recompile the project, create IPA for iOS or APK for Android
- update the app with the IPA/APK on the device
- run project: clicking on the button still shows the content of the first version of test.txt, not the current modified one

I didn't install/deploy the app through the IDE itself, to test the real updating process from the appstore.

Tomohiro Takahashi at 6/18/2014 6:11:10 PM -
Regarding Android apk, a file under 'assets\internal' is handled by 'System.StartUpCopy' unit using 'assets\deployinfo\deployedassets.txt' at startup of app.
----------
program DeployTest;

uses
  System.StartUpCopy,
  ...
----------

Stefan Westner at 6/27/2014 1:18:16 AM -
Looking at the example project you can see that System.StartUpCopy is already include. In System.StartUpCopy the files aren't overwritten, if they already exists.

This renders the option in the Deployment manager "Overwrite - Always" completely useless. We NEED an option to overwrite deployed files on an update.

Stefan Westner at 6/23/2014 5:19:40 AM -
Is there any documentation on what exactly this does? Does it copy the files on _every_ startup? As we deploy quite some files that might be a huge speed disadvantage, when we only need to copy them on an update of the app.

Eva Hernandez Delgado at 7/11/2014 7:51:59 AM -
It works as expected, because 'uninstalled' command was eliminated to save time when we run an application. If we set in Run->parameters... '-cleaninstall', the application will be uninstalled in device and installed and it will work fine. See docwiki: http://docwiki.embarcadero.com/RADStudio/XE6/en/What%27s_New_in_Delphi_and_C%2B%2BBuilder_XE6#Run_Commands_Provide_New_-cleaninstall_Parameter_for_Mobile_Platforms

Xavier Dufaure de Citres at 12/14/2014 2:32:49 PM -
I totally agree with Stefan Westner: this should not be "as designed"

Currently there is no way to update client data. for instance I've html files for the help. I need to update them with the new feature  of the app. Right now the user would need to uninstall the app! this is not acceptable.

Commenting the  line "if not FileExists(DestFileName) then //do not overwrite files" Seems to work, but I am not sure of the consequences of doing so.

Xavier Dufaure de Citres at 12/14/2014 3:10:58 PM -
Here is a workaround on Android:
* modify System.StartUpCopy
   - in the interface section add "Var ASSET_OVERWRITE : Boolean = false;"
   - in the interface section exopose "procedure CopyStartUpFiles;"
   - in the CopyAssetToFile change "if (not FileExists(DestFileName)) then" by "if (not FileExists(DestFileName)) or ASSET_OVERWRITE then"

* in your own code, store in the preference file the last version the user ran. If the current version is newer do
  if optLastVersionRan<Version then
  Begin
    ASSET_OVERWRITE := true;
    CopyStartUpFiles;
    ASSET_OVERWRITE := false;
  End;

On the 1st installation the data will be copied twice (no biggy), on update the file will be overwritten.

Note for iOS: i find out that deploying the files i need in ".\Data\" is much better: it put the file directly in the bundle, this way the file are not archived (i got my app rejected because i had 12 Mb of data that was archived). Of course these files can only be read only.

Stefan Westner at 7/17/2014 2:27:33 AM -
I'm not talking about deploying the app through the IDE. Im talking about installing an App as an Update through the Playstore/Appstore.

This is a serious issue, as I'm now unable to update any file that gets deployed with the app.

Server Response from: ETNACODE01