forced a clean-up of the plugins dir and solid installer's temp file on reboot since the regular one wasn't called on windows 9x

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3434 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2004-01-29 23:18:32 +00:00
parent 547b40d6b5
commit de15ecd44b
3 changed files with 32 additions and 12 deletions

View file

@ -49,6 +49,8 @@ HWND g_hwnd;
HANDLE g_hInstance;
#endif
void NSISCALL CleanUp();
char *ValidateTempDir()
{
validate_filename(state_temp_dir);
@ -230,21 +232,34 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
#endif//NSIS_CONFIG_LOG
end:
if (g_db_hFile != INVALID_HANDLE_VALUE) CloseHandle(g_db_hFile);
#ifdef NSIS_COMPRESS_WHOLE
if (dbd_hFile != INVALID_HANDLE_VALUE) CloseHandle(dbd_hFile);
#endif
if (m_Err) my_MessageBox(m_Err, MB_OK | MB_ICONSTOP | (IDOK << 20));
CleanUp();
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
// Clean up after plug-ins
if (state_plugins_dir[0]) doRMDir(state_plugins_dir, 1);
#endif // NSIS_CONFIG_PLUGIN_SUPPORT
if (g_hIcon) DeleteObject(g_hIcon);
if (m_Err)
my_MessageBox(m_Err, MB_OK | MB_ICONSTOP | (IDOK << 20));
#if defined(NSIS_SUPPORT_ACTIVEXREG) || defined(NSIS_SUPPORT_CREATESHORTCUT)
OleUninitialize();
#endif
ExitProcess(ret);
}
void NSISCALL CleanUp()
{
if (g_db_hFile != INVALID_HANDLE_VALUE)
{
CloseHandle(g_db_hFile);
g_db_hFile = INVALID_HANDLE_VALUE;
}
#ifdef NSIS_COMPRESS_WHOLE
if (dbd_hFile != INVALID_HANDLE_VALUE)
{
CloseHandle(dbd_hFile);
dbd_hFile = INVALID_HANDLE_VALUE;
}
#endif
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
// Clean up after plug-ins
doRMDir(state_plugins_dir, 1);
#endif // NSIS_CONFIG_PLUGIN_SUPPORT
}