How do I unload a Smartphone app via the Compact Framework

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
 
A

Alex Feinman [MVP]

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>
 
G

Guest

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
 
R

Rob Tiffany

Alex, do you have any clue as to what the P/Invoke looks like to call
DMProcessConfigXML?

Thanks,
Rob
 
A

Alex Feinman [MVP]

[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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top