My app needs to install some files that can be edited by the application at run time. Install shield provides an alias [CommonAppDataFolder] that will resolve to c:\programData on Vista and Windows 7 and will also work on Windows XP. Is there a win32 function that will return a similar path?
Maybe I need to call different functions depending on the operating system?
SHGetFolderPath/SHGetSpecialFolderPathget you that, withCSIDL_COMMON_APPDATAargument.See code snippet here (at the bottom): How to write a Windows XP Application that stores user and application data in the correct location by using Visual C++ ; the original link is no longer valid – code snippet is pulled below):
See also: CSIDL.