Our device based on windows ce6.0. .net compact framework version 3.5.
Required
Two apps
App A: updateservice app(write by c#,can work on .compact framework 3.5). can update app B,and can manager wifi connection or cdma connection.(user can manual scanning wifi network,seletc newtwork, connect ,disconnect,etc. For cdma, can input apn and dialnumber,connect,disconnetc,etc.)
App B: updatemanager(console application write by c or c++, use wince6.0 api)
Inter communication method(msg queue)
Todo list:
For simple.
use app A(A) download new app B(NB),update orignal app B(OB),and backup orignal app B(OB) to app B1(BB)
details
1. (A) access resetful services from a server to get (OB)'s RSA public key and signature of (OB)(sha1 hash encrypt by RSA private key)
2. Check (OB) is modified or [login to view URL] (OB) is original one,execute (OB).
3. Press "U" in (OB)'s console, (OB) use msg queue tell A enter update state.
4. (A) access restful services from a server to get the updatefile urls([login to view URL])or(https://[login to view URL]).
5. (A) accesss the server to get signature of [login to view URL](sha1 hash encrypt by the same RSA private key)
6. (A) check if the [login to view URL] is original one.([login to view URL] contains two files,(NB) and (NB)'s hash file(sha1))
7. (A) upcompress [login to view URL],use (NB)'s hash file to check if the (NB) is correct.
8. (A) send close msg to (NB).
9. When (NB) is closed,(A) backup (OB) to (BB),change (OB) folder to other name, and change (NB) folder names to the(OB).
10. (A) Run (NB),(NB) send msg to (A),to tell update successful.
11. After step [login to view URL] are two B(NB and BB),one A,and two B's signature on device.
12. (A) will track both(BB) and (NB),if press "P" in (NB),(A) will close (NB) and exchange folder name between (NB) and (BB),than start(BB).
13. if press "N" in (BB),(A) will close (BB) and exchange folder name between (NB) and (BB),then start(NB)
14. if press "U" in either (BB) and (NB), goto 1 to process new [login to view URL] delete the (B) which is not running after download and check the new (B).
Note
1. (A) should send msg to (B) to show update state.ex. download progress,etc.
2. (A) always use the same path to start OB NB and BB.