This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: failing to remove the file with read-only attribute
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Oct 02, 2013
11:57 AM
failing to remove the file with read-only attribute
hi
my installer is failing to remove one file during uninstallation, which is having "read only" attribute.
Actually this file needs to be set as "read only" its attributes must be set as read only, so before packaging I am modifying its attributes to readonly using PERL scripts, and then building my Setup.exe. is it right way or do I need to set "Read-only" manually using installshield option : file properties-> Override system attributes-> selecting check box of "Read-only".
can someone please suggest me to fix "removing read-only file during uninstall"
my installer is failing to remove one file during uninstallation, which is having "read only" attribute.
Actually this file needs to be set as "read only" its attributes must be set as read only, so before packaging I am modifying its attributes to readonly using PERL scripts, and then building my Setup.exe. is it right way or do I need to set "Read-only" manually using installshield option : file properties-> Override system attributes-> selecting check box of "Read-only".
can someone please suggest me to fix "removing read-only file during uninstall"
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Oct 03, 2013
12:07 PM
I used below piece of code as work around and got it done.
if (GetFileInfo( szErrPropFilePath, FILE_ATTRIBUTE, nvResult, svResult )=0) then
if (nvResult = FILE_ATTR_NORMAL) then
//nothing
else
if (FILE_ATTR_READONLY & nvResult) then
if (SetFileInfo( szErrPropFilePath, FILE_ATTRIBUTE, FILE_ATTR_NORMAL, "" ) < 0) then
//failed
else
DeleteFile (szErrPropFilePath);
endif;
endif;
endif;
endif;
if (GetFileInfo( szErrPropFilePath, FILE_ATTRIBUTE, nvResult, svResult )=0) then
if (nvResult = FILE_ATTR_NORMAL) then
//nothing
else
if (FILE_ATTR_READONLY & nvResult) then
if (SetFileInfo( szErrPropFilePath, FILE_ATTRIBUTE, FILE_ATTR_NORMAL, "" ) < 0) then
//failed
else
DeleteFile (szErrPropFilePath);
endif;
endif;
endif;
endif;