0

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, &apos; &apos;)'
          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, &apos; &apos;)'
              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!

5
  • I also tried adding the "DependsOnTarget" flag in the BuildBundle Target, but that did not help.
    – Temeos
    Commented Jun 28 at 13:44
  • Why not use a couple of .wixprojs? One for the package and the other for the bundle? HeatWave can make it easy to get things set up for you and help create the necessary PackageReferences. You're recreating what .wixprojs do for you. Commented Jun 28 at 17:00
  • Thank you for the answer! I do have two separate projects. And I am trying to build them separately while the bundle project includes my package project.
    – Temeos
    Commented Jun 29 at 18:50
  • @RobMensching did i maybe missunderstand something regarding the .wixproj? I know that i can reference my package in my bundle in the BundleProject.wixproj, but i want to build everthing using my build script, not the IDE. I actually tried adding the reference in my bundle project, but that did not help and my package still got overwritten and did not have all the functionality that is implemented and present when i build it on its own.
    – Temeos
    Commented Jul 10 at 13:27
  • I don't know what the IDE has to do with it. msbuild.exe builds projects from the command-line. After that, would need to debug what is going on with your actual project. Commented Jul 10 at 17:36

1 Answer 1

0

I apparently just had to switch from WixStandardBootstrapperApplication to WixInternalUIBootstrapperApplication. Now it shows the internal UI of my MSI package. It still uses the version number of the bundle when the msi package is installed, not the version specified in my msi package, but it does have all the functionality it is supposed to.

Not the answer you're looking for? Browse other questions tagged or ask your own question.