xObay
Posts: 21
Joined: Sat Jan 06, 2024 4:56 pm

Shortcut Icon using PowerShell

Mon Jan 22, 2024 1:33 am

Hello,

How do you set the shortcut icon under Resources --> Shortcuts --> Display --> Icon using PowerShell or any other command line?

Regards,
Obay

Liviu
Posts: 1026
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Shortcut Icon using PowerShell

Fri Jan 26, 2024 1:39 pm

Hello Obay,

If I understand correctly, you want to change the icon of a shortcut.

To achieve this, you can use a PowerShell command as below:

Code: Select all

$advinst = New-Object -ComObject AdvancedInstaller
$project = $advinst.LoadProject("D:\PS support\sample.aip")

$shortcut = $project.ShortcutsComponent.Shortcuts[0]
$shortcut.Name
$shortcut.FullPath

$shortcut.Icon("D:\PS support\applogoicon.ico")

$project.Save()

Hope this helps!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”