0
votes

Going from this answer https://stackoverflow.com/a/15985524/552448

<Wix>
    <Bundle...>
        <BootstrapperApplicationRef Id='WixStandardBootstrapperApplication.HyperlinkLicense' />

        <Chain>
            <MsiPackage SourceFile="prereq1.msi" />
            ....
            <MsiPackage InstallCondition='NOT VersionNT64' SourceFile='path\to\x86.msi' />
            <MsiPackage InstallCondition='VersionNT64' SourceFile='path\to\x64.msi' />
        </Chain>
    </Bundle>
</Wix>

All the projects in my solution target "Any CPU", with the exception of the bootstrapper and the MSI package, thus I'm using a shared cabinet to avoid doubling the final size of the bootstrapper.

I know I have to build the MSI with x86, then with x64 and finally build the bootstrapper. Did this manually and it works.

However, I'd like to automate these steps.

I've been trying to add a Prebuild event to the Bundle wixproj file, something along the lines of

$(MSBuildBinPath)\msbuild "$(SolutionDir)MyMSI\MyMSI.wixproj" /p:Platform=x86;Configuration=Release
$(MSBuildBinPath)\msbuild "$(SolutionDir)MyMSI\MyMSI.wixproj" /p:Platform=x64;Configuration=Release

However, this fails with this error:

The OutputPath property is not set for project 'MyLibrary.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Release' Platform='x86'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.

I'd like to make it work without having to go through all the projects in order to add the combination of platform/configuration. After all, this works if I right click MyMSI and choose build.

Surely I must be missing something.

1

1 Answers

0
votes

It was pretty obvious - create two separate MSI projects - one with x86, the other with x64, both using the same files.