wixtoolset / issues

WiX Toolset Issues Tracker
http://wixtoolset.org/
129 stars 24 forks source link

System.ArgumentNullException #7724

Open jhjacobs opened 1 year ago

jhjacobs commented 1 year ago

Which version of WiX are you building with? I created a project in Visual Studio 2019 called a Bundle (Wix v4) project. So the version is v4.

Which version of Visual Studio are you building with (if any)? Microsoft Visual Studio Professional 2019 Version 16.11.20 VisualStudio.16.Release/16.11.20+32929.386 Microsoft .NET Framework Version 4.8.09037

Installed Version: Professional

Wax Wax WiX Setup Editor

WiX Toolset Visual Studio Extension 1.0.0.22 WiX Toolset Visual Studio Extension version 1.0.0.22 Copyright (c) .NET Foundation and contributors. All rights reserved.

Which version of .NET are you building with? My solution consists of three projects. The three projects are a simple C# application, a wix3 msi builder, and the wix 4 bundle project. The C# project targets Dotnet Framework 4.8.1. The project properties of the two wix projects don't show a Dotnet framework target as far as I can tell.

I have attempted to build an installer which just bundles Dotnet Framework 4.81, and a simple test application.

I keep getting an error which says "wix.exe : error WIX0001: System.ArgumentNullException: Value cannot be null.' I was expecting to get an installation exe file that could be used to check for and install Dotnet Framework 4.8.1 if it isn't already installed, then install the msi package built with wix3.

See https://stackoverflow.com/questions/77091428/wix-installer-bundling-dotnet-framework-4-81-with-previously-built-msi

robmen commented 1 year ago

You have to be kidding me guys this text editor does not take XML.

Why are you complaining at us? It's the GitHub markdown editor. Either indent each line of your code with 4 spaces or use three ticks like:

 ```
<Code goes between those ticks/>
 ```

Learn more about how to put code in the editor via their documentation.

And why did you delete the bug template information? That helps us triage issues.

jhjacobs commented 1 year ago

Sorry robmen, a bit frustrated my bad. I'll try again.

I have attempted to build an installer which just bundles Dotnet Framework 4.81, and a simple test application.

I keep getting an error which says "wix.exe : error WIX0001: System.ArgumentNullException: Value cannot be null.'

I created a Bundle (Wix v4) project below is the Bundle.wxs file.

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
  <Bundle Name="TestBundleInstaller" Manufacturer="TODO Manufacturer" Version="1.0.0.0" UpgradeCode="d090a306-15fc-4e04-985e-83cbb3a2cf5f">
    <BootstrapperApplication>
      <bal:WixStandardBootstrapperApplication LicenseUrl="https://www.example.com/license" Theme="hyperlinkLicense" />
    </BootstrapperApplication>

    <Chain>
        <!-- TODO: Define the list of chained packages. -->
        <ExePackage DetectCondition="WIX_IS_NETFRAMEWORK_48_OR_LATER_INSTALLED" InstallArguments="/q" UninstallArguments="/q">
            <Payload SourceFile="DirectoryTo\NDP481-x86-x64-AllOS-ENU.exe"/>
        </ExePackage>
        <!-- <MsiPackage SourceFile="path\to\your.msi" /> -->
        <MsiPackage SourceFile="DirectoryTo\TestSetup.msi" />
    </Chain>

  </Bundle>
</Wix>

Below is the TestBundleInstaller.wixproj file.

<Project Sdk="WixToolset.Sdk/4.0.0">
  <PropertyGroup>
    <OutputType>Bundle</OutputType>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <OutputPath>bin\x64\Debug</OutputPath>
    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
  </PropertyGroup>
  <ItemGroup>
    <None Include="NDP481-x86-x64-AllOS-ENU.exe" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.0" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\TestSetup\TestSetup.wixproj" />
  </ItemGroup>
</Project>

Read many Wix tutorials and documentation, and I still don't understand the error I experience. Any help greatly appreciated.

Build output:

Build started...

1>------ Skipped Build: Project: Test, Configuration: Debug x64 ------

1>Project not selected to build for this solution configuration

2>------ Skipped Build: Project: TestSetup, Configuration: Debug x64 ------

2>Project not selected to build for this solution configuration

3>------ Build started: Project: TestBundleInstaller, Configuration: Debug x64 ------

Restored C:\Users\JJacobs\source\repos\TestBundleInstaller\TestBundleInstaller.wixproj (in 2 ms).

3>wix.exe : error WIX0001: System.ArgumentNullException: Value cannot be null.

3>Done building project "TestBundleInstaller.wixproj" -- FAILED.

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 2 skipped ==========

Hope it helps.

jhjacobs commented 1 year ago

Didn't intend to delete the template information.

BMurri commented 1 year ago

This is the section of the template that is intended you fill out and leave in place. @jhjacobs you can edit that first box at the top, past this template in there, and fill it out from the information you provided in this comment.

Bugs

If this issue is a bug:

(WiX version in major.minor.release.build format)

(Visual Studio version, including year and update)

(WiX Toolset Visual Studio Extension version in major.minor.release.build format)

(.NET version)

(Windows version)

(Be as specific as you can and err on the side of providing too much information, including code, error messages, command lines you used to invoke the build, and so forth.)

(Be as specific as you can and err on the side of providing too much information.)

jhjacobs commented 1 year ago

This code is a very simple test application. I would be happy to zip the entire solution and attach if it is helpful.

robmen commented 1 year ago

Additional code is not necessary in this case. The example provided is enough to reproduce the issue.

And please do learn from this experience to not vent your frustration at the people working on an OSS project you get for free. Oh, and fill out the templates provided because it helps them (us) more quickly evaluate the issues.

jhjacobs commented 1 year ago

robmen,

Will do and thanks to all for your effort.

robmen commented 1 year ago

Root issue: crash happens because ExePackage parsing failed to generate an Id when SourceFile and Name attributes are absent. An error message should have been displayed. The handling of remote payloads makes detecting this error scenario complex.

Work around: add SourceFile attribute to ExePackage.