none
2577 Autorun.exe question

    Question

  • Hi,

     

    We use the 2577 folder and autorun.exe approach to install the cab files for our application. This works fine however I would like to change this a little.

     

    I would like to, from the autorun.exe, check a file and if this file meets my citeria, cold boot the device.

     

    I have coded this as I would expect and running the same code in another project works as expected however when I want the autorun.exe to run this code it runs into problems.

     

    It seems that once the autorun.exe has run once, it will not run again after another warm boot. I thought this was not the case, I thought the autorun.exe was always run after each warm boot.

     

    I am warm booting the device programmatically, however manually warm booting will result in the same behaviour.

     

    I can prove that the autorun.exe is only running a single time because the first line of my main method in the autorun.exe is to append to a log file, this logging is not occurring.

     

    I am sure that if I replace the autorun.exe with either the same exe or a rebuilt exe, then the autorun.exe is run again and then the process works as I would like.

     

    I have now deleted the autorun.exe from the \Windows directory and the autorun.exe from the \Storage\2577 directory was run again. Is there a reference or flag file that gets created so that the autorun is not run again?

     

    Can someone shed some light on this please as I am unsure what the problem is.

     

    Thanks

     

    Paul

    Wednesday, May 28, 2008 12:55 PM

Answers

  • Hi,

     

    Thank you for your reply.

     

    I think I have found a solution/work around to this problem. When my first run of the Autorun meets a particular citeria, I create a shortcut to itself in the \Windows\Startup directory, then when the device warms boots the Autorun will run again and then my second citeria is met so that the cold boot can take place. When the autorun is run for the third time after the cold boot the first citeria is not met (existence of a file) and therefore the shortcut is not run and this results in the original functionality.

     

    Thanks

     

    Paul

     

    Thursday, May 29, 2008 8:12 AM

All replies

  • It should definitely run upon a reboot.  Just remember that when it that the 'autorun.exe' is actually ran from the '\Windows' directory, not form the storage card, so that could have an effect depending on how you are coding your paths.  Also, the autorun file is ran with different parameters for install and uninstall events, so that may make a difference as well.  When you insert the card it will run the 'install' command, when you remove the card it will run with the 'uninstall' command.  Can you just put a messagebox in the autorun that displays whatever message so that you know it is being invoked.
    Wednesday, May 28, 2008 3:42 PM
  • Hi,

     

    Thank you for your reply.

     

    I think I have found a solution/work around to this problem. When my first run of the Autorun meets a particular citeria, I create a shortcut to itself in the \Windows\Startup directory, then when the device warms boots the Autorun will run again and then my second citeria is met so that the cold boot can take place. When the autorun is run for the third time after the cold boot the first citeria is not met (existence of a file) and therefore the shortcut is not run and this results in the original functionality.

     

    Thanks

     

    Paul

     

    Thursday, May 29, 2008 8:12 AM