Change the ACL on our %temp% directories (bug #1125)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6657 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2015-12-07 20:49:46 +00:00
parent 0cac95475e
commit d7d6c3561d
7 changed files with 63 additions and 16 deletions

View file

@ -74,7 +74,7 @@ TCHAR *ValidateTempDir()
if (!validpathspec(state_temp_dir))
return NULL;
addtrailingslash(state_temp_dir);
CreateDirectory(state_temp_dir, NULL);
CreateNormalDirectory(state_temp_dir);
// state_language is used as a temp var here
return my_GetTempFileName(state_language, state_temp_dir);
}
@ -273,16 +273,18 @@ EXTERN_C void NSISWinMainNOCRT()
}
else
{
int x;
int x, admin = UserIsAdminGrpMember();
mystrcat(state_temp_dir,_T("~nsu.tmp"));
mystrcat(state_temp_dir,_T("~nsu"));
if (admin) mystrcat(state_temp_dir,_T("A")); // Don't lock down the directory used by non-admins
mystrcat(state_temp_dir,_T(".tmp"));
// check if already running from uninstaller temp dir
// this prevents recursive uninstaller calls
if (!lstrcmpi(state_temp_dir,state_exe_directory))
goto end;
CreateDirectory(state_temp_dir,NULL);
admin ? CreateRestrictedDirectory(state_temp_dir) : CreateNormalDirectory(state_temp_dir);
SetCurrentDirectory(state_temp_dir);
if (!(*state_install_directory))