Uninstall API

Login to reply to this topic.
Wed, 2005-09-07 10:14
Joined: 2005-09-07
Forum posts: 17
Does anyone know how I can uninstall an application programmatically, i.e. without using the phone or PC UI? I understand that the .sis file created on system\install holds info on the files to be removed at uninstall, but is there a command that is run with this .sis file as a parameter which will remove the application related to the .sis file?

Wed, 2005-09-07 10:18
Joined: 2004-05-24
Forum posts: 982
Re: Uninstall API
Uninstalling an application from the phone means deleting some file and some directories/directory from file system. If you created the .sis you know what files you have to delete and from where. If not you can use a file explorer to find out what files where installed on your phone.

pirosl

Wed, 2005-09-07 10:29
Joined: 2005-09-07
Forum posts: 17
Re: Uninstall API
Thanks a lot... but my application knows only the name of the SIS file, which were installed on the phone. Nothing more. I want to do the same from my application as what would happened, if user would go to Application Manager and uninstall this application manually.

My question is: How Application Manager does uninstallation and if there is an API to do the same? Thanks for your help.
Wed, 2005-09-07 12:03
Joined: 2004-05-24
Forum posts: 982
Re: Uninstall API
Do you know only the name of the sis or do you have also the sis?

pirosl

Wed, 2005-09-07 12:24
Forum Nokia Champion
Joined: 2005-02-16
Forum posts: 45
Re: Uninstall API
If you have the name of the sis, you could try setting up a CApaCommandLine, using "z:\\system\\apps\\appinst\\appinst.app" as library.
Set the other fields appropiatedly, setting doc name (sis file name) and tail: cmdLine->SetTailEndL(_L("UNINSTALL")); and issue a RApaLsSession::StartApp()
Wed, 2005-09-07 12:36
Joined: 2005-09-07
Forum posts: 17
Re: Uninstall API
Thanks a lot. I already found a way how to install an application from SIS file:

    CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
    cmdLine->SetLibraryNameL(_L("z:\\System\\Apps\\AppInst\\Appinst.app"));
    cmdLine->SetDocumentNameL(_L("c:\\some_sis_file.SIS"));
    cmdLine->SetCommandL(EApaCommandRun);

    RApaLsSession ls;
    User::LeaveIfError(ls.Connect());
    CleanupClosePushL(ls);
    User::LeaveIfError( ls.StartApp(*cmdLine) );

    CleanupStack::PopAndDestroy(2); // cmdLine and ls

But when I changed the documentName to my uninstall SIS, I received an error (File corrupted).
    ...
    cmdLine->SetDocumentNameL(_L("c:\\System\\Install\\ListOfUIDs.SIS"));
    ...

It will try with the UNINSTALL option and I will let you know about the result.
Wed, 2005-09-07 12:53
Joined: 2005-09-07
Forum posts: 17
Re: Uninstall API
... bad luck Sad

I tried following code and I have still "File corrupted!" error message. But I used _L8("UNINSTALL") instead of _L("UNINSTALL"), because "const TDesC8 &" is requested:

    CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
    cmdLine->SetLibraryNameL(_L("z:\\System\\Apps\\AppInst\\Appinst.app"));
    cmdLine->SetDocumentNameL(_L("c:\\System\\Install\\ListOfUIDs.SIS"));
    cmdLine->SetTailEndL(_L8("UNINSTALL"));
    cmdLine->SetCommandL(EApaCommandRun);

    RApaLsSession ls;
    User::LeaveIfError(ls.Connect());
    CleanupClosePushL(ls);
    User::LeaveIfError( ls.StartApp(*cmdLine) );

    CleanupStack::PopAndDestroy(2); // cmdLine and ls

Any idea?
Wed, 2005-09-07 13:14
Joined: 2005-09-07
Forum posts: 17
Re: Uninstall API
I have just found several things:

