byteben / MEM

40 stars 8 forks source link

Always have Error 0x80070002 output, but can go through #4

Closed alexyvic closed 1 year ago

alexyvic commented 1 year ago

Current: 1.06.18.0

Is the error 0x80070002 always expected? I have run it a few times, and each time I receive the same error. However, it does not affect the Winget installation.

PS C:\Temp> C:\Temp\Reset-Appx.ps1
** Starting processing the script
Testing the WinGet package and other dependancies are installed
The 'winget.exe' binary was found at 'C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.19.11071.0_x64__8wekyb3d8bbwe\WinGet.exe'
The WinGet binary was validated
WinGet version is 'v1.4.11071'
Processing AppxPackage: Microsoft.CompanyPortal
Found the following users with AppxPackage 'Microsoft.CompanyPortal':
User: 'AD\testuser', InstallState: 'Installed'
Removing AppxPackage: Microsoft.CompanyPortal
WARNING: AppxPackage removal failed. Error 0x80070002
WARNING: Removing AppxPackage 'Microsoft.CompanyPortal' for all users was not succesful
Removing AppxProvisioningPackage: Microsoft.CompanyPortal_11.2.58.0_neutral_~_8wekyb3d8bbwe
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -eq Microsoft.CompanyPortal_11.2.58.0_neutral_~_8wekyb3d8bbwe } | Remove-AppxProvisionedPackage -AllUsers -ErrorAction Stop

Path          : 
Online        : True
RestartNeeded : False

AppxProvisionedPackage: Microsoft.CompanyPortal was removed succesfully
Checking if 'Company Portal' is installed using Id '9WZDNCRFJ3PZ'...
winget.exe list --id 9WZDNCRFJ3PZ --source msstore --accept-source-agreements
The 'Winget list' command line indicated the 'Company Portal' app, with Id '9WZDNCRFJ3PZ', was not installed. Installing 'Company Portal' using WinGet command line...
Installing 'Company Portal', with Id '9WZDNCRFJ3PZ', using the WinGet command line
.\winget.exe install --id '9WZDNCRFJ3PZ' --accept-package-agreements --accept-source-agreements --source msstore --scope machine
   - 
Found Company Portal [9WZDNCRFJ3PZ] Version Unknown
This package is provided through Microsoft Store. winget may need to acquire the package from Microsoft Store on behalf of the current user.
Agreements for Company Portal [9WZDNCRFJ3PZ] Version Unknown
Version: Unknown
Publisher: Microsoft Corporation
Publisher Url: http://go.microsoft.com/fwlink/?LinkId=273865
Publisher Support Url: http://go.microsoft.com/fwlink/?LinkId=273866
Description:
  Microsoft Intune helps organizations manage access to corporate apps, data, and resources. Company Portal is the app that lets you, as an employee of your company, securely access those res
ources.

  Before you can use this app, make sure your IT admin has set up your work account. Your company must also have a subscription to Microsoft Intune.

  Company Portal helps simplify the tasks you need to do for work:

  - Enroll your device to access corporate resources, including Office, email, and OneDrive for Business

  - Sign in to corporate resources with company-issued certificates

  - Reduce the number of times you need to sign in to corporate resources with single sign-on

  - Browse and install approved business apps from your IT department or the Microsoft Store for Business

  - View and manage your enrolled devices – and wipe them if they get lost or stolen

  - Get help directly from your IT department through available contact information

  A note about Intune: every organization has different access requirements, and will use Intune in ways that they determine will best manage their information. Some functionality might be un
available in certain countries. If you have questions about how this app is being used within your organization, your company’s IT administrator should have those answers for you. Microsoft
, your network provider, and your device’s manufacturer do not know how Intune will be used by your organization.
License: http://go.microsoft.com/fwlink/?LInkId=518263
Privacy Url: http://go.microsoft.com/fwlink/?LinkID=316999
Copyright: © 2022. Microsoft. All rights reserved.
Agreements:
Category: Business
Pricing: Free
Free Trial: No
Terms of Transaction: https://aka.ms/microsoft-store-terms-of-transaction
Seizure Warning: https://aka.ms/microsoft-store-seizure-warning
Store License Terms: https://aka.ms/microsoft-store-license

