Program Files
Program Files是Microsoft Windows作業系統中標準資料夾的目錄名,通常安裝不屬於作業系統的應用程式。通常, 「Program Files」目錄下安裝的每個應用程式都會有一個用於儲存其特定應用程式資源的子目錄。共享資源(例如一個公司多個應用程式使用的資源)通常儲存在“Common Files”目錄中。
位置
[編輯]在標準Windows安裝中,「Program Files」目錄位於%SystemDrive%\Program Files(或其在地化等效檔案),而「Common Files」(或其在地化等效檔案)將是「Program Files」下的子目錄。在 Windows Vista 及更高版本中,「Program Files」和「Common Files」目錄的路徑未在磁碟上在地化(翻譯)。相反,在地化名稱是非在地化位置的NTFS符號連結。此外,Windows shell會根據系統的使用者介面語言來顯示Program Files資料夾名稱的在地化。
「Program Files」和「Common Files」都可以移動。在系統啟動時,「Program Files」和「Common Files」的實際路徑從Windows登錄檔載入,它們儲存在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion下的ProgramFilesDir和CommonFilesDir值中。然後,系統的其餘部分就可以通過揮發性環境變數%ProgramFiles%和%CommonProgramFiles%訪問它們。應用程式還可以通過使用dirids查詢Setup API、或通過Windows管理規範、或通過使用CSIDL或ShellSpecialFolderConstants查詢shell來取得這些路徑的位置。這些都是與在地化無關的方法。
Windows的x86-64和IA-64版本有兩個用於應用程式檔案的資料夾:Program Files資料夾作為64位元程式的預設安裝目標,而Program Files (x86)資料夾是需要WoW64仿真層的32位元程式的預設安裝目標。雖然64位元Windows版本也具有%ProgramFiles(x86)%環境變數,但32位元和64位元環境中的dirids和CSIDL沒有區別;API僅返回不同的結果,具體取決於呼叫處理程序是否被類比。 [1]
為了向下相容舊檔案分配表檔名的8.3限制,系統將名稱「Program Files 」、「Program Files (x86)」和「Common Program Files」縮短為progra~N和common~N ,其中N是一個數字,在全新安裝中該序列號為 1(當同時存在 「Program Files」和「Program Files (x86)」時,該序列號為 1 和 2)。
重新導向
[編輯]如果Windows安裝在NTFS卷上,預設情況下,「Program Files」資料夾只能由「管理員」使用者群組的成員修改。對於為Windows 9x建立的程式來說,這可能是一個問題。這些作業系統沒有檔案系統安全性,因此程式也可以將其資料儲存在「程式檔案」中。將資料儲存在「Program Files」中的程式通常無法在具有普通使用者權限的Windows NT系統上正確執行,除非降低受影響子目錄的安全性。
Windows Vista通過引入檔案和登錄檔虛擬化解決了這個問題。當為某個處理程序啟用此 UAC 虛擬化時,Windows 會將對「Program Files」資料夾的更改儲存到%LocalAppData%\VirtualStore\Program Files (x86)中。
歷史
[編輯]「Program Files」出現在Windows 95中。 「Common Files」出現在 Windows 98中。
某個未知版本的Windows NT使用「Common」而不是「Common Files」。 [2] Windows 2000似乎沒有表現出這種行為。 CSIDL文件提到「CSIDL_PROGRAM_FILES_COMMON」需要Shell32版本5.0(Windows 2000和ME),但表示它僅在Windows XP(6.0)上有效。 [3]
在地化
[編輯]| Windows語言 | 儲存程序檔案的 資料夾名稱 |
儲存共享程式檔案的 資料夾名稱 |
|---|---|---|
| 英語 | Program Files | Common Files |
| 阿拉伯語 | Program Files (ملفات البرامج (x86) for WoW64) | Common Files |
| 中文(簡體, 繁體, 台灣) | Program Files | Common Files |
| 捷克語 | Program Files | Common Files |
| 丹麥語 | Programmer | Fælles filer |
| 荷蘭語 | Program Files | Common Files |
| 芬蘭語 | Program Files | Common Files |
| 法語 | Programmes * | Fichiers communs |
| 德語 | Programme | Gemeinsame Dateien |
| 希伯來語 | Program Files | Common Files |
| Hellenic (Greek) | Αρχεία Εφαρμογών | Common Files |
| Hungarian | Programfájlok | Common Files |
| 義大利語 | Programmi | File comuni |
| 日語 | Program Files | Common Files |
| 韓語 | Program Files | Common Files |
| Norwegian | Programfiler | Fellesfiler |
| Polish | Program Files (Pliki programów (x86) for WoW64) | Common Files |
| 葡萄牙語 | Programas | Ficheiros comuns |
| 葡萄牙語 (巴西) | Arquivos de Programas | Arquivos comuns |
| Romanian | Program Files | Common Files |
| 俄語 | Program Files | Common Files |
| 西班牙語 | Archivos de programa | Archivos comunes |
| Swedish | Program | Delade filer |
| Turkish | Program Files (Program Dosyaları (x86) for WoW64) | Common Files |
| *在Windows Vista 及更高版本中。(在舊版本的 Microsoft Windows 中,資料夾名稱與英文名稱相同。) | ||
參見
[編輯]參考資料
[編輯]- ^ winapi - SHGetFolderPath() 32 bit vs 64 bit. Stack Overflow (英語).
- ^ Special Folders and Custom Folders. learn.microsoft.com. November 2012 (美國英語).
- ^ CSIDL (Shlobj.h) - Win32 apps. learn.microsoft.com. 22 March 2021 (美國英語).
CSIDL_PROGRAM_FILES_COMMON FOLDERID_ProgramFilesCommon Version 5.0. A folder for components that are shared across applications. A typical path is C:\Program Files\Common. Valid only for Windows XP.
延伸閱讀
[編輯]- Karp, David A.; O'Reilly, Tim; Mott, Troy. Windows XP in a nutshell 2nd. O'Reilly Media. 2005: 512. ISBN 978-0-5960-0900-7.
- Shilmover, Barry; Sjouwerman, Stu. Windows 2000 power toolkit 1st. Que Publishing. 2001. ISBN 978-0-7357-1061-0.