locked
Downloading an application to a windows mobile device RRS feed

  • Question

  • I've seen other applications do this as well as visual studio, what they are doing is directly downloading an executable to a device, after which since they are not sign I have to click OK to run it.  What I'm trying to figure out is how this is done, I've poored over all the doc's to no avail.  What I need to do is I'm running a test program for a production line, I have an app on the PC and what I need to get down to the device is a simple deamon to do testing, right now they have to run it through an app on a SD card.  I want to be able to automate this process.  So what interface should I be looking to accomplish this
    Sunday, June 20, 2010 1:23 AM

Answers

  • RAPI.

    http://msdn.microsoft.com/en-us/library/aa920177.aspx

    http://rapi.codeplex.com/

    This can be used to copy files on to the device and also to start processes.


    Controls for WPF, Windows Forms and Silverlight at http://www.divelements.co.uk
    • Proposed as answer by Tim Dawson Thursday, June 24, 2010 7:24 AM
    • Marked as answer by warrentang Friday, June 25, 2010 3:10 AM
    Sunday, June 20, 2010 8:19 AM
  • RAPI again:

    http://msdn.microsoft.com/en-us/library/aa908907.aspx

    Or RAPI2:

    http://msdn.microsoft.com/en-us/library/aa920547.aspx

     


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by warrentang Friday, June 25, 2010 3:10 AM
    Sunday, June 20, 2010 11:43 PM
  • On Sun, 20 Jun 2010 22:57:19 +0000, Petchey wrote:


    Okay I've got my executable dowloaded and running, what I need to know is when ActiveSync is connected so and can intitiate a download?
    Some other approaches:

    1) CeRapiInit blocks (won't return) until a connection is made. So you
    can make your program wait for a connection by calling this function.
    But then you need some way to let the user force failure. Perhaps
    putting the code that uses RAPI in a separate thread and providing a
    way for the main thread to kill the RAPI thread.

    2) CeRapiInitEx always returns immediately. So your program can "poll"
    to watch when a device connects. You can put the call in a loop, using
    Sleep to pause betwen calls. And you should provide a way to break out
    of the loop. Perhaps a separate thread as for CeRapiInit.

    3)Your application will be started automatically if the path to its
    executable is provided as a string value for the registry key:
            HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE
    Services\AutoStartOnConnect
    The name of the value doesn't matter, so you might want to use the
    name of your program.


    • Marked as answer by warrentang Friday, June 25, 2010 3:10 AM
    Tuesday, June 22, 2010 4:06 PM

All replies

  • RAPI.

    http://msdn.microsoft.com/en-us/library/aa920177.aspx

    http://rapi.codeplex.com/

    This can be used to copy files on to the device and also to start processes.


    Controls for WPF, Windows Forms and Silverlight at http://www.divelements.co.uk
    • Proposed as answer by Tim Dawson Thursday, June 24, 2010 7:24 AM
    • Marked as answer by warrentang Friday, June 25, 2010 3:10 AM
    Sunday, June 20, 2010 8:19 AM
  • Looked at the API, the only function which appears to allow me to download a file is CeWriteFile, is this the proper method of downloading an executable?

    Sunday, June 20, 2010 8:56 PM
  • Yes, CeWriteFile() is good for any file type including executable files.

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Sunday, June 20, 2010 9:02 PM
  • Okay I've got my executable dowloaded and running, what I need to know is when ActiveSync is connected so and can intitiate a download?

    Sunday, June 20, 2010 10:57 PM
  • RAPI again:

    http://msdn.microsoft.com/en-us/library/aa908907.aspx

    Or RAPI2:

    http://msdn.microsoft.com/en-us/library/aa920547.aspx

     


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by warrentang Friday, June 25, 2010 3:10 AM
    Sunday, June 20, 2010 11:43 PM
  • On Sun, 20 Jun 2010 22:57:19 +0000, Petchey wrote:


    Okay I've got my executable dowloaded and running, what I need to know is when ActiveSync is connected so and can intitiate a download?
    Some other approaches:

    1) CeRapiInit blocks (won't return) until a connection is made. So you
    can make your program wait for a connection by calling this function.
    But then you need some way to let the user force failure. Perhaps
    putting the code that uses RAPI in a separate thread and providing a
    way for the main thread to kill the RAPI thread.

    2) CeRapiInitEx always returns immediately. So your program can "poll"
    to watch when a device connects. You can put the call in a loop, using
    Sleep to pause betwen calls. And you should provide a way to break out
    of the loop. Perhaps a separate thread as for CeRapiInit.

    3)Your application will be started automatically if the path to its
    executable is provided as a string value for the registry key:
            HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE
    Services\AutoStartOnConnect
    The name of the value doesn't matter, so you might want to use the
    name of your program.


    • Marked as answer by warrentang Friday, June 25, 2010 3:10 AM
    Tuesday, June 22, 2010 4:06 PM