msiConfigureFeatureA 函式 (msi.h)

MsiConfigureFeature函式會設定產品功能的已安裝狀態。

語法

UINT MsiConfigureFeatureA(
  [in] LPCSTR       szProduct,
  [in] LPCSTR       szFeature,
  [in] INSTALLSTATE eInstallState
);

參數

[in] szProduct

指定要設定之產品的產品代碼。

[in] szFeature

指定要設定之功能的功能識別碼。

[in] eInstallState

指定功能的安裝狀態。 此參數必須是下列其中一個值。

意義
INSTALLSTATE_ADVERTISED
此功能已公告
INSTALLSTATE_LOCAL
此功能會安裝在本機。
INSTALLSTATE_ABSENT
此功能已卸載。
INSTALLSTATE_SOURCE
此功能會安裝為從來源執行。
INSTALLSTATE_DEFAULT
此功能會安裝至其預設位置。

傳回值

意義
ERROR_INVALID_PARAMETER
不正確參數會傳遞至 函式。
ERROR_SUCCESS
函式成功。
與動作相關的錯誤
如需詳細資訊,請參閱 錯誤碼
初始化錯誤
發生與初始化相關的錯誤。

備註

注意

msi.h 標頭會將 MsiConfigureFeature 定義為別名,根據 UNICODE 預處理器常數的定義,自動選取此函式的 ANSI 或 Unicode 版本。 混合使用編碼中性別名與非編碼中性的程式碼,可能會導致編譯或執行時間錯誤不符。 如需詳細資訊,請參閱 函式原型的慣例

需求

   
最低支援的用戶端 Windows Server 2012、Windows 8、Windows Server 2008 R2 或 Windows 7 上的 Windows Installer 5.0。 Windows Server 2008 或 Windows Vista 上的 Windows Installer 4.0 或 Windows Installer 4.5。 Windows Server 2003 或 Windows XP 上的 Windows Installer。 如需 Windows Installer 版本所需的最低 Windows Service Pack 相關資訊,請參閱 Windows Installer Run-Time 需求。
目標平台 Windows
標頭 msi.h
程式庫 Msi.lib
Dll Msi.dll

另請參閱

顯示的錯誤訊息

錯誤碼

初始化錯誤

安裝和設定函式

多套件安裝