Chapter 3 — Configuring the Computer
BOOL fPreviouslyInstalled, LPCTSTR pszInstallDir )
{
return codeINSTALL_INIT_CONTINUE;
}
codeINSTALL_EXIT Install_Exit ( HWND hwndParent,
LPCTSTR pszInstallDir, WORD cFailedDirs, WORD cFailedFiles, WORD cFailedRegKeys, WORD cFailedRegVals, WORD cFailedShortcuts )
{
HANDLE h;
TCHAR srcfile[MAX_PATH]; TCHAR dstfile[MAX_PATH];
if (cFailedDirs cFailedFiles cFailedRegKeys cFailedRegVals cFailedShortcuts)
return codeINSTALL_EXIT_UNINSTALL;
if ( IsProcessRunning( L”autocab.exe” ) )
{
h= CreateFile( L”\\Windows\\__resetmeplease__.txt”, (GENERIC_READ GENERIC_WRITE), 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN, NULL );
if ( h != INVALID_HANDLE_VALUE ) CloseHandle( h );
else
{
//Couldn’t create the file. If it failed because the file already
//exists, it is not fatal. Otherwise, notify user of the inability to
//reset the device and they will have to perform it manually after all of
//the installations are complete.
}// end if
else
{
DWORD dret;
h = CreateFile( L”SYI1:”,
(GENERIC_WRITE GENERIC_READ), 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
// Force a warm start NOW.
if ( h != INVALID_HANDLE_VALUE )
{
DeviceIoControl( h, IOCTL_TERMINAL_RESET, NULL, 0, NULL, 0, &dret, NULL);
//Won’t return, but we’ll show clean up anyway CloseHandle( h );
}
else
{
//Couldn’t access SYSIO. Notify user.
} // end if
64 | 751G Color Mobile Computer User’s Manual |