Verifying/Requesting package acquisition...
Verifying/Requesting package acquisition success
Starting package install...
   -\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/ 

  ███████████████████████████▒▒▒  90%
  ███████████████████████████▒▒▒  90%
  ███████████████████████████▒▒▒  90%
  ███████████████████████████▒▒▒  90%
  ██████████████████████████████  100%
Successfully installed
Checking if 'Company Portal' is installed using Get-AppXPackage...
Get-AppXPackage -AllUsers | Where-Object { $_.Name -like "*Microsoft.CompanyPortal*" } -ErrorAction Stop
Success: The 'Company Portal' app, with Id 9WZDNCRFJ3PZ, installed succesfully. Check the Winget logs at 'C:\Windows\Temp\WinGet\defaultState' for more information
Finished processing the script
Frostygills commented 1 year ago

Hi, I'm also getting this error when running the script (I also had to the add the Global: to wingetpath variable). One other thing I've notice is when you do a winget list cmd, Company Portal looks like it has been installed from the old store (Microsoft.CompanyPortal_8wekyb3d8bbwe, Source: blank) rather than the expected (9wzdncrfj3pz, Source: msstore). Unless I'm understanding the listed info incorrectly.

byteben commented 1 year ago

Can you share the winget log that was generated please? C:\Windows\temp\winget\defaultstate\

Frostygills commented 1 year ago

