Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setup Wiz and ReadOnly files.
Message
De
19/01/1999 05:47:33
 
 
À
19/01/1999 04:56:58
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00177503
Message ID:
00177508
Vues:
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.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform