簡體   English   中英

設置 INSTALLFOLDER 路徑的自定義操作

[英]Custom Action to set INSTALLFOLDER path

所以我創建了這個 customAction 讓我使用注冊表獲取另一個應用程序的路徑

string value = Registry.GetValue(userRoot, key, -1).ToString();
session["INSTALLLOCATION"] = value; 

它有效。 問題是我如何將它發送回.wxs 文件並將某些東西的安裝路徑設置為該字符串值。 我在 Wix 文件中有這個東西


    <CustomAction Id="CustomAction" Property="CustomAction2" Value="path=[INSTALLLOCATION]" />
    
    <Binary Id="CustomActionBinary" SourceFile="$(var.ProAdmin_TargetDir)ExtractRegistryPath\bin\Debug\ExtractRegistryPath.CA.dll"/>
    <CustomAction Id="CustomAction2" Impersonate="no" BinaryKey="CustomActionBinary" DllEntry="CustomAction1" Return="check" Execute="deferred"/>

<InstallUISequence>
      <Custom Action="CustomAction" Before="CustomAction2" />
      <Custom Action='CustomAction2' Before="ExecuteAction" />
    </InstallUISequence>

這個東西拋出2762錯誤代碼

您收到錯誤 2762,因為您不能在 InstallUISequence 中執行延遲操作。 填充 INSTALLLOCATION 屬性的自定義操作應在 InstallUISequence 和 InstallExecuteSequence 的開頭作為“立即”操作調用 - 並且 - INSTALLLOCATION 應該是目錄表中的文件夾。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM