thilojaeggi / WinGetty

An open source REST Backend for creating a private WinGet Repo without having to rely on cloud dependencies.
https://wingetty.dev
GNU Affero General Public License v3.0
185 stars 17 forks source link

issue with portable application #22

Closed kdpuvvadi closed 11 months ago

kdpuvvadi commented 11 months ago

Describe the bug Unable to install portable application. Getting error 127

To Reproduce Steps to reproduce the behavior:

  1. Add installer with installer type zip and nested installer type as exe (no portable option)
  2. Install package with winget install OpenTofu.Tofu -s puvvadi --scope machine (scope is irrelevent here. failing on any scope)

installer output

$ winget install OpenTofu.Tofu -s puvvadi --scope machine
Found Tofu [OpenTofu.Tofu] Version 1.6.0-alpha3
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://winget.local.puvvadi.net/api/download/OpenTofu.Tofu/1.6.0-alpha3/x64/machine
  ██████████████████████████████  21.2 MB / 21.2 MB
Successfully verified installer hash
Extracting archive...
Successfully extracted archive
Starting package install...
Installer failed with exit code: 127

Expected behavior

  1. exact the zip contents to $ENV:LOCALAPPDATA\Microsoft\WinGet\Packages\OpenTofu.Tofu_$Source\ or C:\Program Files\package\
  2. Add link to that in $ENV:LOCALAPPDATA\Microsoft\WinGet\Links\package.exe
  3. Add environment Varible for that package

logs

