Programing Help, Adding a warm boot into an autorun

// Expert user has replied.
G Gary Miller 3 years 5 months ago
3 4 0

On a 9094 device we use an autorun.exe to install a bunch of .cabs and .exe’s in the order specified.  In the middle of the autorun’s installation sequence, a graceful Warm Boot is needed.  The Fusion .cab used for the 9094s install provides the Warm Boot needed.  After this Warm Boot, the autorun.exe picks up where it left off and finishes the rest of the .cab installs successfully.

 

For the autorun.exe we are trying to design for an MC65 device, there is no standalone Fusion install that can be leveraged for a graceful Warm Boot since latest BSP incorporates latest Fusion driver.  Therefore, I’m trying to find a way to gracefully Warm Boot MC65 in middle of autorun.exe install sequence so that the autorun.exe picks up where it left off after the Warm Boot.  We compiled the following code into an .exe and run this .exe to try and reproduce the Warm Boot provided by a Fusion .cab file.   Based on limited testing , the .exe is Warm Booting the device, however we’ve been getting lucky in that the next .cab that is designated to run after Warm Boot doesn’t finish it’s install before the Warm Boot.  Therefore, this .cab file will get installed after the Warm Boot, since it’s next in line.  The concern is that at some point, this .cab will be in the middle of its install when the .exe Warm Boot takes place, thus causing some inconsistent state.  So, we’re looking for a way to properly pass control from one .cab install to the next while incorporating a graceful Warm Boot in between.  Whatever Warm Boot is being called by the Fusion .cab file (used by 9094), it seems to meet our needs by proxy (for the 9094).  We just need something similar for the MC65.

 

Module Module1

    _

    Private Function SetSystemPowerState(ByVal psState() As System.Char, ByVal StateFlags As System.Int32, ByVal Options As System.Int32) As Int32

    End Function

 

    Const POWER_STATE_RESET As Integer = &H800000

    Sub Main()

 

        System.Threading.Thread.Sleep(3000)

        WarmReset()

 

    End Sub

    Public Sub WarmReset()

 

        SetSystemPowerState(Nothing, POWER_STATE_RESET, 0)

 

    End Sub

 

    Public Sub ColdReset()

 

        Dim cState() As System.Char

        cState = New String("ResetCold").ToCharArray

        SetSystemPowerState(cState, 0, 0)

 

    End Sub

 

End Module

Thoughts?

Please Register or Login to post a reply

4 Replies

G Gary Miller

Paul, That was exactly what my customer was looking for. Thanks

E Efkan YILMAZ

How about adding another sleep right after the WamReset()  A nice long one (maybe a minute) should ensure that your reboot happens while your reboot app is still running, so the next cab file should not start installing before the reboot.

G Gary Miller

.

Don,

Thanks for the response. I think that I needed to add a little more information. What my customer is trying to emulate is the “neat” way that our Fusion cabs behave. I received some information from engineering explaining how they process the flow. It is as follows:

From engineering:

When we release a cab file, we make a setup.dll which will do a warmboot after installation completes

Setup.dll's have defined entry points

one of them is Install_Exit

which gets called upon the installation being complete.

From customer:

There is no timing issue with the .cab installs. All I need is a “dummy” .cab file that does nothing else except call a graceful reboot via “install_exit”.  Alternately, if someone could provide the source code and instructions, then maybe I can build the .cab file.  I just don’t know how to program/design this type of .cab file.

thanks

E Efkan YILMAZ

Hello Gary, The attached CAB will do a warmboot - it runs an app to do this.  It displays a countdown and also has the option to allow the user to abort the reboot.  There are some registry settings that setup the warmboot app fontsize, color etc.. - these are in the CAB and get applied before the warmboot app is run.  The defaults in the cab are for WM VGA screen  I have included the source code to the setup.dll - It also has the option to call the reboot API for WM (would need to change for CE). I use a tool called WINCE CAB Manager (by OCP software)  to create/edit CAB's - it has a very good UI and easy to use. - Can easily add/remove setup.dll, edit registry etc..

CONTACT
Can’t find what you’re looking for?