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
}

View file

@ -79,6 +79,8 @@ static BOOL CALLBACK UninstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
static DWORD WINAPI install_thread(LPVOID p);
void NSISCALL CleanUp();
HWND insthwnd, insthwnd2, insthwndbutton;
HWND m_curwnd;
@ -630,6 +632,11 @@ skipPage:
SendMessage(m_curwnd, WM_COMMAND, wParam, lParam);
}
}
if (uMsg == WM_ENDSESSION && wParam)
{
// the session can end any time after we process this message so we better clean up now
CleanUp();
}
return HandleStaticBkColor();
}

View file

@ -16,9 +16,7 @@ extern char g_caption[NSIS_MAX_STRLEN*2];
extern HWND g_hwnd;
extern HANDLE g_hInstance;
extern HWND insthwnd,insthwndbutton;
extern HICON g_hIcon;
#else
#define g_hwnd 0
#define g_hInstance 0
#define g_hIcon 0
#endif//NSIS_CONFIG_VISIBLE_SUPPORT