>>>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?
That is in native VFP; no extra .DLLs (the API call uses .DLLs already present on the target system, and the .EXE should be tiny, since you don't need a complex UI or classes.)
There's no provision in Setup Wizard to flag files AFAIK; you could build an .EXE in C to do it that might be smaller. There is a programming language behind the Setup Wizard, but MS has not been terribly forthcoming about documenting its use and capabilities; I've learned enough to hack the .STF for a few things, but I rely on other installers like InstallShield to do most of the work other than putting the runtime in place, and don't consider floppy distribution to be an alternative for my applications at this point - either I distribute on CD, or provide a Web-based install. In both cases the size of a floppy isn't an issue or consideration, and aside from putting the VFP runtime in place (at times, I also put some ODBC components in with it as well) I don't expect the Setup Wizard to do much for me - I fire it silently, and put all the real install logic elsewhere, using tools that are more capable of doing what I feel is needed in my installation process.