所有 Feature 均部署於 12\Template\Features 目錄下,每個 Feature 佔用一個獨立子資料夾,資料夾根目錄必須包含 Feature.xml 定義檔。
透過 Windows 檔案總管建立的資料夾不會繼承權限,導致 Feature 部署後在部分 WSS 頁面(如網站設定、列表檢視)出現異常。解決方式:
md 建立資料夾(自動繼承權限)。使用 stsadm 指令安裝 Feature:
stsadm –o installfeature –filename <Feature.xml 相對於 12\TEMPLATE\FEATURES 的路徑>
安裝 WSS v3 / MOSS 2007 時,所有預設 Feature 已自動安裝完成。
安裝後必須啟動才能使用(場範圍 Feature 除外,會自動啟動)。啟動指令:
stsadm –o activatefeature –name <FEATURES 目錄下包含 Feature.xml 的資料夾名稱> -url https://Server/Site/Subsite
使用 deactivatefeature 操作停用 Feature,使其在原範圍內變為未啟動狀態:
stsadm.exe -o deactivatefeature
{-filename <Feature.xml 相對路徑> |
-name <FEATURES 目錄下的資料夾名稱> |
-id <Feature GUID>}
[-url <URL>]
[-force]
解除安裝前必須先停用 Feature(場或 Web 應用程式範圍除外)。解除安裝指令:
stsadm.exe -o uninstallfeature
{-filename <Feature.xml 相對路徑> |
-name <FEATURES 目錄下的資料夾名稱> |
-id <Feature GUID>}
[-force]
執行完成後,重新啟動 IIS 使變更生效,隨後可手動刪除 Features 目錄下對應的資料夾。
installfeatureactivatefeaturedeactivatefeature(解除安裝前必要步驟)uninstallfeature