Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 18th April 2011, 10:00   #1
maveraa
Junior Member
 
Join Date: Apr 2011
Posts: 4
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..
maveraa is offline   Reply With Quote
Old 18th April 2011, 10:10   #2
Highcoder
Member
 
Join Date: Jan 2011
Posts: 69
...

I think System::Call rapi::CeDeleteFile.... should work for you.
Highcoder is offline   Reply With Quote
Old 18th April 2011, 10:20   #3
maveraa
Junior Member
 
Join Date: Apr 2011
Posts: 4
...

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?
maveraa is offline   Reply With Quote
Old 18th April 2011, 10:27   #4
Highcoder
Member
 
Join Date: Jan 2011
Posts: 69
...

Have a look at the NSIS website. In the developer center there are PDA examples where you can read more about it.

Cheers
Highcoder is offline   Reply With Quote
Old 18th April 2011, 10:54   #5
maveraa
Junior Member
 
Join Date: Apr 2011
Posts: 4
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?
maveraa is offline   Reply With Quote
Old 18th April 2011, 11:32   #6
Highcoder
Member
 
Join Date: Jan 2011
Posts: 69
...

Can´t test it in the moment but it should be:

PHP Code:
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
Highcoder is offline   Reply With Quote
Old 18th April 2011, 11:35   #7
maveraa
Junior Member
 
Join Date: Apr 2011
Posts: 4
It's worked Highcoder. Thank you very much.
maveraa is offline   Reply With Quote
Old 18th April 2011, 11:59   #8
Highcoder
Member
 
Join Date: Jan 2011
Posts: 69
...

Fine.
But keep in mind that there is no errorhandling in this code...

The better code is:

PHP Code:
StrCpy $"" ;set $0 to "nothing"
System::Call "rapi::CeRapiInit() i .r0" ;initialize RAPI and put returncode to $0. 0=success
StrCmp 
$"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
Highcoder is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
cab, delete, pocket, pocket pc

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump