wixtoolset / issues

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

wix extension list always reports extensions as (damaged) #7084

Closed robmen closed 1 year ago

robmen commented 1 year ago

Encountered at: https://github.com/wixtoolset/wix4/commit/97c33e99

Detail:

wix extension list is not reporting the state of extensions properly.

crazydef commented 7 months ago

Are you sure this is fixed? I've just installed Wix for the first time, installed a single extension (Heat) and Wix claims it's damaged:

dotnet tool install --global wix
wix

WiX Toolset Core version 4.0.4+a85929822f9932fcb938a8f260555e2476040298 Copyright (c) .NET Foundation and contributors. All rights reserved. ...

wix extension add WixToolset.Heat
wix extension list

WixToolset.Heat 4.0.4 (damaged)

deeplow commented 6 months ago

I am running into this issue, but I think it's because of something else. @crazydef I filed an issue about it. Please confirm if it's the same situation as yours https://github.com/wixtoolset/issues/issues/8044.

jmjaffe37 commented 5 months ago

I am also attempting to download WixToolset.Heat and I cannot find a version that downloads without the (damaged) tag

deeplow commented 5 months ago

The solutions is here: https://github.com/wixtoolset/issues/issues/8044#issuecomment-1994319845. Something like this

wix extension add WixToolset.Heat/4.0.4

Or another version tag

jmjaffe37 commented 5 months ago

The solutions is here: #8044 (comment). Something like this

wix extension add WixToolset.Heat/4.0.4

Or another version tag

Thanks for the quick reply @deeplow!I have actually already tried all versions between 4.0.0 and 5.0.0 and they all download as (damaged) for me. I should have been more specific with my previous comment 😅

Alejandroem commented 5 months ago

Same here when running

PS C:\Users\alexa\Development> wix extension add WixToolset.Util.wixext
PS C:\Users\alexa\Development> wix extension list
WixToolset.Util.wixext 5.0.0-rc.2 (damaged)
PS C:\Users\alexa\Development> 
Alejandroem commented 5 months ago

If i add the previous version it works. 🤷🏻

wix extension add WixToolset.Util.wixext/4.0.5

jmjaffe37 commented 5 months ago

Thank you for your response @Alejandroem, but I am attempting to download a different extension. The extension I need is the Heat extension. IE: WixToolset.Heat/4.0.4

barnson commented 5 months ago

Heat extension

Heat isn't an extension so it's never going to work with wix extension add. https://wixtoolset.org/docs/tools/heat/

Alejandroem commented 5 months ago

@jmjaffe37 you are right, it doesn't work in any of the versions:

PS C:\Users\alexa\Development> wix extension add WixToolset.Heat PS C:\Users\alexa\Development> wix extension list WixToolset.Heat 4.0.0 (damaged) WixToolset.Heat 4.0.3 (damaged) WixToolset.Heat 4.0.4 (damaged) WixToolset.Heat 5.0.0-rc.2 (damaged) PS C:\Users\alexa\Development>

jmjaffe37 commented 5 months ago

Heat extension

Heat isn't an extension so it's never going to work with wix extension add. https://wixtoolset.org/docs/tools/heat/

@barnson, does this mean that WixToolset.Heat is not an extension either? If this is the case, how can I perform the functions of heat (ie create .wxs files) from the wix v4 or wix v5 cli? The repo I am supporting does not have a .proj file setup and is not using msbuild

jmjaffe37 commented 5 months ago

The way I downloaded heat on my local machine was to get it from nuget.org: https://www.nuget.org/packages/WixToolset.Heat/

But I need a way to download it via cli so I can create wxs files on github workflows. If there is another way to generate wxs files, (or build without wxs files via the cli) please let me know :)

Alejandroem commented 5 months ago

What I did in my case was getting a windows server instance and then made the build there using the CLI locally, I had to go through the process of installing wix on the machine and then do a manual build with the cli to test it. Then I configured this windows server as a custom runner for my workflow. I did it on gitlab but the principle is the same, you can read about self hosted runners here https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners-

If you have your wxs file properly configured it's only running a command.

jmjaffe37 commented 5 months ago

For those wondering, this is what I ended up doing to get heat from a powershell script:

# Install wixtoolset.heat.5.0.0, also works for wixtoolset.heat.4.0.x
$wix_version = "5.0.0"
Write-Host "Installing WixToolset.Heat version $wix_version"
mkdir wix_extension
$sourceURI = 'https://www.nuget.org/api/v2/package/WixToolset.Heat/' + $wix_version
$outFile = '.\wix_extension\wixtoolset.heat.' + $wix_version + '.zip'
Invoke-WebRequest -Uri $sourceURI -OutFile $outFile
Expand-Archive -Path "$outFile" -DestinationPath ./wix_extension/

Then, to get the path of the heat.exe that you're meant to use:

# Determine the architecture of the operating system
if ([Environment]::Is64BitOperatingSystem) {
  Write-Output "x64 operating system"
  $current_arch = "x64"
}
else {
  Write-Output "x86 operating system"
  $current_arch = "x86"
}

# Get path to correct heat.exe for current computer architecture
$WIX_HEAT_PATH = (Get-ChildItem -Path .\wix_extension -Recurse -Filter "heat.exe").FullName | Select-String -Pattern "$current_arch"