User's Manual

Chapter 7 — Programming
142 CN30 Mobile Computer User’s Manual
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
} // end if
return codeINSTALL_EXIT_DONE;
}
codeUNINSTALL_INIT
Uninstall_Init(
HWND hwndParent,
LPCTSTR pszInstallDir ) {
// TODO: Perform the reverse of INSTALL_INIT here
return codeUNINSTALL_INIT_CONTINUE;
}
codeUNINSTALL_EXIT