[英]WIX cannot find app.exe in x86/x64 output directory
我有一個C#應用程序,其構建目標是x86或x64。 構建輸出為(例如) ProjectDir/bin/x86|x64/Debug|Release/*
在我的*.wxs
文件中,我定義了以下變量
<?define AppTargetPath = "$(var.MyApp.TargetPath)" ?>
指向ProjectDir/bin/Debug|Release/app.exe
如果我生成安裝程序,則安裝失敗,因為它找不到我的應用程序exe
<File Id="AppExe" Source="$(var.AppTargetPath)" KeyPath="yes"/>
如果我在“ 使用項目引用和變量”站點( http://wixtoolset.org/documentation/manual/v3/votive/votive_project_references.html )上查找,則找不到其他變量。
也許試試這個:
嘗試以下標記(用您的標記替換項目名稱"TestConsoleApplication"
):
<Fragment> <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> <Component> <File Source="$(var.TestConsoleApplication.TargetPath)" /> </Component> </ComponentGroup> </Fragment>
鏈接:
實際上,我通過將整個路徑放在wxs文件頂部來解決了該問題:
<?define AppTargetFileName = "$(var.myApp.TargetFileName)" ?>
<?if $(var.Platform) = x64 ?>
<?define AppTargetPath = "$(var.myApp.ProjectDir)\bin\x64\$(var.myApp.Configuration)\$(var.AppTargetFileName)" ?>
<?elseif $(var.Platform) = x86 ?>
<?define AppTargetPath = "$(var.myApp.ProjectDir)\bin\x86\$(var.myApp.Configuration)\$(var.AppTargetFileName)" ?>
<?else ?>
<?define AppTargetPath = "$(var.myApp.TargetPath)" ?>
<?endif ?>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.