RMDir /REBOOTOK

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2390 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-03-29 11:45:22 +00:00
parent 5fbadb7e97
commit 68c97de740
4 changed files with 21 additions and 5 deletions

View file

@ -537,7 +537,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
if (lastchar(buf0)=='\\') trimslashtoend(buf0);
doRMDir(buf0,parm1);
if (file_exists(buf0)) g_flags.exec_error++;
if (file_exists(buf0) && parm1!=2) g_flags.exec_error++;
}
return 0;
#endif//NSIS_SUPPORT_RMDIR

View file

@ -73,11 +73,11 @@ void * NSISCALL my_GlobalAlloc(DWORD dwBytes) {
}
#ifdef NSIS_SUPPORT_RMDIR
void NSISCALL doRMDir(char *buf, int recurse)
void NSISCALL doRMDir(char *buf, int flags) // 1 - recurse, 2 - rebootok
{
if (is_valid_instpath(buf))
{
if (recurse) {
if (flags&1) {
SHFILEOPSTRUCT op;
op.hwnd=0;
@ -90,7 +90,17 @@ void NSISCALL doRMDir(char *buf, int recurse)
SHFileOperation(&op);
}
#ifdef NSIS_SUPPORT_MOVEONREBOOT
else if (!RemoveDirectory(buf) && flags&2) {
log_printf2("Remove folder on reboot: %s",buf);
#ifdef NSIS_SUPPORT_REBOOT
g_flags.exec_reboot++;
#endif
MoveFileOnReboot(buf,0);
}
#else
else RemoveDirectory(buf);
#endif
}
log_printf2("RMDir: RemoveDirectory(\"%s\")",buf);
update_status_text_from_lang(LANG_REMOVEDIR,buf);