How to findout if it is Fresh Installation or Upgrade

Hello,

I have existing App and planing to build updated version. I would like to check if the installation is fresh-installation on this device or app-upgrade on this device. Based on fresh-installation OR app-upgrade,  I would like to customize little bit of user experience.

Thanks in advance for the help.

rgds

ram

Hi Ram,

If your app creates any files in the Documents Directory, those files stay the same when an app is updated.  Thus, you can test whether those files exist to see if the app is new or has been run before.  To test not just whether it’s been run before, but whether it’s an app update, you should store a file in the Documents Directory with version number of the last run of the app.  Then, on startup, you check the current version of the app against that file.  If it’s different, then you know the app has been updated.

  • Andrew

Hello Andrew,

Thank you for your help. Unfortunately, there is no content/file in Documents folder and that is how  I got stuck with this problem.

Is there any alternate in this situation (absense of any data on Documents folder?

-ram

Hi Ram,

Unfortunately I don’t think there’s any other solution.

  • Andrew

Hi Ram,

If your app creates any files in the Documents Directory, those files stay the same when an app is updated.  Thus, you can test whether those files exist to see if the app is new or has been run before.  To test not just whether it’s been run before, but whether it’s an app update, you should store a file in the Documents Directory with version number of the last run of the app.  Then, on startup, you check the current version of the app against that file.  If it’s different, then you know the app has been updated.

  • Andrew

Hello Andrew,

Thank you for your help. Unfortunately, there is no content/file in Documents folder and that is how  I got stuck with this problem.

Is there any alternate in this situation (absense of any data on Documents folder?

-ram

Hi Ram,

Unfortunately I don’t think there’s any other solution.

  • Andrew