Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setup Wiz and ReadOnly files.
Message
From
19/01/1999 20:16:26
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00177503
Message ID:
00177848
Views:
34
>>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?
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform