Overview:
I am making an installer for a web app build on asp.net 8. I started with just doing an msi installer (Package) with a custom UI. I then wanted to also include the installers for the dotnet runtime and server hosting and quickly learned, that i cannot run other installers during my installation. So i made a additional project to make a bundle. This bundle now has the executables for the dotnet stuff and my own msi included in its chain.
The Problem:
I am building my web app package using a build script that i run with msbuild.
msbuild -p:PackageVersion=1.0.0;ProductCode={GUID Here} -t:BuildPackage;BuildBundle setup.build
I am doing it like this to automate the process of updating the installer when changes are made to the source code. I have other targets in setup.build, but they are irrelevant for my problem.
This is what the Targets look like.
<Target Name="BuildPackage">
<!-- At last create an installer -->
<Message Text="TEST: @(WixCode)"/>
<Exec
Command='wix build -ext WixToolset.Iis.wixext -ext WixToolset.Netfx.wixext -ext WixToolset.Util.wixext -ext WixToolset.UI.wixext -d publishDir=$(Publish) -d Version=$(PackageVersion) -d ProductCode=$(ProductCode) -d MyWebResourceDir=. -o $(MsiOut) @(WixCode, ' ')'
ContinueOnError="false"
WorkingDirectory="." />
<!-- A message at the end -->
<Message Text="Install package has been created." />
</Target>
<Target Name="BuildBundle">
<Exec
Command='wix build -ext WixToolset.Util.wixext -ext WixToolset.BootstrapperApplications.wixext -d BundleVersion=$(BundleVersion) -d MyWebResourceDir=. -o $(BundleOut) @(BundleCode, ' ')'
ContinueOnError="false"
WorkingDirectory="." />
</Target>
Now, when i run this, the resulting Bundle.exe includes an msi installer that is not the one made with BuildPackage. When i run Bundle.exe it installs something, but it does not display my UI and when i check in my installed apps, i see my package but with the version number of the bundle not the package version. So i assume that when i build the bundle, it builds my package differently and adds it to the bundle, instead of the package that i specify.
This is the package group that i added in my bundle:
<Fragment>
<PackageGroup Id="MainPackages">
<PackageGroupRef Id="PrereqPackages" />
<MsiPackage Id="WebApp" DisplayName="Installing Web App" SourceFile="path\to\App_Installer.msi" />
</PackageGroup>
</Fragment>
In my IDE i have excluded my package from the build in the configuration manager, so in theory it should be isolated from the build process of my solution. Although i don't build it in the first place, i wanted to mention it.
The Question:
I don't know how to prevent this and in generall have trouble understanding why it works like this.
I would appreciate any help and in the best case i would very much appreciate if anyone can explain to what goes on under the hood.
Thank you in Advance!