第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

如何使用WiX將CustomActionData傳遞給CustomAction?

如何使用WiX將CustomActionData傳遞給CustomAction?

慕神8447489 2019-09-02 10:07:57
如何通過(guò)延遲自定義操作檢索CustomActionData上設(shè)置的屬性?
查看完整描述

3 回答

?
白豬掌柜的

TA貢獻(xiàn)1893條經(jīng)驗(yàn) 獲得超10個(gè)贊

延遲的自定義操作無(wú)法直接訪(fǎng)問(wèn)安裝程序?qū)傩裕ㄒ茫?。?shí)際上,只有CustomActionData財(cái)產(chǎn)


session.CustomActionData

以及此處列出的其他方法和屬性在會(huì)話(huà)對(duì)象上可用。


因此,對(duì)于檢索諸如之類(lèi)的屬性的延遲自定義操作INSTALLLOCATION,您必須使用類(lèi)型51自定義操作(即設(shè)置屬性自定義操作)來(lái)傳遞該信息,并且您將使用CustomAction的C#代碼中的數(shù)據(jù)通過(guò)session.CustomActionData。(見(jiàn)參考和參考)


下面是51類(lèi)自定義動(dòng)作(CustomAction1)的示例,它將設(shè)置可以在其中檢索的屬性CustomAction2。


<CustomAction Id="CustomAction1"

              Property="CustomAction2"

              Value="SomeCustomActionDataKey=[INSTALLLOCATION]"

/>

請(qǐng)注意,Property屬性名稱(chēng)是CustomAction2。這個(gè)很重要。類(lèi)型51操作的屬性屬性值必須與正在使用的自定義操作的名稱(chēng)相同/相同CustomActionData。(見(jiàn)參考)


注意名稱(chēng)SomeCustomActionDataKey的Value屬性鍵/值對(duì)?在使用自定義操作(CustomAction2)中的C#代碼中,您將CustomActionData使用以下表達(dá)式查找該屬性:


string somedata = session.CustomActionData["SomeCustomActionDataKey"];

用于從中檢索值的鍵CustomActionData不是Property類(lèi)型51自定義操作的屬性值,而是屬性中key=value對(duì)的鍵Value。(重要內(nèi)容:CustomActionData通過(guò)設(shè)置與消費(fèi)自定義操作的ID同名的安裝程序?qū)傩詠?lái)填充,但CustomActionData鍵不是安裝程序?qū)傩浴#ㄕ?qǐng)參閱參考資料)


在我們的場(chǎng)景中,消費(fèi)自定義操作是一個(gè)延遲的自定義操作,定義方式如下所示:


<Binary Id="SomeIdForYourBinary" SourceFile="SomePathToYourDll" />

<CustomAction Id="CustomAction2"

              BinaryKey="SomeIdForYourBinary"

              DllEntry="YourCustomActionMethodName"

              Execute="deferred"

              Return="check"

              HideTarget="no"

/>

配置InstallExecuteSequence


當(dāng)然,消費(fèi)自定義action(CustomAction2)必須在51自定義動(dòng)作(CustomAction1)之后運(yùn)行。所以你必須像這樣安排他們:


<InstallExecuteSequence>

  <!--Schedule the execution of the custom actions in the install sequence.-->

  <Custom Action="CustomAction1" Before="CustomAction2" />

  <Custom Action="CustomAction2" After="[SomeInstallerAction]" />      

</InstallExecuteSequence>


查看完整回答
反對(duì) 回復(fù) 2019-09-02
?
偶然的你

TA貢獻(xiàn)1841條經(jīng)驗(yàn) 獲得超3個(gè)贊

對(duì)于我們C ++ schlubs,您可以按如下方式檢索Property:


MsiGetProperty(hInstall, "CustomActionData", buf, &buflen);

然后你解析'buf'。謝謝Bondbhai。


查看完整回答
反對(duì) 回復(fù) 2019-09-02
  • 3 回答
  • 0 關(guān)注
  • 942 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)