fwiw, we were presented with this "replace myself" challenge, and eventually settled upon using Nutshell installer...when you know the installer prc is on the device (which contains your new app and perhaps other required pdb's, etc...), launch the nutshell with a sysappuiswitch() and let it install your new app over the old one. Many considerations of what to do with existing data, etc.
for us, it solved: replacing myself bundling important data files even brought the file size down via the compression option, which is helpful for OTA distribution, which we use heavily. Frank ----- Original Message ----- From: "Russell Cagle" <[EMAIL PROTECTED]> To: "Palm Developer Forum" <[email protected]> Sent: Tuesday, November 08, 2005 11:15 AM Subject: Re: deleting a program currenty on the palm > Instead of my application deleting itself while running, my application > renames itself to MyCoolApp_deleteme and then launches the version on > the card. After being launched from the card, my application always > checks for and deletes MyCoolApp_deleteme. Here's the code. Although > it won't compile as-is, it should be enough to write your own: > > bool checkExecutable(const char *executableName, const char > *applicationName) { > > // Don't mess with this on the emulator. > if (HostGetHostID() != hostIDPalmOS) > return true; > > Err err; > > // Always delete the backup name first. > char *backupName = StrDuplicate(applicationName); > backupName = StrAppend(backupName, " Backup"); > LocalID backupLid = DmFindDatabase(0, backupName); > if (backupLid != 0) { > err = DmDeleteDatabase(0, backupLid); > palmError(err); > } > > LocalID lid = DmFindDatabase(0, applicationName); > error(lid == 0); > > UInt32 flashDate; > err = DmDatabaseInfo(0, lid, NULL, NULL, NULL, &flashDate, NULL, NULL, > NULL, NULL, NULL, NULL, NULL); > palmError(err); > > char *path = StrDuplicate("/Palm/Launcher/"); > path = StrAppend(path, executableName); > FileRef file = vfsFileOpen(cardno, path, vfsModeRead); > ... -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
