Open jiasli opened 11 months ago
Thank you for opening this issue, we will look into it.
However, all these methods require either installing the MSI or other dependencies. As our automation bot @azclibot for generating the manifest is hosted on a Linux agent and the manifest generation logic is written in Bash syntax, these methods may not be practicable unless we move @azclibot to a Windows agent.
https://github.com/microsoft/winget-pkgs/pull/123641#issuecomment-1814988198 for ways to retrieve ProductCode from downloaded MSI file through PowerShell/Bash
https://github.com/microsoft/winget-pkgs/pull/123641#issuecomment-1815656511 seems to be the correct way
winget
is requiring us to includeProductCode
of the MSIs inMicrosoft.AzureCLI
's manifest (https://github.com/microsoft/winget-pkgs/pull/123641#issuecomment-1778044560): https://github.com/microsoft/winget-pkgs/blob/master/manifests/m/Microsoft/AzureCLI/2.54.0/Microsoft.AzureCLI.installer.yamlThree methods for extracting the
ProductCode
are provided: https://github.com/microsoft/winget-pkgs/pull/123641#discussion_r1371447095I am able to get the
ProductCode
with the first method on my Windows machine (even thoughGet-WmiObject Win32_Product
is slow):However, all these methods require either installing the MSI or other dependencies. As our automation bot @azclibot for generating the manifest is hosted on a Linux agent and the manifest generation logic is written in Bash syntax, these methods may not be practicable unless we move @azclibot to a Windows agent.
A workaround I can think of is to extract the
ProductCode
while building the MSI and save it to the built ADO artifact. Then use theProductCode
saved in the artifact to generate the manifest.Regarding a fixed
ProductCode
According to https://wixtoolset.org/docs/v3/xsd/wix/product/,
Id
ofProduct
element is anAutogenGuid
:So, in Azure CLI's
Product.wxs
, it is declared ashttps://github.com/Azure/azure-cli/blob/aeb94ed12a46acdd14e7c4e2633908e149f4a1bc/build_scripts/windows/Product.wxs#L36
And according to https://learn.microsoft.com/en-us/windows/win32/msi/productcode
It is not possible to have a fixed GUID. We must generate a new one for each MSI package.
Also see: