>>I am using the VFP 5 setup wizard.
>>
>>I need certain files to be installed as ReadOnly files.
>>
>>I have tried setting the read-only attribute on the files in the distribution tree directories, before running the wizard. When the files are installed, they are no longer read-only.
>>
>>I guess I could run some sort of PostSetup executable, but I only have 5k free on my last setup disk and I don't want to add too many more files.
>
>You could easily write a post-setup executable in VFP, and use that to make the files read-only. You'd need to use an API call (SetFileAttributes()) to mark the files read-only. There's an example of using SetFileAttributes() in the FAQ here on UT; the following will set a file to read-only:
>
>
DECLARE INTEGER SetFileAttributes IN WIN32API ;
> STRING lpFileName, ;
> INTEGER nAttributeMask
>
>cFileName = 'C:\MyPath\MyFileToBeMadeReadOnly'
>IF SetFileAttributes(cFileName,1) = 1
> * it worked
>ELSE
> * it didn't
>ENDIF
>
>See WINNT.H in Visual C/C++'s INCLUDE files for the full set of values for attribute masks.
Thanks Ed,
But, as I said, I really don't want to add any more K's to my distribution. Any other ideas in native VFP, or ways to get the Setup wiz to do its job properly?