maveraa
18th April 2011 11:00 UTC
How to delete a file from pocket PC in the process of install
Hi ;
I have a script which sent some cab files to pocket pc and install them.
I want my script to do that: When installing is finished, control the install directory on pocket pc (ex: program files\Demo) and delete a file specified(ex: demo.sdf).
How can I do that?
Thanks..
Highcoder
18th April 2011 11:10 UTC
...
I think System::Call rapi::CeDeleteFile.... should work for you.
maveraa
18th April 2011 11:20 UTC
...
Thanks for your quick response.
I have no idea about code you wrote. Can you give me a link, refference or a key words about it?
Highcoder
18th April 2011 11:27 UTC
...
Have a look at the NSIS website. In the developer center there are PDA examples where you can read more about it.
Cheers
maveraa
18th April 2011 11:54 UTC
Only example I can found is this: http://nsis.sourceforge.net/Copying_files_to_pda
However, I couldn't solve my problem with this link.
Is there any example directly about CeDeleteFile?
Highcoder
18th April 2011 12:32 UTC
...
CanĀ“t test it in the moment but it should be:
System
::Call "rapi::CeRapiInit()" ;initialize RAPI connection
System::Call "rapi::CeDeleteFile(w '\somefile.ext')" ;delete "somfile.ext"
>System::Call "rapi::CeRapiUninit()" ;UNinitialize RAPI connection
System::Free 0 ;free up mem.
cheers
maveraa
18th April 2011 12:35 UTC
It's worked Highcoder. Thank you very much.
Highcoder
18th April 2011 12:59 UTC
...
Fine. :)
But keep in mind that there is no errorhandling in this code...
The better code is:
StrCpy$0 "" ;set $0 to "nothing"
>System::Call "rapi::CeRapiInit() i .r0" ;initialize RAPI and put returncode to $0. 0=success
StrCmp$0 "0" +3 0 ; if errors display Message & abort, else delete file.
>MessageBox MB_OK "error initializing rapi interface. make sure the device is connected"
>abort
System
::Call "rapi::CeDeleteFile(w '\somefile.ext')" ;delete "somfile.ext"
>System::Call "rapi::CeRapiUninit()" ;UNinitialize RAPI connection
System::Free 0 ;free up mem.
have fun