Skip to content

Conversation

@pjcollins
Copy link
Member

I was running into a couple of issues when building msi.csproj files
generated by the GenerateVisualStudioWorkload task:

C:\Program Files\dotnet\sdk\5.0.301\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error : Could not find a part of the path 'C:\Users\peter\source\yaml-templates\nuget-msi-convert\msbuild\obj\Debug\src\msiPackage\x86\Microsoft.Android.Sdk.Windows\obj\Debug\src\msiPackage\x86\Microsoft.Android.Sdk.Windows'.

C:\Program Files\dotnet\sdk\5.0.301\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5046: The icon file 'Icon.png' does not exist in the package.

The first error was a result of the following relative path being
included in the LICENSE.TXT item:

<None Include="obj\Debug\src\msiPackage\x86\Microsoft.Android.Sdk.Windows\LICENSE.TXT" Pack="true" PackagePath="\" />

Since LICENSE.TXT is created in the same directory as msi.proj, we
can exclude this relative path.

The second error appears to be a result of a missing Icon.png item,
which has been added.

The generated pack item content should now look like this:

<ItemGroup>
  <None Include="C:\Users\peter\source\yaml-templates\nuget-msi-convert\msbuild\bin\Microsoft.Android.Sdk.Windows.30.0.100-ci.main.61-x86.msi" Pack="true" PackagePath="\data" />
  <None Include="C:\Users\peter\source\yaml-templates\nuget-msi-convert\msbuild\bin\Microsoft.Android.Sdk.Windows.30.0.100-ci.main.61-x86.json" Pack="true" PackagePath="\data\msi.json" />
  <None Include="Icon.png" Pack="true" PackagePath="" />
  <None Include="LICENSE.TXT" Pack="true" PackagePath="\" />
</ItemGroup>

I was running into a couple of issues when building `msi.csproj` files
generated by the `GenerateVisualStudioWorkload` task:

    C:\Program Files\dotnet\sdk\5.0.301\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error : Could not find a part of the path 'C:\Users\peter\source\yaml-templates\nuget-msi-convert\msbuild\obj\Debug\src\msiPackage\x86\Microsoft.Android.Sdk.Windows\obj\Debug\src\msiPackage\x86\Microsoft.Android.Sdk.Windows'.

    C:\Program Files\dotnet\sdk\5.0.301\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5046: The icon file 'Icon.png' does not exist in the package.

The first error was a result of the following relative path being
included in the `LICENSE.TXT` item:

    <None Include="obj\Debug\src\msiPackage\x86\Microsoft.Android.Sdk.Windows\LICENSE.TXT" Pack="true" PackagePath="\" />

Since `LICENSE.TXT` is created in the same directory as `msi.proj`, we
can exclude this relative path.

The second error appears to be a result of a missing `Icon.png` item,
which has been added.

The generated pack item content should now look like this:

    <ItemGroup>
      <None Include="C:\Users\peter\source\yaml-templates\nuget-msi-convert\msbuild\bin\Microsoft.Android.Sdk.Windows.30.0.100-ci.main.61-x86.msi" Pack="true" PackagePath="\data" />
      <None Include="C:\Users\peter\source\yaml-templates\nuget-msi-convert\msbuild\bin\Microsoft.Android.Sdk.Windows.30.0.100-ci.main.61-x86.json" Pack="true" PackagePath="\data\msi.json" />
      <None Include="Icon.png" Pack="true" PackagePath="" />
      <None Include="LICENSE.TXT" Pack="true" PackagePath="\" />
    </ItemGroup>
@pjcollins pjcollins requested a review from joeloff June 30, 2021 21:00
@pjcollins pjcollins merged commit e865162 into dotnet:main Jul 1, 2021
@pjcollins pjcollins deleted the msi-gen-license branch July 1, 2021 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants