Uninstall s60 application
hi all
I want to uninstall my application programmaticly from the mobile and i used this code then made some modification to it but nothing occur
[url]http://wiki.forum.nokia.com/index.php/CS000817_-_Installing_and_uninstalling_MIDlets_programmatically[/url]
my code
[QUOTE]void CreinstallContainerView::UninstallSisL()
{
RFs fileSession;
CDir* dirList;
TInt i;
TFileName fullPath;
TUint contextUid;
TFileName fileName;
_LIT(KDirName1, "c:\\system\\install\\registry\\");
_LIT(KFileSpec1,"c:\\system\\install\\registry\\AlMosaly");
User::LeaveIfError( fileSession.Connect() );
CleanupClosePushL( fileSession );
// Get the file list, sorted by name
User::LeaveIfError( fileSession.GetDir( KFileSpec1,
KEntryAttMaskSupported,
ESortByName, dirList ) );
CleanupStack::PushL(dirList);
for ( i=0; i < dirList->Count(); i++ )
{
fileName = (*dirList)[i].iName;
if( fileName.Compare(_L("Application name")) == KErrNone )
{
continue;
}
fullPath = KDirName1;
fullPath.Append(fileName);
RFile lFile;
TInt err = lFile.Open( fileSession, fullPath, EFileShareAny | EFileRead );
if(err == KErrNone)
{
TInt lSize;
lFile.Size(lSize);
RBuf8 lBuf;
lBuf.Create(lSize);
lBuf.CleanupClosePushL();
lFile.Read(lBuf);//read contents into buffer
RBuf buff;
buff.Create(lSize);
buff.CleanupClosePushL();
buff.Copy(lBuf);//Copy into 16 bit buffer
lFile.Close();
if (err == KErrNone)
{
// Check for MIDlet name in the file
err = buff.Find(_L("Application name.sis"));
if (err != KErrNotFound)
{
TLex lex( fileName.Mid(0,8) );
lex.Val( contextUid, EHex );
SwiUI::RSWInstSilentLauncher inst;
inst.Connect();
SwiUI::TUninstallOptions options;
SwiUI::TUninstallOptionsPckg optionsPckg;
options.iKillApp = SwiUI::EPolicyAllowed;
options.iBreakDependency = SwiUI::EPolicyAllowed;
optionsPckg = options;
TInt resp = inst.SilentUninstall( TUid::Uid(contextUid),
optionsPckg,
SwiUI::KSisMimeType );
if(resp==1)
{ TBuf<300> c;
c = (GetNote('%'));
RunConfQuery1L(&c);
}
inst.Close();
}
}
CleanupStack::PopAndDestroy(2); // buff, lBuf
}
}
CleanupStack::PopAndDestroy(2); // dirList, fileSession
}
[/QUOTE]
I added the required API,libraries,and run it in the device directly
what is the problem ????
Re: Uninstall s60 application
And what errors or panics you are getting?
[QUOTE]I want to uninstall my application programmaticly
...
[code]// Check for [COLOR="Red"]MIDlet[/COLOR] name in the file
err = buff.Find(_L("Application name[COLOR="Red"].sis[/COLOR]"));[/code]
[/QUOTE]
???
Are you sure that you are trying to delete MIDlet (J2ME) application?
Re: Uninstall s60 application
I need to uninstall .sis application not jar
nothing occur neither error nor panic
I modified this code to uninstall sis
is it only for java midlet??????????????
Re: Uninstall s60 application
Please verify if you have added sufficient capabilities to make use of this API.
Re: Uninstall s60 application
yes I added CAPABILITY TrustedUI
Re: Uninstall s60 application
Can you put logs and check if it is able to parse and find the application name properly.