×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    179

    uninstall application previous-installed version

    hi,

    i need to uninstall the previous version of my application that is installed on the device when a newer version installed, i need this in order to remove settings files stored in the private folder of the application.

    can i do this in .pkg file or any way else ?

    thanks in advance.

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: uninstall application previous-installed version

    AFAIk you donot have to do anything installer will remove and then install .

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    179

    Re: uninstall application previous-installed version

    Quote Originally Posted by skumar_rao View Post
    AFAIk you donot have to do anything installer will remove and then install .
    it doesn't do this all files that i create during the application life are kept there (in private folder).

  4. #4
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: uninstall application previous-installed version

    Quote Originally Posted by the_king2008 View Post
    it doesn't do this all files that i create during the application life are kept there (in private folder).
    If it were in private folder they should be removed. You can't run a Exe as files are in application private folder.

  5. #5
    Registered User
    Join Date
    May 2008
    Posts
    179

    Re: uninstall application previous-installed version

    Quote Originally Posted by skumar_rao View Post
    If it were in private folder they should be removed. You can't run a Exe as files are in application private folder.
    i hope if it works just like you said, but i have just try it and it not work.

    to be more in details i used the method RFs::PrivatePath to get the path to save files and all files in this path and internal subfolder still exists !!!!!!!!

    this is good if the installed version is the same as the version that i will install, but the problem wwhen they are different.

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: uninstall application previous-installed version

    Installing a new version of the app might not be a full uninstall-install.
    However if your installation package contains empty/initial version of your data files, they will get overwritten.
    Code:
    "nul"-"!:\private\<x>\my.dat"
    should be enough for the empty variant.
    A possible negative outcome could be that you get an Update Error instead (since you are overwriting an existing file, though it resides in your own private folder, and it was not installed by anyone actually).
    In this case just install a marker file
    Code:
    "nul"-"!:\private\<x>\remove.config"
    and check for its existence when your application starts. If it exists, remove your config files, and also remove the marker file (so the config files will not be deleted on the second time).

  7. #7
    Registered User
    Join Date
    May 2008
    Posts
    179

    Re: uninstall application previous-installed version

    Quote Originally Posted by wizard_hu_ View Post
    Installing a new version of the app might not be a full uninstall-install.
    However if your installation package contains empty/initial version of your data files, they will get overwritten.
    Code:
    "nul"-"!:\private\<x>\my.dat"
    should be enough for the empty variant.
    A possible negative outcome could be that you get an Update Error instead (since you are overwriting an existing file, though it resides in your own private folder, and it was not installed by anyone actually).
    In this case just install a marker file
    Code:
    "nul"-"!:\private\<x>\remove.config"
    and check for its existence when your application starts. If it exists, remove your config files, and also remove the marker file (so the config files will not be deleted on the second time).
    thanks for your replay,

    first of all, i have use this method before for another issue, but i have many many files and user data to delete,
    and i have a dynamic file-names (not hardcoded),also it need me to know the previous and the current versions of app.
    but only i need to uninstall or remove files only when there is a different version will be installed
    means :
    current version installed on device : 2.0.0
    new version to install : 2.1.0

    i need a way to detect versions change in installation process (pkg file).
    and a way to uninstall the previous version.(in pkg also) if any.
    why it is not like J2ME app. that gives you option to delete user data during installation.

    thanks again

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: uninstall application previous-installed version

    I do not think that you can distinguish between re-installing the same version and installing an other/new one in the .pkg file.
    In that case I still suggest relying on a marker file, and a separate one which stores the version number from the last run - and combine that one into the removal condition too.
    It is nice to have dynamically generated filenames, but how would you list them in the .pkg?
    According to the SDK Help, FILENULL is capable of cleaning files or complete directories, but it might not be what you need either.
    By the way: if you are already checking that page, you can have a look at the bottom of it, "Upgrading". After reading that a wild idea could be having different UID for different versions, but keeping the same package UID: as a result on re-installation nothing will happen, but on installing a different version, an upgrade occurs, resulting in removal of the old executable, and its private directory too (that is why the different UID is required).

  9. #9
    Registered User
    Join Date
    May 2008
    Posts
    179

    Re: uninstall application previous-installed version

    Quote Originally Posted by wizard_hu_ View Post
    I do not think that you can distinguish between re-installing the same version and installing an other/new one in the .pkg file.
    In that case I still suggest relying on a marker file, and a separate one which stores the version number from the last run - and combine that one into the removal condition too.
    It is nice to have dynamically generated filenames, but how would you list them in the .pkg?
    According to the SDK Help, FILENULL is capable of cleaning files or complete directories, but it might not be what you need either.
    By the way: if you are already checking that page, you can have a look at the bottom of it, "Upgrading". After reading that a wild idea could be having different UID for different versions, but keeping the same package UID: as a result on re-installation nothing will happen, but on installing a different version, an upgrade occurs, resulting in removal of the old executable, and its private directory too (that is why the different UID is required).
    thanks for your suggestions, i have solved the problem by usin a nother subdirectory(inside private folde)for the newer version and delete the one for older version

    thanks again.

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: uninstall application previous-installed version

    Quote Originally Posted by the_king2008 View Post
    thanks for your suggestions, i have solved the problem by usin a nother subdirectory(inside private folde)for the newer version and delete the one for older version
    Well, that is simple, nice and elegant. Far better than the terrible hack suggested by me, congrats :-)

  11. #11
    Registered User
    Join Date
    Apr 2009
    Posts
    4

    Re: uninstall application previous-installed version

    Quote Originally Posted by the_king2008 View Post
    thanks for your suggestions, i have solved the problem by usin a nother subdirectory(inside private folde)for the newer version and delete the one for older version

    thanks again.
    Could you please mention how you modified your PKG to achieve the result?

Similar Threads

  1. Cannot execute installed application on N73
    By ranglerson in forum Symbian
    Replies: 10
    Last Post: 2008-07-31, 22:20
  2. Replies: 1
    Last Post: 2008-05-08, 12:32
  3. Which Flash version to base application on?
    By TurfStudios in forum [Archived] Flash Lite on Nokia Devices
    Replies: 3
    Last Post: 2008-04-27, 23:37
  4. Replies: 3
    Last Post: 2006-11-02, 10:20
  5. Where is the installed application located??
    By vardhman in forum Symbian
    Replies: 9
    Last Post: 2004-10-03, 13:35

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×