2023-10-27 11:34:27.262 [CORE] WinGet, version [1.6.2771], activity [{30FFBFC9-E156-4AF9-9C7B-DEA7E7FC8111}]
2023-10-27 11:34:27.262 [CORE] OS: Windows.Desktop v10.0.19045.3570
2023-10-27 11:34:27.262 [CORE] Command line Args: "C:\Users\kd\AppData\Local\Microsoft\WindowsApps\winget.exe" install OpenTofu.Tofu -s puvvadi --scope machine
2023-10-27 11:34:27.262 [CORE] Package: Microsoft.DesktopAppInstaller v1.21.2771.0
2023-10-27 11:34:27.262 [CORE] IsCOMCall:0; Caller: winget-cli
2023-10-27 11:34:27.276 [CLI ] WinGet invoked with arguments: 'install' 'OpenTofu.Tofu' '-s' 'puvvadi' '--scope' 'machine'
2023-10-27 11:34:27.277 [CLI ] Found subcommand: install
2023-10-27 11:34:27.277 [CLI ] Leaf command to execute: root:install
2023-10-27 11:34:27.283 [CLI ] Executing command: install
2023-10-27 11:34:27.285 [REPO] Source named 'msstore' is already defined at origin User. The source from origin Default is dropped.
2023-10-27 11:34:27.286 [REPO] Named source requested, found: puvvadi
2023-10-27 11:34:27.286 [REPO] Source past auto update time [5 mins]; it has been at least 9 mins
2023-10-27 11:34:27.287 [REPO] Source named 'msstore' is already defined at origin User. The source from origin Default is dropped.
2023-10-27 11:34:27.290 [REPO] Sending http GET request to: https://winget.local.puvvadi.net/wg/information
2023-10-27 11:34:27.644 [REPO] Response status: 200
2023-10-27 11:34:27.645 [REPO] Sending http GET request to: https://winget.local.puvvadi.net/wg/information
2023-10-27 11:34:27.693 [REPO] Response status: 200
2023-10-27 11:34:27.911 [REPO] Source named 'msstore' is already defined at origin User. The source from origin Default is dropped.
2023-10-27 11:34:27.912 [REPO] Creating PredefinedInstalledSource with filter [None]
2023-10-27 11:34:27.912 [REPO] Creating new SQLite Index with version [Latest] at ':memory:'
2023-10-27 11:34:27.912 [SQL ] Opening SQLite connection #1: ':memory:' [6, 0]
2023-10-27 11:34:27.986 [REPO] Reading MSI UpgradeCodes
2023-10-27 11:34:28.001 [REPO] Examining ARP entries for Machine | X64
2023-10-27 11:34:28.071 [REPO] Examining ARP entries for Machine | X86
2023-10-27 11:34:28.218 [REPO] Reading MSI UpgradeCodes
2023-10-27 11:34:28.230 [REPO] Examining ARP entries for User | X64
2023-10-27 11:34:28.526 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\kd\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\puvvadi\installed.db'
2023-10-27 11:34:28.526 [SQL ] Opening SQLite connection #2: 'C:\Users\kd\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\puvvadi\installed.db' [2, 0]
2023-10-27 11:34:28.527 [REPO] Opened SQLite Index with version [1.6], last write [2023-10-27 11:10:21.000]
2023-10-27 11:34:28.582 [REPO] Sending http POST request to: https://winget.local.puvvadi.net/wg/manifestSearch
2023-10-27 11:34:28.648 [REPO] Response status: 200
2023-10-27 11:34:28.649 [REPO] Sending http GET request to: https://winget.local.puvvadi.net/wg/packageManifests/OpenTofu.Tofu?Version=1.6.0-alpha3
2023-10-27 11:34:28.723 [REPO] Response status: 200
2023-10-27 11:34:28.728 [REPO] Finding installed package from available package using system reference search: Query:[none] Include:NormalizedNameAndPublisher='tofu'+'opentofu'[Exact]
2023-10-27 11:34:28.760 [REPO] Opening pinning index
2023-10-27 11:34:28.761 [REPO] Opening existing pinning index
2023-10-27 11:34:28.761 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\kd\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\pinning.db'
2023-10-27 11:34:28.761 [SQL ] Opening SQLite connection #3: 'C:\Users\kd\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\pinning.db' [2, 0]
2023-10-27 11:34:28.764 [REPO] Opened Pinning Index with version [1.0], last write [2023-04-04 14:31:49.000]
2023-10-27 11:34:28.765 [CLI ] Found one app. App id: OpenTofu.Tofu App name: Tofu
2023-10-27 11:34:28.773 [REPO] Sending http GET request to: https://winget.local.puvvadi.net/wg/packageManifests/OpenTofu.Tofu?Version=1.6.0-alpha3
2023-10-27 11:34:28.894 [REPO] Response status: 200
2023-10-27 11:34:28.895 [CLI ] Starting installer selection.
2023-10-27 11:34:28.895 [CLI ] Installer [X64,exe,User,] not applicable: Installer scope does not match required scope: User != Machine
2023-10-27 11:34:28.896 [CLI ] Completed installer selection.
2023-10-27 11:34:28.896 [CLI ] Manifest fields: Name [Tofu], Version [1.6.0-alpha3]
2023-10-27 11:34:28.914 [CLI ] Generated temp download path: C:\Users\kd\AppData\Local\Temp\WinGet\OpenTofu.Tofu.1.6.0-alpha3\395e7278136c06fe87ad4115ad5781332f37790adc5e5e64160b01d2a3acd53b
2023-10-27 11:34:28.915 [CORE] Downloading to path: C:\Users\kd\AppData\Local\Temp\WinGet\OpenTofu.Tofu.1.6.0-alpha3\395e7278136c06fe87ad4115ad5781332f37790adc5e5e64160b01d2a3acd53b
2023-10-27 11:34:28.915 [CORE] DeliveryOptimization downloading from url: https://winget.local.puvvadi.net/api/download/OpenTofu.Tofu/1.6.0-alpha3/x64/machine
2023-10-27 11:34:53.631 [CORE] Download completed.
2023-10-27 11:34:53.875 [CORE] Started applying motw to C:\Users\kd\AppData\Local\Temp\WinGet\OpenTofu.Tofu.1.6.0-alpha3\395e7278136c06fe87ad4115ad5781332f37790adc5e5e64160b01d2a3acd53b with zone: 3
2023-10-27 11:34:53.878 [CORE] Finished applying motw
2023-10-27 11:34:53.879 [CLI ] Installer hash verified
2023-10-27 11:34:53.879 [CORE] Started applying motw using IAttachmentExecute to C:\Users\kd\AppData\Local\Temp\WinGet\OpenTofu.Tofu.1.6.0-alpha3\395e7278136c06fe87ad4115ad5781332f37790adc5e5e64160b01d2a3acd53b
2023-10-27 11:34:55.072 [CORE] Finished applying motw using IAttachmentExecute. Result: 0 IAttachmentExecute::Save() result: 0
2023-10-27 11:34:55.073 [CLI ] Successfully renamed downloaded installer. Path: C:\Users\kd\AppData\Local\Temp\WinGet\OpenTofu.Tofu.1.6.0-alpha3\machine.zip
2023-10-27 11:34:55.073 [REPO] Creating PredefinedInstalledSource with filter [ARP]
2023-10-27 11:34:55.073 [REPO] Creating new SQLite Index with version [Latest] at ':memory:'
2023-10-27 11:34:55.073 [SQL ] Opening SQLite connection #4: ':memory:' [6, 0]
2023-10-27 11:34:55.132 [REPO] Reading MSI UpgradeCodes
2023-10-27 11:34:55.148 [REPO] Examining ARP entries for Machine | X64
2023-10-27 11:34:55.215 [REPO] Examining ARP entries for Machine | X86
2023-10-27 11:34:55.345 [REPO] Reading MSI UpgradeCodes
2023-10-27 11:34:55.357 [REPO] Examining ARP entries for User | X64
2023-10-27 11:34:55.498 [CLI ] Extracting archive to: C:\Users\kd\AppData\Local\Temp\WinGet\OpenTofu.Tofu.1.6.0-alpha3\extracted
2023-10-27 11:34:57.176 [CLI ] Successfully extracted archive
2023-10-27 11:34:57.177 [CLI ] Setting installerPath to: C:\Users\kd\AppData\Local\Temp\WinGet\OpenTofu.Tofu.1.6.0-alpha3\extracted\tofu.exe
2023-10-27 11:34:57.288 [CLI ] Installer args: 
2023-10-27 11:34:57.289 [CLI ] Starting: 'C:\Users\kd\AppData\Local\Temp\WinGet\OpenTofu.Tofu.1.6.0-alpha3\extracted\tofu.exe' with arguments ''
2023-10-27 11:35:02.984 [CLI ] ShellExecute installer failed: 127
2023-10-27 11:35:02.984 [CLI ] Terminating context: 0x8a150006 at D:\a\_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\InstallFlow.cpp:1fd

General Information:

Additional context Running docker image stable behind traefik locally.

thilojaeggi commented 11 months ago

Hi there, you're totally right. Portable is missing from the dropdown for nested installer types evne though it's supported. Will add in v0.0.6

thilojaeggi commented 11 months ago

Portable is now in the latest release v0.0.6