2013-08-20 17 views

回答

2

由於您提到了自定義操作,請參閱Specifying the Signature for a Managed Method in an Assembly Custom Action。指定需要傳遞給函數中參數的值或存儲值的屬性。請注意,如果這是延遲的自定義操作,則需要按第3段「將自定義方法簽名用於延遲,提交或回滾自定義操作」中所述,通過CustomActionData傳遞它們。

+0

+1執行的InstallShield的方式來做到這一點。 –

2

Windows安裝程序XML(WiX)部署工具基礎(DTF)爲編寫Windows Installer的託管代碼自定義操作提供了一個框架。編譯後的DLL顯示爲帶有1類導出函數的標準Win32 DLL,並且與InstallShield完全兼容。

如果它是一個immeadiate自定義操作,你只需說:

串someProperty =會議[ 「SOMEPROPERTY」];

如果是延遲自定義操作,則使用立即自定義操作構建CustomActionData類,然後將其序列化爲字符串以傳遞給延遲自定義操作,然後將其反序列化回CustomActionData類。 (基本上是一個propery/value字典)。

所需的背景讀數:

Installation Phases and In-Script Execution Options for Custom Actions in Windows Installer

Reasons DTF is Better

相關問題