Wednesday, April 26, 2023

Getting "Store is not available in your country or region" in Microsoft Store

Getting "Store is not available in your country or region" in Microsoft Store

When I open Microsoft Store I am getting the following error message on Windows 10 20H2
Store is not available in your country or region
Code: 0x87e10002
CV: SGmLmAU6/UWYL9FO
To fix this, open Control Panel | Clock and Region | Region, check if it shows the following:

Format: English (United States)
Match Windows display language (recommended)
If yes, then change it to:

Format:
English (United States)
Click on Apply and then close and open Microsoft Store.

PS Quick Tip: Get Windows OS country code

PS Quick Tip: Get Windows OS country code

PS C:\>Get-ItemProperty 'HKCU:\Control Panel\International\Geo\' | select -exp Name

Tuesday, April 25, 2023

Install Winget on Windows 2022

Install Winget on Windows 2022

This is not working anymore on Windows 10 LTSC as of 10/14/2023

Use this post for an updated instructions - https://8thstring.blogspot.com/2023/10/install-winget-on-windows-2022-or.html

Install Pre-reqs

Install Microsoft.UI.Xaml/2.7.3

Navigate to https://www.nuget.org/packages/Microsoft.UI.Xaml/2.7.3, on the left side look for Download Package button to download microsoft.ui.xaml.2.7.3.nupkg.

Using 7-zip, extract microsoft.ui.xaml.2.7.3.nupkg\microsoft.ui.xaml.2.7.3.nupkg\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx

Install
PS C:\>Add-AppxPackage .\Microsoft.UI.Xaml.2.7.appx

Install Microsoft.VCLibs.140.00.UWPDesktop

Download https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx

Install
PS C:\>Add-AppxPackage .\Microsoft.VCLibs.x64.14.00.Desktop.appx

Install Winget

Download Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle or any recent versions (tested using 1.4.10173) from Github

Download license file 3463fe9ad25e44f28630526aa9ad5648_License1.xml (should be one of the artifacts) from Github, the same URL from above.

Install
PS C:\>Add-AppxProvisionedPackage -Online -PackagePath .\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -LicensePath .\3463fe9ad25e44f28630526aa9ad5648_License1.xml -Verbose


Refs: https://www.virtualizationhowto.com/2021/11/install-winget-in-windows-server-2022-no-applicable-app-licenses-error/

Sunday, April 09, 2023

Kali Linux (2023.1) randomly freezes on Dell Latitude 7490

Kali Linux(2023.1) randomly hard freezes on Dell Latitude 7490. This can happen immediately or after few minutes.

This is  likely caused by a bug in integrated Intel GPU (i915) driver, see the following links for more information:

Bug 102586 - System freeze with Kernels > 4.11.x (freeze on 4.12.x and 4.13.x) 

Fix for Intel i915 GPU Freeze on Recent Linux Kernels

Linux 5.x random kernel panic workaround

Workaround:

  1. Touch /etc/modprobe.d/i915.conf
  2. Add this line
    options i915 enable_psr=0
  3. Reboot

//end

Monday, March 06, 2023

Windows 11 22H2 unable to connect to some Windows 10 via RDP

Windows 11 22H2 unable to connect to some Windows 10 via RDP

I have one machine that got pushed an upgrade from Windows 10 to Windows 11 22H2. Before the upgrade remote desktop was working to all of my Windows machines. 

After the upgrade to Windows 11 22H2 RDP only works for certain machines. It was working for domain joined machines and machines that were using default local/domain policies related to RDP. 

Below was the error message I am getting from RDP client (Microsoft Windows 11 Version 22H2 [Version 10.0.22621.1344])

[Window Title]
Remote Desktop Connection

[Content]
An internal error has occurred.

[^] Hide details  [OK]

[Expanded Information]
Error code: 0x4
Extended error code: 0x0
Timestamp (UTC): 03/04/23 04:00:05 AM

Press Ctrl+C to copy.
 

As a workaround, on the target machine (RDP server), change the following policy using gpedit.msc.

Local Computer Policy | Computer Configuration | Administrative Templates | Windows Components | Remote Desktop Services | Remote Desktop Session Host | Security

Require use of specific security layer for remote (RDP) connections = Enabled
Security Layer = RDP

//end

Sunday, March 05, 2023

Microsoft Visual C++ Runtime Library - Debug Assertion Failed!

Microsoft Visual C++ Runtime Library - Debug Assertion Failed!

Running an application in a debug environment throws the following assertion message.

---------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Debug Assertion Failed!

Program: x:\test\myapp.exe
File: minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp
Line: 996

Expression: __acrt_first_block == header

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)

---------------------------
Abort   Retry   Ignore   
---------------------------

In my specific case, this was caused by a string created in the heap by a DLL and freed in the executable.  The DLL was built using /MDd [Configuration Properties | C/C++ | Code Generation | Runtime Library = Multi-threaded Debug DLL (/MDd)] and the executable was built /MTd with MFC as static library [Configuration Properties | C/C++ | Code Generation | Runtime Library = Multi-thread Debug (/MTd)]/[Configuration Properties | Advanced | Use of MFC = Use MFC in a Static Library]. 

The fix/workaround is to change the executable to use MFC as a shared library [Configuration Properties | Advanced | Use of MFC = Use MFC in a Shared DLL]

//end

Sunday, February 19, 2023

PowerShell Cheat sheet

 

PowerShell Cheat Sheet

While loop

while ($true) {
    Write-Host "Hello World"
}


Append to file

New-TimeSpan -Start @(Get-Process explorer)[0].StartTime | Out-File -Append -FilePath C:\tmp\log.txt


Keywords: PowerShell Quick Tips

REF:003


Installing QNX 6.4.1 on Ubuntu 20.04

Installing QNX 6.4.1 on Ubuntu 20.04 Install pre-requisites $: sudo dpkg --add-architecture i386 $: sudo apt update $: sudo apt install li...