A new Flexera Community experience is coming on November 25th, click here for more information.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setting file attributes to read only

Hello folks. My repackaged msi needs to copy an ini file to the C:\Winnt folder and then set it to Read Only. I found the file in the components view and set it to read only. Now my setup fails with an error 1913. I looked it up on MSDN, and it has reference to an article published by MS, it mentions that Windows Installer has problems copying/modifying ini files to a UNC path. It's not the case here. I could create a custom action and lunch batch file with Attrib +R , but i am trying to get it working with the msi if possible.

Thanks
(2) Replies
[Follow-up here...]
This is what i did. My developer asked me to replace the old ini file with the new one. So i removed the old ini file from the project and inserted the new ini file. When i would install my app, the ini file would still contain settings from the old ini file. I was like what in the world ???. Then i started going through the Developer and click on the Ini section. There i saw that Developer was actually creating the ini file instead of simply copying my new ini file. That help me figure out why i was getting that error message while trying to set read only permissions. It would copy the ini file, then set it to read only and then i was trying to write to it...that's when it bombed out. So what i did..i simply went to INI section in Developer and removed everything that had to do with that INI file. So now my install simply copies the ini file and then sets it to read only. I know that if somebody goes and modifies the file, it will not self heal ...but it's hidden deep down that my users would never think of it. I guess i am still learning how the msi engine works :o)