我使用WiX安裝程序爲我的C#應用程序創建了一個安裝程序。無法使用WiX安裝程序進行設置
我使用類CustomAction安裝SQL數據庫並將權限設置爲文件夾。
有我的課:
public class CustomActions
{
[CustomAction]
public static ActionResult AllowAppData(Session session){...}
[CustomAction]
public static ActionResult Install_SetupDataBase(Session session){...}
}
而且product.wxs:
<Binary Id="CASetup.dll" SourceFile="$(var.SetupCustomAction.TargetDir)$(var.SetupCustomAction.TargetName).CA.dll" />
<CustomAction Id="CustomActionSetupAllow" BinaryKey="CASetup.dll" DllEntry="AllowAppData" Execute="immediate" />
<CustomAction Id="CustomActionSetupBase" BinaryKey="CASetup.dll" DllEntry="Install_SetupDataBase" Execute="immediate" />
<InstallExecuteSequence>
<Custom Action='CustomActionSetupAllow' After='InstallFinalize' />
<Custom Action='CustomActionSetupBase' After='InstallFinalize' />
</InstallExecuteSequence>
構建是好的,但是當安裝完成我的消息:
我試過只有CustomActionSetupAllow
它的作品fin即但與CustomActionSetupBase
我收到了消息。
我怎麼知道DLL丟失了?我應該在哪裏添加參考?
我已將自定義操作標記爲'After ='InstallFinalize''。這兩個自定義操作都在同一個文件中。當我只調用'CustomActionSetupAllow'時它很好用,但只有'CustomActionSetupBase'有錯誤。我在第一行插入了一個斷點,它不會中斷。潛在缺少DLL是在安裝項目還是在自定義操作項目中? –
該死的我很愚蠢......我沒有看到我在CustomActionSetupBase之前移除了標誌'[CustomAction]'。我爲這個錯誤浪費了很多時間。但很高興知道,如果該標誌不存在,則可能發生此錯誤。謝謝你的幫助 –