Overview
This knowledge base will demonstrate on how to get Microsoft Photo apps working. Microsoft released a major update where Microsoft forgot to add the dependency of Windows App SDK, where more is covered Microsoft Photos: Migrating from UWP to Windows App SDK - Windows Developer Blog.
Steps
1. Prepare the following scripts which is broken down into Install.ps1 and Detect.ps1
Download the latest version of Windows App SDK 1.5.4, and place into the same folder as C:\Temp.
For Install.ps1
Under $Status, you will see the windowsappruntimeinstall-x64.exe where the -ArgumentLists is '--quiet'
<#
.SYNOPSIS
PowerShell script to bootstrap installations and configure applications for Intune
.DESCRIPTION
The script is designed to bootstrap the installation of and set configuration for apps in Intune
.PARAMETER
None
.INPUTS
None
.OUTPUTS
Transcript Log file stored in C:\Programdata\IntuneApps\<AppName>
.NOTES
Version: 1.0
Author: Bernard Mah - Devicie
Creation Date: 27/06/2024
Purpose/Change: Initial script development
.EXAMPLE
powershell.exe -noprofile -executionpolicy bypass -file .\AppInstaller.ps1
#>
# If we are running as a 32-bit process on an x64 system, re-launch as a 64-bit process
if ("$env:PROCESSOR_ARCHITEW6432" -ne "ARM64")
{
if (Test-Path "$($env:WINDIR)\SysNative\WindowsPowerShell\v1.0\powershell.exe")
{
& "$($env:WINDIR)\SysNative\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy bypass -NoProfile -File "$PSCommandPath"
Exit $lastexitcode
}
}
#Script Variables
$AppName = "Windows App SDK 1.5.4"
$AppDir = "$($env:ProgramData)\IntuneApps\$($AppName)"
$TagFile = "$($AppDir)\$($AppName).tag"
$Transscript = "C:\Temp\IntuneLogs\Install-$AppName"
$MSILog = "C:\Temp\IntuneLogs\Install-$AppName"
# Create log directory
if (-not (Test-Path $($AppDir)))
{
Mkdir $($AppDir)
}
# Start logging
Start-Transcript $Transscript
# Install App
$Status = (Start-Process "$($PSScriptRoot)\windowsappruntimeinstall-x64.exe" -ArgumentList '--quiet' -wait -PassThru).ExitCode
# Set Flag file for Intune Detection
if (($Status -eq 0) -or ($Status -eq 3010))
{
Set-Content -Path $TagFile -Value "Installed"
} else {
Write-Host "Install failed with error $($Status), check $($MSILog) for more information"
}
Stop-Transcript
Exit $Status
For Detect.ps1
As we want to detect the installation of Windows App SDK 1.5.4 installed, you can run the following in PowerShell like Get-AppxPackage "Microsoft.WinAppRunTime.DDLM.5001.159*" where this will provide what detection to put in the Detect.ps1.
In Detect.ps1
$provisionedPackageNames = @(
"MicrosoftCorporationII.WinAppRuntime.Singleton",
"MicrosoftCorporationII.WinAppRuntime.Main.1.5",
"Microsoft.WinAppRuntime.DDLM.5001.159.55.0-x6",
"Microsoft.WinAppRuntime.DDLM.5001.159.55.0-x8"
)
$provisionedPackageNames | ForEach-Object {
if (-not (Get-AppxPackage -Name $_ -AllUsers)) {
exit
}
}
Write-Host "All provisioned packages are installed."
2. It should now look like this.
3. Using the Intune Win32 App Package, upload the .intunewin file into Microsoft Intune.
4. Navigate to https://intune.microsoft.com/ then select Apps then select By platform: Windows then select Add.
5. Under Program, select the following:
Install command: %windir%\sysnative\windowspowershell\v1.0\powershell.exe -executionPolicy bypass -windowstyle hidden -file "./Install.ps1"
Uninstall command: uninstallcmdline
Installation time required (mins): 60
Allow available uninstall: Yes
Install behaviour: Yes
Device restart behaviour: Determine behaviour based on return codes
Then select Next.
6. Under Requirements, select the following:
Operating system architecture: 64-bit
Minimum operating system: Windows 10 1903
7. Under Detection rules, select 'Use a custom detection script' then select Next.
8. Under Dependencies, select Next.
9. Under Supersedence, select Next.
10. Under Assignments, select the required groups, then select Next.
11. Under Review + create, review the settings then select Create.
12. Then go to Company Portal, then select Settings then select Sync.
Then re-open the Microsoft Photo App, and it should work as appropriately.