ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Windows Vista
  • Overview
  • Programming tips
  • Location of the files handled by the application
  • Using the registry
  • Adapting an existing application to Windows Vista (and later)
  • Examples of functions affected by the management of user rights in Vista (and later)
  • Groups of functions that may be affected by the UAC mechanism
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
To increase security against worms and viruses, Windows Vista/7 implemented the UAC mechanism (User Account Control). By default, this mechanism considers that all users (including administrators) are standard users with limited rights. To run an application that requires additional rights, the UAC mechanism asks for confirmation.
This help page presents several programming tips for creating an application that requires no administrator privileges (no confirmation will be requested when it is run) and that complies with the programming standard of Windows Vista (and later).
Programming tips

Location of the files handled by the application

To create and modify a file without having administrator privileges:
  • do not write into the "Windows" directory.
  • do not write into the "Program Files" directory. However, the applications should be installed in this directory.
Consequences:
  • If an application must create or modify HFSQL data files, they must be located in the application directory (returned by SysDir and the srCommonAppData constant).
  • If an application must create or modify external files (.INI files, text files, ...), these files must be located in the directory corresponding to the application (returned by SysDir associated with the srCommonAppData constant). Be careful when using INIWrite and don't forget to specify all the parameters.
  • Stand-alone executables: If a stand-alone executable is installed in the "Program files" directory, the framework will not be copied into the directory. We recommend that you use a selft-extracting setup rather than a stand-alone executable.
Remark: If these operations are not performed, in 32-bit mode, the virtualization mechanism redirects the files toward a specific location, accessible by the user only (C:\Users\<LOGIN>AppData\Local\VirtualStore\Windows\ directory). The purpose of this redirection is to ensure the compatibility of the applications. For more details, see UAC mechanism.

Using the registry

To write into the registry without having the administrator privileges, you must not write into the "HKEY_LOCAL_MACHINE\SOFTWARE" key.
Remark: If the user does not have the necessary rights, the UAC mechanism performs a redirection to "HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE". The purpose of this redirection is to ensure the compatibility of the applications. The keys written in this directory can be read by the application that has written them. For more details, see UAC mechanism.
Adapting an existing application to Windows Vista (and later)
Your application is already used in Windows Vista/7 but you want this application to comply with the programming standard of Windows Vista/7?
If your application is a stand-alone application that uses data files, must modify the location of the data files in your application to respect the Vista/7 programming standards (see above paragraph).
Several cases may occur for the end users:
  • If the application was started in administrator mode (via a administrator manifest or a check box in the executable properties), the data files of the application are found in the directory specified in your application.
  • If the application was started in single-user mode, the directories used were automatically virtualized by Windows Vista/7 (if the user was not allowed access to these directories). The data files of the application are found in: C:\Users\<LOGIN>AppData\Local\VirtualStore\Windows\
Examples of functions affected by the management of user rights in Vista (and later)

Groups of functions that may be affected by the UAC mechanism

The following functions (or groups of functions) can be affected by the UAC mechanism (reminder: the UAC mechanism is enabled by default in Windows Vista/7):
This list is not an exhaustive list.
Minimum version required
  • Version 11
Comments
Click [Add] to post a comment

Last update: 09/06/2023

Send a report | Local help