[wix-users] Bundle Signing Failing on invalid SignTargetPath

Coryat, Jim Jim.Coryat at softprocorp.com
Wed Mar 16 09:46:27 PDT 2022


Yes, thanks to Zac for suggesting the bin log, was able to identify that within the wixproj file it imports wix targets, due to the way the inherited imports works, it imports targets twice, which results in the following ItemGroup running twice.  Now the job of figuring out how to migrate an old 3.10 Wix settings etc. to current.  But compared to what I went through to find this, it's a much smaller lift.

  <ItemGroup>
    <SignTargetPath Include="$(TargetPath)" Condition=" '$(OutputType)' == 'Bundle' AND '$(SignOutput)' == 'true' AND '$(SuppressLayout)' != 'true' " />
  </ItemGroup>

Thank you for your help, helps having objective observations!

From: Edwin Castro <egcastr at gmail.com>
Sent: Wednesday, March 16, 2022 12:41 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Coryat, Jim <Jim.Coryat at softprocorp.com>
Subject: Re: [wix-users] Bundle Signing Failing on invalid SignTargetPath

IMPORTANT NOTICE - This message sourced from an external mail server outside of the Company.
My guess is the AssignCultures target may be involved.

    <!-- Set the sign target items, if we're signing output. -->
    <CreateItem
      Include="@(_TargetPathItems)"
      Condition=" '$(SignOutput)' == 'true' AND '$(SuppressLayout)' != 'true' ">
      <Output TaskParameter="Include"
              ItemName="SignTargetPath"/>
    </CreateItem>

I haven't checked to see if AssignCultures could possibly be invoked for a Bundle project.

Have you used msbuild -verbosity:diagnostic to build your project? That will provide way too much information but should help figure out how/when the Items are created.

--
Edwin G. Castro

On Tue, Mar 15, 2022 at 11:48 AM Coryat, Jim via wix-users <wix-users at lists.wixtoolset.org<mailto:wix-users at lists.wixtoolset.org>> wrote:
Pulling out what hair I have left on this one.

Setup a bundle to include dot net 4.8 and a wix installer msi that already existed.

After hunting around and reviewing the wix2010.targets file I deduced all I should have to do is add the <SignOutput>true</SignOutput> to the bundle wixproj file.  I did this and it invokes the targets necessary for signing, however what is happening is that the input parameter is getting a value of the path of the target bundle to sign, duplicated with a semi-colon separating them.  The property is SignTargetPath which looks like it gets explicitly set
Around line 305 in wix2010.targets file.

  <ItemGroup>
    <SignTargetPath Include="$(TargetPath)" Condition=" '$(OutputType)' == 'Bundle' AND '$(SignOutput)' == 'true' AND '$(SuppressLayout)' != 'true' " />
  </ItemGroup>

Walking backwards from this is where the value of TargetPath is set:

  <PropertyGroup>
    <!-- Example, c:\MyProjects\MySetup\bin\debug\ -->
    <!--
    Condition intentionally omitted on this one, because it causes problems
    when we pick up the value of an environment variable named TargetDir
    -->
    <TargetDir Condition="'$(OutDir)' != ''">$([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(OutDir)`))`))</TargetDir>
    <TargetPdbDir Condition=" '$(PdbOutputPath)'!='' ">$([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(PdbOutputPath)`))`))</TargetPdbDir>

    <!-- Example, C:\MyProjects\MySetup\bin\debug\MySetup.msi -->
    <TargetPath Condition=" '$(TargetPath)' == '' ">$(TargetDir)$(TargetFileName)</TargetPath>
    <TargetPdbPath Condition=" '$(TargetPdbPath)' == '' ">$(TargetPdbDir)$(TargetPdbName)</TargetPdbPath>
  </PropertyGroup>

I'm not seeing where the SignTargetPath is getting set this way. Here is the log snippet specifically for this:

Target "GetContainersToSign" in file "C:\dev\ExchangePlatform3\Sources\3rdParty\Wix\v3.14\Sdk\wix2010.targets" from project "C:\dev\ExchangePlatform3\Sources\Setup\SPX\ClientSetup\ClientBundle\ClientBundle.wixproj" (target "Signing" depends on it):
Building target "GetContainersToSign" completely.
Output file "obj\Debug\ClientBundle.wixproj.Signed.txt" does not exist.
Done building target "GetContainersToSign" in project "ClientBundle.wixproj".
Target "InternalSignContainers" skipped, due to false condition; ( '@(SignContainers)' != '' ) was evaluated as ( '' != '' ).
Target "PrepareForBuild" skipped. Previously built successfully.
Target "ResolveWixExtensionReferences" skipped. Previously built successfully.
Target "CompileAndLink" skipped. Previously built successfully.
Target "InternalSignContainers" skipped, due to false condition; ( '@(SignContainers)' != '' ) was evaluated as ( '' != '' ).
Target "InscribeBundleEngine" in file "C:\dev\ExchangePlatform3\Sources\3rdParty\Wix\v3.14\Sdk\wix2010.targets" from project "C:\dev\ExchangePlatform3\Sources\Setup\SPX\ClientSetup\ClientBundle\ClientBundle.wixproj" (target "Signing" depends on it):
Building target "InscribeBundleEngine" completely.
Output file "obj\Debug\ClientBundle.wixproj.Signed.txt" does not exist.
Using "Insignia" task from assembly "C:\dev\ExchangePlatform3\Sources\3rdParty\Wix\v3.14\Bin\WixTasks.dll".
Task "Insignia"
  Task Parameter:OutputFile=obj\Debug\SoftPro360Client.exe
C:\dev\ExchangePlatform3\Sources\3rdParty\Wix\v3.14\Sdk\wix2010.targets(2176,9): error MSB4094: "C:\dev\ExchangePlatform3\Layouts\Debug\SPX\AgentClient\SoftPro360Client.exe;C:\dev\ExchangePlatform3\Layouts\Debug\SPX\AgentClient\SoftPro360Client.exe" is an invalid value for the "BundleFile" parameter of the "Insignia" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem". [C:\dev\ExchangePlatform3\Sources\Setup\SPX\ClientSetup\ClientBundle\ClientBundle.wixproj]
Done executing task "Insignia" -- FAILED.
Done building target "InscribeBundleEngine" in project "ClientBundle.wixproj" -- FAILED.

________________________________
NOTICE: The information contained in this message is proprietary and/or confidential and may be privileged. If you are not the intended recipient of this communication, you are hereby notified to: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately.



____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.firegiant.com%2F&data=04%7C01%7CJim.Coryat%40softprocorp.com%7C825caf1a5631400f3bd608da076bc3ae%7C8a807b9b02da47f3a903791a42a2285c%7C0%7C0%7C637830456682335535%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=kk1NMbF41c%2BeD%2F99cD5NgyxmN3GUIDd5BgzN3m3Xews%3D&reserved=0>





More information about the wix-users mailing list