2023-06-26 11:34:02.271 [CORE] WinGet, version [1.4.11071], activity [{C6EF881C-0406-4A81-9838-9DA77116C0D2}] 2023-06-26 11:34:02.273 [CORE] OS: Windows.Desktop v10.0.19044.3086 2023-06-26 11:34:02.274 [CORE] Command line Args: "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.19.11071.0_x648wekyb3d8bbwe\winget.exe" --version 2023-06-26 11:34:02.274 [CORE] IsCOMCall:0; Caller: winget-cli 2023-06-26 11:34:02.274 [CLI ] WinGet invoked with arguments: '--version' 2023-06-26 11:34:02.275 [CLI ] Leaf command to execute: root 2023-06-26 11:34:02.275 [CLI ] Executing command: root 2023-06-26 11:34:02.275 [CLI ] Leaf command succeeded: root 2023-06-26 11:34:05.380 [CORE] WinGet, version [1.4.11071], activity [{E6149887-0C5F-4D68-A2BD-9501D023203A}] 2023-06-26 11:34:05.385 [CORE] OS: Windows.Desktop v10.0.19044.3086 2023-06-26 11:34:05.385 [CORE] Command line Args: "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.19.11071.0_x648wekyb3d8bbwe\winget.exe" list --id 9WZDNCRFJ3PZ --source msstore --accept-source-agreements 2023-06-26 11:34:05.385 [CORE] IsCOMCall:0; Caller: winget-cli 2023-06-26 11:34:05.387 [CLI ] WinGet invoked with arguments: 'list' '--id' '9WZDNCRFJ3PZ' '--source' 'msstore' '--accept-source-agreements' 2023-06-26 11:34:05.387 [CLI ] Found subcommand: list 2023-06-26 11:34:05.387 [CLI ] Leaf command to execute: root:list 2023-06-26 11:34:05.387 [CLI ] Executing command: list 2023-06-26 11:34:05.407 [REPO] Named source requested, found: msstore 2023-06-26 11:34:05.407 [REPO] Source past auto update time [5 mins]; it has been at least 4093 mins 2023-06-26 11:34:05.416 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information 2023-06-26 11:34:05.795 [REPO] Response status: 200 2023-06-26 11:34:05.796 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information 2023-06-26 11:34:05.829 [REPO] Response status: 200 2023-06-26 11:34:06.050 [REPO] Creating PredefinedInstalledSource with filter [None] 2023-06-26 11:34:06.050 [REPO] Creating new SQLite Index [4294967295.4294967295] at ':memory:' 2023-06-26 11:34:06.050 [SQL ] Opening SQLite connection #1: ':memory:' [6, 0] 2023-06-26 11:34:06.086 [REPO] Reading MSI UpgradeCodes 2023-06-26 11:34:06.089 [REPO] Examining ARP entries for Machine | X64 2023-06-26 11:34:06.100 [REPO] Examining ARP entries for Machine | X86 2023-06-26 11:34:06.124 [REPO] Reading MSI UpgradeCodes 2023-06-26 11:34:06.127 [REPO] Examining ARP entries for User | X64 2023-06-26 11:34:06.176 [REPO] Opening SQLite Index for ReadWrite at 'C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft/WinGet\State\defaultState\StoreEdgeFD\installed.db' 2023-06-26 11:34:06.176 [SQL ] Opening SQLite connection #2: 'C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft/WinGet\State\defaultState\StoreEdgeFD\installed.db' [2, 0] 2023-06-26 11:34:06.178 [REPO] Opened SQLite Index with version [1.6], last write [2023-06-23 15:14:36.000] 2023-06-26 11:34:06.219 [REPO] Sending http POST request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/manifestSearch 2023-06-26 11:34:06.260 [REPO] Response status: 200 2023-06-26 11:34:06.261 [CLI ] No app found matching input criteria 2023-06-26 11:34:06.270 [CLI ] Terminating context: 0x8a150014 at D:\a_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\WorkflowBase.cpp:337 2023-06-26 11:34:06.348 [CORE] WinGet, version [1.4.11071], activity [{94900AB9-1697-4FA0-B0EB-4179C309E7A9}] 2023-06-26 11:34:06.350 [CORE] OS: Windows.Desktop v10.0.19044.3086 2023-06-26 11:34:06.350 [CORE] Command line Args: "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.19.11071.0_x64__8wekyb3d8bbwe\winget.exe" install --id 9WZDNCRFJ3PZ --accept-package-agreements --accept-source-agreements --source msstore --scope machine 2023-06-26 11:34:06.350 [CORE] IsCOMCall:0; Caller: winget-cli 2023-06-26 11:34:06.350 [CLI ] WinGet invoked with arguments: 'install' '--id' '9WZDNCRFJ3PZ' '--accept-package-agreements' '--accept-source-agreements' '--source' 'msstore' '--scope' 'machine' 2023-06-26 11:34:06.355 [CLI ] Found subcommand: install 2023-06-26 11:34:06.355 [CLI ] Leaf command to execute: root:install 2023-06-26 11:34:06.360 [CLI ] Executing command: install 2023-06-26 11:34:06.365 [REPO] Named source requested, found: msstore 2023-06-26 11:34:06.365 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information 2023-06-26 11:34:06.545 [REPO] Response status: 200 2023-06-26 11:34:06.545 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information 2023-06-26 11:34:06.573 [REPO] Response status: 200 2023-06-26 11:34:06.758 [REPO] Creating PredefinedInstalledSource with filter [None] 2023-06-26 11:34:06.758 [REPO] Creating new SQLite Index [4294967295.4294967295] at ':memory:' 2023-06-26 11:34:06.758 [SQL ] Opening SQLite connection #1: ':memory:' [6, 0] 2023-06-26 11:34:06.798 [REPO] Reading MSI UpgradeCodes 2023-06-26 11:34:06.801 [REPO] Examining ARP entries for Machine | X64 2023-06-26 11:34:06.813 [REPO] Examining ARP entries for Machine | X86 2023-06-26 11:34:06.834 [REPO] Reading MSI UpgradeCodes 2023-06-26 11:34:06.837 [REPO] Examining ARP entries for User | X64 2023-06-26 11:34:06.861 [REPO] Opening SQLite Index for ReadWrite at 'C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft/WinGet\State\defaultState\StoreEdgeFD\installed.db' 2023-06-26 11:34:06.861 [SQL ] Opening SQLite connection #2: 'C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft/WinGet\State\defaultState\StoreEdgeFD\installed.db' [2, 0] 2023-06-26 11:34:06.862 [REPO] Opened SQLite Index with version [1.6], last write [2023-06-23 15:14:36.000] 2023-06-26 11:34:06.929 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/packageManifests/9WZDNCRFJ3PZ?Market=GB 2023-06-26 11:34:06.983 [REPO] Response status: 200 2023-06-26 11:34:06.985 [CLI ] Found one app. App id: 9WZDNCRFJ3PZ App name: Company Portal 2023-06-26 11:34:06.986 [CLI ] Starting installer selection. 2023-06-26 11:34:06.986 [CLI ] Installer [Arm,msstore,User,] not applicable: Machine is not compatible with Arm 2023-06-26 11:34:06.986 [CLI ] Installer [Arm64,msstore,User,] not applicable: Machine is not compatible with Arm64 2023-06-26 11:34:06.986 [CLI ] Completed installer selection. 2023-06-26 11:34:06.986 [CLI ] Manifest fields: Name [Company Portal], Version [Unknown] 2023-06-26 11:34:07.005 [CLI ] Package agreements accepted by CLI flag 2023-06-26 11:34:08.811 [CLI ] Get device entitlement. 2023-06-26 11:34:10.715 [CLI ] Get entitlement succeeded. 2023-06-26 11:34:10.740 [CLI ] Started MSStore package execution. ProductId: 9WZDNCRFJ3PZ PackageFamilyName: Microsoft.CompanyPortal_8wekyb3d8bbwe 2023-06-26 11:34:57.256 [REPO] Opening SQLite Index for ReadWrite at 'C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft/WinGet\State\defaultState\StoreEdgeFD\installed.db' 2023-06-26 11:34:57.256 [SQL ] Opening SQLite connection #3: 'C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft/WinGet\State\defaultState\StoreEdgeFD\installed.db' [2, 0] 2023-06-26 11:34:57.258 [REPO] Opened SQLite Index with version [1.6], last write [2023-06-23 15:14:36.000] 2023-06-26 11:34:57.329 [CLI ] Leaf command succeeded: root:install

