標籤:
最近一直在糾結軟體中使用者配置資訊以及資料庫存放位置問題,winxp系統以前不存在UAC重新導向問題,但是自從Win7系統以後就發現沒有管理員權限時,安裝在系統硬碟中的軟體配置資訊若需要讀寫操作時,系統會自動將這些設定檔和資料庫重新導向到目前使用者的AppData\Local\VirtualStore目錄中,雖然避免了系統報錯問題,但是對於軟體調試以及使用者設定檔的修改造成了困擾。
以下是微軟官方給出的AppData的定義(雖然顯示的為win8系統,但是個人認為對win7和win10都通用):
Applies to Windows 8.1, Windows RT 8.1
The AppData folder contains app settings, files, and data specific to the apps on your PC. The folder is hidden by default in File Explorer, and has three hidden sub-folders: Local, LocalLow, and Roaming.
- Roaming. This folder (%appdata%) contains data that can move with your user profile from PC to PC—like when you’re on a domain—because this data has the ability to sync with a server. For example, if you sign in to a different PC on a domain, your web browser favorites or bookmarks will be available.
- Local. This folder (%localappdata%) contains data that can‘t move with your user profile. This data is typically specific to a PC or too large to sync with a server. For example, web browsers usually store their temporary files here.
- LocalLow. This folder (%appdata%/…/locallow) contains data that can‘t move, but also has a lower level of access. For example, if you‘re running a web browser in a protected or safe mode, the app will only be able access data from the LocalLow folder.
The apps themselves choose whether to save to the Local, LocalLow, or Roaming folders. Most desktop apps use the Roaming folder by default, while most Windows Store apps use the Local folder by default.
Warning
- We don‘t recommend moving, deleting, or making any changes to files or folders in the AppData folder. Doing so could make your apps run poorly or stop working entirely.
大部分案頭app程式都使用AppData\Roaming檔案夾作為使用者設定檔的儲存位置,但是使用者資料庫若也儲存在這個地方對於使用者來說很不方便,檔案夾為隱藏檔案夾且不容易尋找。我的解決方案是使用者配置以及資料庫檔案預設路徑為Romation檔案夾,但是資料庫檔案夾路徑是開放給使用者的,使用者可以自訂資料庫存放位置,這樣方便以後使用者資料的備份以及恢複。
What is the AppData folder?