Windows 10 UWP apps launch and then disappear immediately

Solution 1:

One way to resolve this problem is to register the applicable UWP Provisioned Windows apps, and each of those applications' dependencies. Below is some PowerShell logic that is run while logged on as a user account experiencing the problem, with a login script, etc. and fixes the issue.

Note: This may only need to be run once to resolve this problem for others, my situation may be more on the unique side than the norm.

I confirmed that this PowerShell solution fixes this with at least two UWP apps (e.g. Calc and Photos). I figured out the PowerShell after looking over some of the logic in the Program.cs on GitHub here after confirming a run of the RegAllAppX.exe located there also resolves the problem.

The execution of that executable file on GitHub takes way too long to run, in my case at least as it needs run at every logon of the account with the problem as it gets a new profile each time it logs onto Windows 10 automatically. I think DelProf2 is not wiping the profile properly and causing the problem but a more native solution is on the back burner for now but may come in the future.

Looking over some of the logic in the Program.cs code you can research, test, and translate to equivalent PowerShell logic to perform similar operations in a more targeted and efficient manner for the specific UWP apps that experience the problem.

PowerShell

$Apps = @("WindowsCalculator","Photos");

$base   = @();
$depend = @();
$Apps | %{
    $base   += $base   = (Get-AppxPackage -Name "*$_*").InstallLocation;
    $depend += $depend = (Get-AppxPackage -Name "*$_*").Dependencies.InstallLocation;
    };

$Apps = (($base + $depend) | Sort -Unique);
$Apps | %{Add-AppxPackage -Path "$_\Appxmanifest.xml" -Register -DisableDevelopmentMode};

Supporting Resources

  • Arrays
  • ForEach-Object

    Standard Aliases for Foreach-Object: the '%' symbol, ForEach

  • Get-AppxPackage

  • Add-AppxPackage

    • You can use the Register parameter to install from a folder of unpackaged files during development of Windows® Store apps

    • You can use DisableDevelopmentMode to register an application that is staged by the StagePackageAsync API, has been disabled, or has become corrupted during testing.

  • About Assignment Operators

    +=: Increases the value of a variable by the specified value, or appends the specified value to the existing value.

  • Sort-Object

    Standard Aliases for Set-Alias: sort

  • PackageManager Class