diff --git a/scripts/Common/Scripts/System.ps1 b/scripts/Common/Scripts/System.ps1 index 71805ef5..2fa7db88 100644 --- a/scripts/Common/Scripts/System.ps1 +++ b/scripts/Common/Scripts/System.ps1 @@ -30,6 +30,27 @@ function Remove-DesktopIcon { } } +<# + .SYNOPSIS + Adds a new shortcut to the start menu. + + .PARAMETER Name + The name of the icon to create. + + .PARAMETER Target + The file to link to. +#> +function Add-StartMenuIcon { + param( + [string] $Name, + [string] $Target + ) + + Import-Module KnownFolders; + Import-Module "$env:ChocolateyInstall/helpers/chocolateyInstaller.psm1"; + Install-ChocolateyShortcut -ShortcutFilePath "$((Get-KnownFolder "Common Programs").Path)/$Name.lnk" -TargetPath ((Get-Item $Target).FullName); +} + <# .SYNOPSIS Removes icons from the task bar. diff --git a/scripts/Windows/Software/RetroArch/Manage.ps1 b/scripts/Windows/Software/RetroArch/Manage.ps1 index 2667782c..578b6521 100644 --- a/scripts/Windows/Software/RetroArch/Manage.ps1 +++ b/scripts/Windows/Software/RetroArch/Manage.ps1 @@ -4,12 +4,14 @@ param( ) . "$PSScriptRoot/../../../Common/Scripts/Software.ps1"; +. "$PSScriptRoot/../../../Common/Scripts/System.ps1"; Start-SoftwareInstaller @PSBoundParameters ` -Installer { Install-ChocoPackage retroarch; - # ToDo: Add start menu shortcut - # ToDo: Add function for this purpose + } ` + -Configurator { + Add-StartMenuIcon "RetroArch" "C:\tools\RetroArch-Win64\retroarch.exe"; }; # ToDo: Add restoration