我的解决方案是使用平台设置"Any CPU"构建的.对于我的WiX 3.6安装程序项目设置,似乎我无法将目标平台设置为"x64"; 只有"x86"可用.可以针对x64构建WiX项目吗?
Dav*_*tin 35
Windows安装程序无法构建为针对任何CPU,我通常构建两次,托管代码设置为任何CPU,而安装程序有两个配置x86和x64.
您可能会发现需要创建配置,这可以通过右键单击解决方案并选择配置管理器然后选择平台下的下拉菜单来完成.完成后,您应该能够看到wixproj中定义的以下内容:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DefineConstants>Debug</DefineConstants>
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)
允许安装程序使用x86和x64定义变量来检测和设置安装的体系结构.
<?if $(var.Platform) = x64 ?>
<?define bitness = "(64 bit)" ?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define bitness = "(32 bit)" ?>
<?define Win64 = "no" ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>
Run Code Online (Sandbox Code Playgroud)
我将bitness变量附加到名称作为视觉线索:
<Product Name="My Install $(var.bitness)"
Run Code Online (Sandbox Code Playgroud)
请参阅Program Files文件夹:
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.PlatformProgramFilesFolder)">
Run Code Online (Sandbox Code Playgroud)
组件适当地设置Win64标志:
<Component Win64="$(var.Win64)"
Run Code Online (Sandbox Code Playgroud)