russellbanks / Komac

The Community Manifest Creator for WinGet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Input 2 installers, only 1 comes out

OfficialEsco opened this issue · comments

commented

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

I've encountered a issue where it only selects the MSI installer when the command includes both the MSI and EXE

I've tested this on both Linux and Windows Stable and Nightly

./KomacPortable-linux-x64 update -i Iterate.MountainDuck -v 4.15.6.21921 -u https://dist.mountainduck.io/Mountain%20Duck%20Installer-4.15.6.21921.exe https://dist.mountainduck.io/Mountain%20Duck%20Installer-4.15.6.21921.msi
komac update -i Iterate.MountainDuck -v 4.15.6.21921 -u https://dist.mountainduck.io/Mountain%20Duck%20Installer-4.15.6.21921.exe https://dist.mountainduck.io/Mountain%20Duck%20Installer-4.15.6.21921.msi
Installers:
- Architecture: x64
  InstallerUrl: https://dist.mountainduck.io/Mountain%20Duck%20Installer-4.15.6.21921.msi
  InstallerSha256: E82DBFF995C5A61329445E7879C5042C3B106D5D2EC6395B5979FF587F8E672C

If i only include the EXE link it gets 2 installers

Installers:
- Architecture: x64
  InstallerUrl: https://dist.mountainduck.io/Mountain%20Duck%20Installer-4.15.6.21921.exe
  InstallerSha256: 1E8E52BE10AFEB975402D06AE3D4171D776E26C402AE6CA35649FD9D05855215
- InstallerLocale: en-US
  Architecture: x64
  InstallerUrl: https://dist.mountainduck.io/Mountain%20Duck%20Installer-4.15.6.21921.exe
  InstallerSha256: 1E8E52BE10AFEB975402D06AE3D4171D776E26C402AE6CA35649FD9D05855215

If i only include the MSI link it gets 1 installer

commented

Found another package with the same issue, however this time its just between 2 MSI's

./KomacPortable-linux-nightly-x64 update -i Recoupler.AudioBookConverter -v 6.2.10 -u https://github.com/yermak/AudioBookConverter/releases/download/version_6.2.10/AudioBookConverter-All-Users-6.2.10.msi https://github.com/yermak/AudioBookConverter/releases/download/version_6.2.10/AudioBookConverter-Single-User-6.2.10.msi
Installers:
- Architecture: x64
  InstallerUrl: https://github.com/yermak/AudioBookConverter/releases/download/version_6.2.10/AudioBookConverter-All-Users-6.2.10.msi
  InstallerSha256: ADF36241F1DD4D2193832C69B516C1D84BFFA89634D949E17B1DF469BEF28A47
ManifestType: installer

Found via microsoft/winget-pkgs#146060

I can't reproduce the first example on main:

komac update -i Iterate.MountainDuck -v 4.15.6.21921 -u https://dist.mountainduck.io/Mountain%20Duck%20Installer-4.15.6.21921.exe https://dist.mountainduck.io/Mountain%20Duck%20Installer-4.15.6.21921.msi
# Created with komac v2.1.1
# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.6.0.schema.json

PackageIdentifier: Iterate.MountainDuck
PackageVersion: 4.15.6.21921
Platform:
- Windows.Desktop
Scope: machine
InstallModes:
- interactive
- silent
- silentWithProgress
InstallerSwitches:
  Upgrade: /norestart
  Custom: /norestart
InstallerSuccessCodes:
- 3010
UpgradeBehavior: install
ReleaseDate: 2024-03-14
Installers:
- Architecture: x64
  InstallerType: burn
  InstallerUrl: https://dist.mountainduck.io/Mountain%20Duck%20Installer-4.15.6.21921.exe
  InstallerSha256: 1E8E52BE10AFEB975402D06AE3D4171D776E26C402AE6CA35649FD9D05855215
- InstallerLocale: en-US
  Architecture: x64
  InstallerType: wix
  InstallerUrl: https://dist.mountainduck.io/Mountain%20Duck%20Installer-4.15.6.21921.msi
  InstallerSha256: E82DBFF995C5A61329445E7879C5042C3B106D5D2EC6395B5979FF587F8E672C
  ProductCode: '{4C26F964-48D2-4D80-8AE4-17728CCF4910}'
  AppsAndFeaturesEntries:
  - UpgradeCode: '{FF813E13-BE66-48F5-8C4F-1568C9660323}'
ManifestType: installer
ManifestVersion: 1.6.0

I can reproduce the issue with Recoupler.AudioBookConverter so I'll take a look at that.

The issue with Recoupler.AudioBookConverter occurs because Komac looks for the keyword user in the URL to get an indication of whether it's machine or user scope and both MSIs have that - Single-User and All-Users. I've changed it so that the machine check if done first and All-Users is part of that check.

I've changed it so that the machine check if done first and All-Users is part of that check.

I've also added functionality in 7b52a63 to get the install scope (ALLUSERS) from the MSIs which further ensures that they are identified as separate Machine and Per-User installers.

I was able to reproduce your first example since 7b52a63. This happened because the installers were matching incorrectly so to fix it I've given more weight to the installer type when matching.

commented

Issue might still be around

./target/release/komac update -i OpenMedia.4KStogram -v 4.8.1 -u https://dl.4kdownload.com/app/4kstogram_4.8.0_online.exe https://dl.4kdownload.com/app/4kstogram_4.8.0_x64_online.exe https://dl.4kdownload.com/app/4kstogram_4.8.0.msi https://dl.4kdownload.com/app/4kstogram_4.8.0_x64.msi
Installers:
- Architecture: x86
  InstallerUrl: https://dl.4kdownload.com/app/4kstogram_4.8.0.msi
  InstallerSha256: 0F02D31A5B7839FE7529C1F4A8A8186336817E34B189B90808E15EAC59C3A19E
  ProductCode: '{EE8C017B-2444-490E-89E1-CDF16F4933E8}'
- Architecture: x64
  InstallerUrl: https://dl.4kdownload.com/app/4kstogram_4.8.0_x64.msi
  InstallerSha256: 4E2A49A3FE7769323542623B8AB0374781C5F7086F9700108B82FE94FFB56DC6
  ProductCode: '{CB534061-F938-46A1-B02B-4FD24914525D}'
git log -p -1
commit a2ba6b163c361b391f3bba67afb540b61a8ab362 (HEAD -> main, origin/main, origin/HEAD)
Author: Russell Banks <74878137+russellbanks@users.noreply.github.com>
Date:   Wed Mar 27 18:08:52 2024 +0000

    Give more weight to installer type when matching installers

Issue might still be around

This one is happening because the exe installers are correctly being identified as Burn installers but the previous manifest has them as exe, meaning the extra weighting for the matching installer types isn't applicable. I'll figure out how to match still when the previous installer has the wrong installer type.