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:
parent
547b40d6b5
commit
de15ecd44b
3 changed files with 32 additions and 12 deletions
|
@ -49,6 +49,8 @@ HWND g_hwnd;
|
||||||
HANDLE g_hInstance;
|
HANDLE g_hInstance;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void NSISCALL CleanUp();
|
||||||
|
|
||||||
char *ValidateTempDir()
|
char *ValidateTempDir()
|
||||||
{
|
{
|
||||||
validate_filename(state_temp_dir);
|
validate_filename(state_temp_dir);
|
||||||
|
@ -230,21 +232,34 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
||||||
#endif//NSIS_CONFIG_LOG
|
#endif//NSIS_CONFIG_LOG
|
||||||
end:
|
end:
|
||||||
|
|
||||||
if (g_db_hFile != INVALID_HANDLE_VALUE) CloseHandle(g_db_hFile);
|
CleanUp();
|
||||||
#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));
|
|
||||||
|
|
||||||
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
|
if (m_Err)
|
||||||
// Clean up after plug-ins
|
my_MessageBox(m_Err, MB_OK | MB_ICONSTOP | (IDOK << 20));
|
||||||
if (state_plugins_dir[0]) doRMDir(state_plugins_dir, 1);
|
|
||||||
#endif // NSIS_CONFIG_PLUGIN_SUPPORT
|
|
||||||
if (g_hIcon) DeleteObject(g_hIcon);
|
|
||||||
|
|
||||||
#if defined(NSIS_SUPPORT_ACTIVEXREG) || defined(NSIS_SUPPORT_CREATESHORTCUT)
|
#if defined(NSIS_SUPPORT_ACTIVEXREG) || defined(NSIS_SUPPORT_CREATESHORTCUT)
|
||||||
OleUninitialize();
|
OleUninitialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ExitProcess(ret);
|
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
|
||||||
}
|
}
|
|
@ -79,6 +79,8 @@ static BOOL CALLBACK UninstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||||
|
|
||||||
static DWORD WINAPI install_thread(LPVOID p);
|
static DWORD WINAPI install_thread(LPVOID p);
|
||||||
|
|
||||||
|
void NSISCALL CleanUp();
|
||||||
|
|
||||||
HWND insthwnd, insthwnd2, insthwndbutton;
|
HWND insthwnd, insthwnd2, insthwndbutton;
|
||||||
|
|
||||||
HWND m_curwnd;
|
HWND m_curwnd;
|
||||||
|
@ -630,6 +632,11 @@ skipPage:
|
||||||
SendMessage(m_curwnd, WM_COMMAND, wParam, lParam);
|
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();
|
return HandleStaticBkColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,7 @@ extern char g_caption[NSIS_MAX_STRLEN*2];
|
||||||
extern HWND g_hwnd;
|
extern HWND g_hwnd;
|
||||||
extern HANDLE g_hInstance;
|
extern HANDLE g_hInstance;
|
||||||
extern HWND insthwnd,insthwndbutton;
|
extern HWND insthwnd,insthwndbutton;
|
||||||
extern HICON g_hIcon;
|
|
||||||
#else
|
#else
|
||||||
#define g_hwnd 0
|
#define g_hwnd 0
|
||||||
#define g_hInstance 0
|
#define g_hInstance 0
|
||||||
#define g_hIcon 0
|
|
||||||
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
|
#endif//NSIS_CONFIG_VISIBLE_SUPPORT
|
Loading…
Add table
Add a link
Reference in a new issue