This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 253970

Summary: Cleaner process cannot handle files with read-only attrib set (Windows)
Product: installer Reporter: phansson
Component: NBIAssignee: Libor Fischmeistr <lfischmeistr>
Status: REOPENED ---    
Severity: normal CC: markiewb
Priority: P3 Keywords: PATCH_AVAILABLE
Version: 8.0.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: Patch

Description phansson 2015-07-30 07:52:54 UTC
Created attachment 155035 [details]
Patch

Currently the cleaner process on Windows cannot delete files that has the read-only attribute set. 

The main problem being that the Win32 DeleteFileW() function expects read-only attribs on a file to have been removed beforehand. The current cleaner.exe does not handle this.

I've created a small patch to fix this. It is just 2 lines of code.

It does the following: If the read-only attribute is set then remove it.

I've checked if the same problem exists in the cleaner for Unices (cleaner.sh) but that doesn't seem to be case as that script uses "rm -f" when attempting to delete a file. In other words: It is only the Windows version which has this problem.
Comment 2 Libor Fischmeistr 2015-07-30 14:30:58 UTC
(In reply to Libor Fischmeistr from comment #1)
> Fixed:
> 
> http://hg.netbeans.org/core-main/rev/9fda12a36ae9
> http://hg.netbeans.org/releases/rev/8c0614143f8e

Sorry, wrong issue.