#Requires -RunAsAdministrator

function SafeSaveShortcut($FullName, $Shortcut) {
	$WasReadonly = (Get-ChildItem -Path $FullName).IsReadOnly

	try {
		if ($WasReadOnly) {
			Set-ItemProperty -Path $FullName -Name IsReadOnly -Value $false
		}

		$Shortcut.Save()

		Write-Host "Updated the shortcut $FullName"
	}
	catch {
		Write-Host "Failed to rewrite shortcut: $_"
	}
	finally {
		if ($WasReadOnly -And (-Not (Get-ChildItem $FullName).IsReadOnly)) {
			Set-ItemProperty -Path $FullName -Name IsReadOnly -Value $true
		}
	}
}

function UpdateShortcuts($TaskBarPath, $RdmExePath, $IsRdmLauncher) {
	$WScriptShell = New-Object -ComObject WScript.Shell
	$UpdatedShortcuts = $false

	Write-Host "Checking for taskbar pins in $TaskBarPath..."

	Get-ChildItem $TaskBarPath -Filter '*.lnk' | ForEach-Object {
		try
		{
			$Shortcut = $WScriptShell.CreateShortcut($_.FullName)

			if (-Not $IsRdmLauncher) {
				if ($Shortcut.TargetPath -Like "*RemoteDesktopManager*.exe") {
					$Shortcut.TargetPath = $RdmExePath.FullName
					$Shortcut.IconLocation = "$($RdmExePath.FullName),0"
					SafeSaveShortcut $_.FullName $Shortcut
					$UpdatedShortcuts = $true
				}
			} else {
				if ($Shortcut.TargetPath -Like "*Devolutions*Launcher.exe") {
					$Shortcut.IconLocation = "$($RdmExePath.FullName),0"
					SafeSaveShortcut $_.FullName $Shortcut
					$UpdatedShortcuts = $true
				}
			}
		}
		catch
		{
			Write-Host "Failed to rewrite shortcut: $_"
		}
	}

	return $UpdatedShortcuts
}

function RestoreTombstonedShortcuts($TombstonePath, $IsRdmLauncher) {
	$WScriptShell = New-Object -ComObject WScript.Shell
	$RestoredShortcuts = $false

	Write-Host "Restoring tombstoned taskbar pins..."

	Get-ChildItem $TaskBarTombstonePath -Filter '*.lnk' | ForEach-Object {
		try
		{
			$Shortcut = $WScriptShell.CreateShortcut($_.FullName)
			$RestoreShortcut = (($IsRdmLauncher -And ($Shortcut.TargetPath -Like "*Devolutions*Launcher.exe")) -Or ($Shortcut.TargetPath -Like "*RemoteDesktopManager*.exe"))
			
			if ($RestoreShortcut) {
				Move-Item -Path $_.FullName -Destination $_.Directory.Parent.FullName
				$RestoredShortcuts = $true
			}
		}
		catch
		{
			Write-Host "Failed to restore tombstoned shortcut: $_"
		}
	}

	return $RestoredShortcuts
}

$RdmBasePath = if ($PSScriptRoot) { $PSScriptRoot } else { Get-Location }
Write-Output "RDM Base Path: '$RdmBasePath'"

$RdmExePath = Get-ChildItem -Path "$RdmBasePath\RemoteDesktopManager.exe" | Select-Object -First 1

if (-Not $RdmExePath) {
	$RdmExePath = Get-Item -Path "$RdmBasePath\Launcher.exe"
	$IsRdmLauncher = $true
}

if (-Not (Test-Path $RdmExePath)) {
	throw "Could not find RDM executable in '$RdmBasePath'"
}

Write-Output "RDM Executable: '$RdmExePath'"

$Arm64 = $false

$Wow64Helper = @"
using System;
using System.Runtime.InteropServices;

public static class Wow64Helper {
    [DllImport("kernel32.dll", SetLastError = true)]
    public static extern bool IsWow64Process2(
        IntPtr hProcess, 
        out ushort pProcessMachine, 
        out ushort pNativeMachine
    );
}
"@

try
{
	Add-Type -TypeDefinition $Wow64Helper
	$Process = Get-Process -Id $PID
	$Handle = $Process.handle
	[System.UInt16]$ProcessMachine = 0
	[System.UInt16]$NativeMachine = 0
	$Result = [Wow64Helper]::IsWow64Process2($handle, [ref]$ProcessMachine, [ref]$NativeMachine)

	if ($Result) {
		Write-Host ("Native Machine: 0x{0:X}" -f $NativeMachine)
		$Arm64 = ($NativeMachine -Eq 0xAA64)
	} else {
		$ErrorCode = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error()
		Write-Host "IsWow64Process2 failed with error code $ErrorCode"
	}
}
catch
{
	Write-Host "Failed to check architecture with Win32: $_"

	if ([System.Environment]::Is64BitOperatingSystem)
	{
		if (($Env:PROCESSOR_ARCHITECTURE -eq 'ARM64') -or ($Env:PROCESSOR_ARCHITEW6432 -eq 'ARM64'))
		{
			$Arm64 = $true
		}
	}
}

if ($Arm64)
{
	Write-Host "Enabling Windows ARM64 native execution"

	$Executables = @($RdmExePath)
	foreach ($Executable in $Executables)
	{
		$LeafName = [IO.Path]::GetFileNameWithoutExtension($Executable)
		$LeafName += "_ARM64.exe"
		$ArchExecutable = Join-Path -Path $RdmBasePath -ChildPath $LeafName

		if (-Not (Test-Path $ArchExecutable)) {
			throw "Could not find executable in '$ArchExecutable'"
		}

		Write-Output "Replacing '$Executable' with '$ArchExecutable'..."
		Copy-Item -Path $ArchExecutable $Executable -Force
	}
}

Write-Host "Updating taskbar pinned shortcuts"

Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' |
	Where-Object { $_.PSChildName.StartsWith('S-1-5-21-') } | ForEach-Object {
		try
		{
			$ProfileImagePath = $_ | Get-ItemPropertyValue -Name 'ProfileImagePath'
			$TaskBarPath = Join-Path $ProfileImagePath "AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"
			$TaskBarTombstonePath = Join-Path $TaskBarPath "Tombstones"
			
			$UpdatedShortcuts = UpdateShortcuts $TaskBarPath $RdmExePath $IsRdmLauncher

			if (-Not $UpdatedShortcuts -And (Test-Path -Path $TaskBarTombstonePath)) {
				$UpdatedShortcuts = RestoreTombstonedShortcuts $TombstonePath $IsRdmLauncher

				if ($UpdatedShortcuts) {
					UpdateShortcuts $TaskBarPath $RdmExePath $IsRdmLauncher
				}
			}
		}
		catch 
		{
			Write-Host "Failed to get ProfileImagePath: $_"
		}
	}

$SHChangeNotify = @'
  [System.Runtime.InteropServices.DllImport("Shell32.dll")] 
  private static extern int SHChangeNotify(int eventId, int flags, IntPtr item1, IntPtr item2);

  public static void Refresh()  {
      SHChangeNotify(0x8000000, 0x1000, IntPtr.Zero, IntPtr.Zero);
  }
'@

try
{
	Add-Type -MemberDefinition $SHChangeNotify -Namespace WinAPI -Name Explorer
	[WinAPI.Explorer]::Refresh()
}
catch
{
	Write-Host "Fail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