param(
    [Parameter(Mandatory=$true)]
    [string]$InstallDir
)
$ErrorActionPreference = 'Stop'
$shell = New-Object -ComObject WScript.Shell
$desktop = [Environment]::GetFolderPath('Desktop')
$startMenu = Join-Path $env:APPDATA 'Microsoft\Windows\Start Menu\Programs'
$target = Join-Path $InstallDir 'ELLOS_3D_Mapping_Control_Offline.exe'
$icon = Join-Path $InstallDir 'ellos_app.ico'
$shortcutPaths = @(
    (Join-Path $desktop 'ELLOS Control Mapping Pro.lnk'),
    (Join-Path $startMenu 'ELLOS Control Mapping Pro.lnk')
)
foreach ($path in $shortcutPaths) {
    $shortcut = $shell.CreateShortcut($path)
    $shortcut.TargetPath = $target
    $shortcut.WorkingDirectory = $InstallDir
    if (Test-Path $icon) { $shortcut.IconLocation = "$icon,0" }
    $shortcut.Description = 'ELLOS Control Mapping Pro - Desktop App'
    $shortcut.Save()
}