byteben commented 1 year ago

What device architecture was this run on?

2023-06-26 11:34:06.986 [CLI ] Installer [Arm64,msstore,User,] not applicable: Machine is not compatible with Arm64

Ben Whitmore Enterprise Mobility MVP


From: Frostygills @.> Sent: Monday, June 26, 2023 11:45:28 AM To: byteben/MEM @.> Cc: Ben Whitmore @.>; Comment @.> Subject: Re: [byteben/MEM] Always have Error 0x80070002 output, but can go through (Issue #4)

2023-06-26 11:34:02.271 [CORE] WinGet, version [1.4.11071], activity [{C6EF881C-0406-4A81-9838-9DA77116C0D2}] 2023-06-26 11:34:02.273 [CORE] OS: Windows.Desktop v10.0.19044.3086 2023-06-26 11:34:02.274 [CORE] Command line Args: "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.19.11071.0_x648wekyb3d8bbwe\winget.exe" --version 2023-06-26 11:34:02.274 [CORE] IsCOMCall:0; Caller: winget-cli 2023-06-26 11:34:02.274 [CLI ] WinGet invoked with arguments: '--version' 2023-06-26 11:34:02.275 [CLI ] Leaf command to execute: root 2023-06-26 11:34:02.275 [CLI ] Executing command: root 2023-06-26 11:34:02.275 [CLI ] Leaf command succeeded: root 2023-06-26 11:34:05.380 [CORE] WinGet, version [1.4.11071], activity [{E6149887-0C5F-4D68-A2BD-9501D023203A}] 2023-06-26 11:34:05.385 [CORE] OS: Windows.Desktop v10.0.19044.3086 2023-06-26 11:34:05.385 [CORE] Command line Args: "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.19.11071.0_x648wekyb3d8bbwe\winget.exe" list --id 9WZDNCRFJ3PZ --source msstore --accept-source-agreements 2023-06-26 11:34:05.385 [CORE] IsCOMCall:0; Caller: winget-cli 2023-06-26 11:34:05.387 [CLI ] WinGet invoked with arguments: 'list' '--id' '9WZDNCRFJ3PZ' '--source' 'msstore' '--accept-source-agreements' 2023-06-26 11:34:05.387 [CLI ] Found subcommand: list 2023-06-26 11:34:05.387 [CLI ] Leaf command to execute: root:list 2023-06-26 11:34:05.387 [CLI ] Executing command: list 2023-06-26 11:34:05.407 [REPO] Named source requested, found: msstore 2023-06-26 11:34:05.407 [REPO] Source past auto update time [5 mins]; it has been at least 4093 mins 2023-06-26 11:34:05.416 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information 2023-06-26 11:34:05.795 [REPO] Response status: 200 2023-06-26 11:34:05.796 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information 2023-06-26 11:34:05.829 [REPO] Response status: 200 2023-06-26 11:34:06.050 [REPO] Creating PredefinedInstalledSource with filter [None] 2023-06-26 11:34:06.050 [REPO] Creating new SQLite Index [4294967295.4294967295] at ':memory:' 2023-06-26 11:34:06.050 [SQL ] Opening SQLite connection #1https://github.com/byteben/MEM/issues/1: ':memory:' [6, 0] 2023-06-26 11:34:06.086 [REPO] Reading MSI UpgradeCodes 2023-06-26 11:34:06.089 [REPO] Examining ARP entries for Machine | X64 2023-06-26 11:34:06.100 [REPO] Examining ARP entries for Machine | X86 2023-06-26 11:34:06.124 [REPO] Reading MSI UpgradeCodes 2023-06-26 11:34:06.127 [REPO] Examining ARP entries for User | X64 2023-06-26 11:34:06.176 [REPO] Opening SQLite Index for ReadWrite at 'C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft/WinGet\State\defaultState\StoreEdgeFD\installed.db' 2023-06-26 11:34:06.176 [SQL ] Opening SQLite connection #2https://github.com/byteben/MEM/pull/2: 'C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft/WinGet\State\defaultState\StoreEdgeFD\installed.db' [2, 0] 2023-06-26 11:34:06.178 [REPO] Opened SQLite Index with version [1.6], last write [2023-06-23 15:14:36.000] 2023-06-26 11:34:06.219 [REPO] Sending http POST request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/manifestSearch 2023-06-26 11:34:06.260 [REPO] Response status: 200 2023-06-26 11:34:06.261 [CLI ] No app found matching input criteria 2023-06-26 11:34:06.270 [CLI ] Terminating context: 0x8a150014 at D:\a_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\WorkflowBase.cpp:337 2023-06-26 11:34:06.348 [CORE] WinGet, version [1.4.11071], activity [{94900AB9-1697-4FA0-B0EB-4179C309E7A9}] 2023-06-26 11:34:06.350 [CORE] OS: Windows.Desktop v10.0.19044.3086 2023-06-26 11:34:06.350 [CORE] Command line Args: "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.19.11071.0_x64__8wekyb3d8bbwe\winget.exe" install --id 9WZDNCRFJ3PZ --accept-package-agreements --accept-source-agreements --source msstore --scope machine 2023-06-26 11:34:06.350 [CORE] IsCOMCall:0; Caller: winget-cli 2023-06-26 11:34:06.350 [CLI ] WinGet invoked with arguments: 'install' '--id' '9WZDNCRFJ3PZ' '--accept-package-agreements' '--accept-source-agreements' '--source' 'msstore' '--scope' 'machine' 2023-06-26 11:34:06.355 [CLI ] Found subcommand: install 2023-06-26 11:34:06.355 [CLI ] Leaf command to execute: root:install 2023-06-26 11:34:06.360 [CLI ] Executing command: install 2023-06-26 11:34:06.365 [REPO] Named source requested, found: msstore 2023-06-26 11:34:06.365 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information 2023-06-26 11:34:06.545 [REPO] Response status: 200 2023-06-26 11:34:06.545 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information 2023-06-26 11:34:06.573 [REPO] Response status: 200 2023-06-26 11:34:06.758 [REPO] Creating PredefinedInstalledSource with filter [None] 2023-06-26 11:34:06.758 [REPO] Creating new SQLite Index [4294967295.4294967295] at ':memory:' 2023-06-26 11:34:06.758 [SQL ] Opening SQLite connection #1https://github.com/byteben/MEM/issues/1: ':memory:' [6, 0] 2023-06-26 11:34:06.798 [REPO] Reading MSI UpgradeCodes 2023-06-26 11:34:06.801 [REPO] Examining ARP entries for Machine | X64 2023-06-26 11:34:06.813 [REPO] Examining ARP entries for Machine | X86 2023-06-26 11:34:06.834 [REPO] Reading MSI UpgradeCodes 2023-06-26 11:34:06.837 [REPO] Examining ARP entries for User | X64 2023-06-26 11:34:06.861 [REPO] Opening SQLite Index for ReadWrite at 'C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft/WinGet\State\defaultState\StoreEdgeFD\installed.db' 2023-06-26 11:34:06.861 [SQL ] Opening SQLite connection #2https://github.com/byteben/MEM/pull/2: 'C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft/WinGet\State\defaultState\StoreEdgeFD\installed.db' [2, 0] 2023-06-26 11:34:06.862 [REPO] Opened SQLite Index with version [1.6], last write [2023-06-23 15:14:36.000] 2023-06-26 11:34:06.929 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/packageManifests/9WZDNCRFJ3PZ?Market=GB 2023-06-26 11:34:06.983 [REPO] Response status: 200 2023-06-26 11:34:06.985 [CLI ] Found one app. App id: 9WZDNCRFJ3PZ App name: Company Portal 2023-06-26 11:34:06.986 [CLI ] Starting installer selection. 2023-06-26 11:34:06.986 [CLI ] Installer [Arm,msstore,User,] not applicable: Machine is not compatible with Arm 2023-06-26 11:34:06.986 [CLI ] Installer [Arm64,msstore,User,] not applicable: Machine is not compatible with Arm64 2023-06-26 11:34:06.986 [CLI ] Completed installer selection. 2023-06-26 11:34:06.986 [CLI ] Manifest fields: Name [Company Portal], Version [Unknown] 2023-06-26 11:34:07.005 [CLI ] Package agreements accepted by CLI flag 2023-06-26 11:34:08.811 [CLI ] Get device entitlement. 2023-06-26 11:34:10.715 [CLI ] Get entitlement succeeded. 2023-06-26 11:34:10.740 [CLI ] Started MSStore package execution. ProductId: 9WZDNCRFJ3PZ PackageFamilyName: Microsoft.CompanyPortal_8wekyb3d8bbwe 2023-06-26 11:34:57.256 [REPO] Opening SQLite Index for ReadWrite at 'C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft/WinGet\State\defaultState\StoreEdgeFD\installed.db' 2023-06-26 11:34:57.256 [SQL ] Opening SQLite connection #3https://github.com/byteben/MEM/issues/3: 'C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft/WinGet\State\defaultState\StoreEdgeFD\installed.db' [2, 0] 2023-06-26 11:34:57.258 [REPO] Opened SQLite Index with version [1.6], last write [2023-06-23 15:14:36.000] 2023-06-26 11:34:57.329 [CLI ] Leaf command succeeded: root:install

— Reply to this email directly, view it on GitHubhttps://github.com/byteben/MEM/issues/4#issuecomment-1607195903, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKSAHIGQOJINBPIDLX4LF3LXNFR4RANCNFSM6AAAAAAZNBRHOU. You are receiving this because you commented.Message ID: @.***>

Frostygills commented 1 year ago

Windows 10 x64.

byteben commented 1 year ago

Hi, I'm also getting this error when running the script (I also had to the add the Global: to wingetpath variable). One other thing I've notice is when you do a winget list cmd, Company Portal looks like it has been installed from the old store (Microsoft.CompanyPortal_8wekyb3d8bbwe, Source: blank) rather than the expected (9wzdncrfj3pz, Source: msstore). Unless I'm understanding the listed info incorrectly.

There isnt a new store per se, its the same store and the same app :)

Can you please try version 1.06.27.0 winget was installing the appxprovisionedpackage but the manifest was not registering which would result in the app not appearing for the logged on user. New users logging on should have the appx package provisioned ok

byteben commented 1 year ago

We found the root cause and a fix is inbound for v2 of the script

byteben commented 1 year ago

All 3 conditions listed below are fixed in V1.07.03.0 of Reset-Appx.ps1 Bug Fixes, Enhancements and Refactoring 🪲🌟🧑‍💻

Condition 1: When WinGet installs the app as SYSTEM, the AppxPackage can fail to register so the AppxPackage regresses, resulting in the ap not being available for the user.

Condition 2: The AppxPackage was staged as SYSTEM

Condition 3: After the WinGet install, WinGet list did not detect the app

WinGet will retry 10 times (by default) to install the app successfully and ensure the conditions above are not present. There is also a 30 second wait (by default) when testing the AppxPackage after WinGet has installed the app