Using fDataDirUser and fDataDirCommon

Warning about using fDataDirUser() and fDataDirCommon()
 
Overview: PC Soft warns you in the help description of commands fDataDirUser() and of fDataDirCommon() about the differences in paths on test time and execution time! You should take this warning seriously because it will greatly affect your application.
 
quoting Help for fDataDirUser()
in test mode: <Home Directory of User>\<Application Data>\WinDev Applications\<Project Name>
at run time: <Home Directory of User>\<Application Data>\<Company Name>\<Executable Name>
 
 
So, of course, there must be differences between running the simulation and the executable! Remember the Windows standard directories for placing data: from Windows Vista / Windows 2003 server onwards it is a big no-no to put data into the directory of the program (though this is the default data directory for WinDev projects while testing them!). The \programs (x86) directory is read-only - except for installation of programs. For those who believe that their data is in a database system anyway: please, be aware that you will not even be able to put an INI-file into the directory of your program when it is installed into the standard directory for programs. Btw, for any program installations, remember that the standard directory is \programs (x86)\YourCompanyName\YourApplicationName (take care when deploying)!!!
For more details, see: http://en.wikipedia.org/wiki/Special_Folders
 
Similar rules were given for directories containing program data in a MS-Windows environment! Data for the current user should be either in
\Users\UserName\Local\CompanyName/ApplicationName     or in
\Users\UserName\Roaming\CompanyName\ApplicationName    or in
\ProgramData\CompanyName\ApplicationName
 
As you will realize quickly: a WinDev project has a project name, which *eventually* will become the application’s name, but in WinDev there’s no company name to be defined in the project description. However, when making the executable, the WinDev wizard will show an identification screen where there is a ‘Company name:’ to be found. The fDataDir..() commands will take the name from there to build the directory string for the executable, which is definitely missing when running the ‘GO’-simulation!
 
Therefore, if you want to access the same data while testing from the WinDev editor (‘GO’) and from the executable, for the sake of consistency it is strongly recommended, NOT to use any WinDev-commands that refer to a subdirectory on the computer which - by standard - should be built using the combination of \CompanyName\ApplicationName ! Use two variables in your program instead. One that defines the ‘company name’ and another one that defines the ‘application name’ and build the necessary subdirectory structure on your own. Use the WinDev SysDir() command in order to retrieve Windows-directories.
 
 
[Home] [English] [WX Links] [Deutsch] [Impressum] [Downloads] [RADTranslate] [Upper] [NullValues] [TableOnStructure] [HFClassicHFSQL] [RAD11] [USBFind] [Color Contrast] [Dec. Separator] [Setup Problems] [Directories] [Help Authoring] [Access CHM] [Make GUID] [HOpen Files] [Reset Table] [Int. Gen. Number] [TAB-Control] [RAD11] [fDataDir.. commands] [Calendar Weeks] [Input & check EAN 8/13] [Test_for_Dups] [Feiertage] [MemStick as Dongle] [Get Date & Time] [German phone book] [MDI Behaviour] [WD 5.5: CHM-Help] [WD16: CHM-Help] [Calendar + Memo 1] [Install WD5.5 on Win7] [WD5.5 app on WD7*64] [HListFile] [ZIP-functions] [7-zip CLI] [HFCS + 7-zip] [HFSQL C/S on Linux]