How do I unload a Smartphone app via the Compact Framework

  • Thread starter Thread starter Rob Tiffany, eMVP
  • Start date Start date
R

Rob Tiffany, eMVP

Hello all,
In order to programmatically uninstall an app via the Compact Framework,
one just calls "\Windows\unload.exe", "appname.exe" on the Pocket PC. The
Smartphone doesn't include unload.exe or even wceload.exe anywhere on the
device. So how does one accomplish this task? Is there some other exe to
call that accomplishes the same function?

Thanks,
Rob Tiffany, eMVP
 
On Smartphone you do it via DMProcessConfigXML (or RapiConfig fropm the
desktop) by feeding it something like this:

<wap-provisioningdoc>
<characteristic type="UnInstall">
<characteristic type="Some Application">
<parm name="uninstall" value="1"/>
</characteristic>
</characteristic>
</wap-provisioningdoc>
 
RT-[Tue, 9 Nov 2004 20:47:14 -0600]:
Smartphone doesn't include [...] even wceload.exe anywhere

h:\>ce -dir windows/*load*.exe

Directory for ce:/windows/*load*.exe

2004-09-14 01:39:44 sr ZR 12656 DownloadAgent.exe
2004-09-13 23:06:44 hsr ZRX 33016 wceload.exe
2 File(s) 45672 bytes
0 Dir(s) 10997760 bytes free in object store

Volume MB total Free Used %Used
 
Alex, do you have any clue as to what the P/Invoke looks like to call
DMProcessConfigXML?

Thanks,
Rob
 
[DllImport("coredll")]
static extern int DMProcessConfigXML(
string pszWXMLin,
int dwFlags,
out IntPtr ppszwXMLout
);

The dwFlags value should be set to CFGFLAG_PROCESS = 1

The minor problem with the call is that the returned string buffer is
supposed to be deallocated via delete[] ppszwXMLOut, which is of course not
possible to do in managed code. Instead of writing a wrapper, I believe you
can simply P/Invoke LocalFree as that's what the delete does in CRT (and I
just looked it up - indeed all delete does is calls into LocalFree)
 
Back
Top