fixed bug #1542530 - WriteUninstaller fails to overwrite read-only uninstallers
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4822 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
9f37ece536
commit
a92506d828
3 changed files with 12 additions and 4 deletions
|
@ -455,8 +455,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
// remove read only flag if overwrite mode is on
|
||||
if (!overwriteflag)
|
||||
{
|
||||
int attr=GetFileAttributes(buf0);
|
||||
SetFileAttributes(buf0,attr&(~FILE_ATTRIBUTE_READONLY));
|
||||
remove_ro_attr(buf0);
|
||||
}
|
||||
hOut=myOpenFile(buf0,GENERIC_WRITE,(overwriteflag==1)?CREATE_NEW:CREATE_ALWAYS);
|
||||
if (hOut == INVALID_HANDLE_VALUE)
|
||||
|
@ -1445,6 +1444,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
}
|
||||
validate_filename(buf1);
|
||||
|
||||
remove_ro_attr(buf1);
|
||||
hFile=myOpenFile(buf1,GENERIC_WRITE,CREATE_ALWAYS);
|
||||
if (hFile != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue