#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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