1) Someone already faced the same problem as me: "Unfortunatly this seem not to work for series60 version 2.0, because it has not worked on the 6600 for us. If I remember it correctly, the installer seem to try to install it fails with a corrupt file message."

I am playing with Nokia 6680, it means, Symbian 8.0 series 60 v2 FP2.

2) there is instapp.h file in SDK:

  // name of install app file
  _LIT(KInstallAppName,"Instapp.app");

  // NOTE: following must be given even length due to problem with
  // CApaCommandLine::NewL(fullCmdLine)) in EikDll::StartAppL()!
  // keywords at end of InstApp command line which tell it what to do
  _LIT8(KUninstallCommandLineTail,"UNINSTALLX");
  _LIT8(KInstallCommandLineTail,"INSTALLX");

  /**
  Constant shared between InstApp and InstCtrl
  @publishedPartner
  @released
  */
  enum TInstallMode {EUninstall,EInstall};

... still facing the same problem, it means, any idea more than welcome!
Wed, 2005-09-07 13:32
Joined: 2004-05-24
Forum posts: 982
Re: Uninstall API
What about CInstallEngine? Never worked with it...but may be it helps you....Also have to check if it's in you sdk

pirosl

Wed, 2005-09-07 14:54
Joined: 2005-09-07
Forum posts: 17
Re: Uninstall API
... again bad luck.

CInstallEngine is not supported in newer SDKs. Sad There is still insteng.lib library, but not insteng.h header file.
This header file was available in the Series60 1.2 SDK.

Do you think, that it could be still working, if I took the header file from version 1.2?

Does anyone have it? Did anyone try it?

I think, I have tried everything wat is available im my SDK... but nothing works. Sad
Wed, 2005-09-07 14:57
Joined: 2005-09-07
Forum posts: 17
Re: Uninstall API
... there has to be a way, because Application Manager is able to do it ...
Wed, 2005-09-07 14:57
Joined: 2004-05-24
Forum posts: 982
Re: Uninstall API
Quote from: skauting
... again bad luck.

CInstallEngine is not supported in newer SDKs. Sad There is still insteng.lib library, but not insteng.h header file.
This header file was available in the Series60 1.2 SDK.

Do you think, that it could be still working, if I took the header file from version 1.2?

Does anyone have it? Did anyone try it?

I think, I have tried everything wat is available im my SDK... but nothing works. Sad

I think you can give a try....checking with the insteng.h from 1.2 sdk. You don't have anything to loose.....or?

pirosl

Wed, 2005-09-07 15:37
Joined: 2005-09-07
Forum posts: 17
Re: Uninstall API
I will try... just downloading SDK 1.2... my connection is not really fast...

Anyway... I was thinking, how the Application manager works.
I think, in first step, it just looks through all install directories to list all applications, which could be deleted (one application is equal to one reduced SIS file). In second step, when the user selects an application, it parses the SIS file and according to its content, it deletes files, etc.

I check the content of the reduced SIS file with WinHex editor and it really seems, that all information could be found in this file.

Is there any description of the SIS file and reduced SIS file structure?
Mon, 2005-09-12 04:56
Joined: 2004-05-31
Forum posts: 51
Re: Uninstall API
It looks to me like AppInst should take "UNINSTALLX" as the tailing command rather than "UNINSTALL" ?

As for SIS the file format, details for it can be found at http://homepage.ntlworld.com/thouky/software/psifs/sis.html (thanks to Alexander Thoukydides).
Mon, 2005-09-12 10:33
Joined: 2005-09-07
Forum posts: 17
Re: Uninstall API
I tried it with both "UNINSTALL" and "UNINSTALLX". The behaviour it the same on Nokia 6680. Sad

Thanks a lot SIS file format link... I would help me... In case I will succeed, I will let all know...
Tue, 2006-01-24 09:59
Joined: 2005-02-11
Forum posts: 214
Re: Uninstall API
As there has been no more replies, I assume you failed? If not, I would like to hear how you did it

"I only know that I know nothing." (Socrates)

  • Login to reply to this topic.