alext72
Posts: 8
Joined: Fri Nov 18, 2016 9:56 am

Powershell Automation - Control Panel Icon

Tue Mar 23, 2021 5:43 pm

Hello,

Currently trying to automate packages creation with powershell and the Advanced Installer com object.
Everything is fine but one thing is missing, the ability to define the control panel icon under Product Detail


I have created the project under "Architect mode"
$project = $advinst.CreateProjects("architect")

The only properties available for the object "$project.ProductDetails" are :
Name
ProductCode
Publisher
RegisterWithWindowsInstaller
UpgradeCode
Version

Am I missing something ?
Could it be a feature request ?

Cheers

Catalin
Posts: 4206
Joined: Wed Jun 13, 2018 7:49 am

Re: Powershell Automation - Control Panel Icon

Tue Mar 23, 2021 8:06 pm

Hello Alex,

Unfortunately, this is currently not possible through our PowerShell Automation support.

I have, however, added this on our TODO list of improvements and it will be added in a future version of Advanced Installer. Thank you for bringing this to our attention!

In the meantime, I believe you can use our command line support:

Set Control Panel Icon Command

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

alext72
Posts: 8
Joined: Fri Nov 18, 2016 9:56 am

Re: Powershell Automation - Control Panel Icon

Wed Mar 24, 2021 11:03 am

Thanks, it's working great.
I'm also trying to create a shortcut under [ProgramMenuFolder][ProductName]

For Desktop folder i've followed the tutorial, referencing "desktopfolder"
$project.ShortcutsComponent.CreateFileShortcuts("desktopfolder", $exeFile.Fullpath))

What's the special word for [ProgramMenuFolder][ProductName] and how I can find the exhaustive list of folders ?

alext72
Posts: 8
Joined: Fri Nov 18, 2016 9:56 am

Re: Powershell Automation - Control Panel Icon

Wed Mar 24, 2021 4:59 pm

Also, since powershell doesn't have a control panel ico property, if I use the command line to set this property I can't build the project with the powershell build method. I must stick to the command line to also build the project. If it's builded with PS the icon is not displayed even if it's present in the aip file.

And if you plan to update powershell automation, it would be also great to be able to pass an ico file to the CreateFileShortcut method
https://www.advancedinstaller.com/user- ... onent.html
as it can be done via command line :
https://www.advancedinstaller.com/user- ... rtcut.html

Catalin
Posts: 4206
Joined: Wed Jun 13, 2018 7:49 am

Re: Powershell Automation - Control Panel Icon

Mon Mar 29, 2021 5:07 pm

Hello Alex,
Thanks, it's working great.
You are always welcome!

I am glad it works as expected.
... how I can find the exhaustive list of folders?
You might find the "Paths of the folders in the Files and Folders page" article useful.

Regarding your request:
And if you plan to update powershell automation, it would be also great to be able to pass an ico file to the CreateFileShortcut method
Please note that this is possible.
ShortcutIcon.png
ShortcutIcon.png (31.27 KiB) Viewed 4222 times

Later edit:

In addition to the article I've linked above, please note you can get a list of the predefined folders like this as well:

Code: Select all

$advinst = new-object -comobject AdvancedInstaller

# load some project

$project = $advinst.LoadProject("path")
$project.PredefinedFolders.<here_you_can_surf_using_TAB>

# or you can simply enter $project.PredefinedFolders in the terminal and press Enter
PredefinedFolders.png
PredefinedFolders.png (143.74 KiB) Viewed 4221 times
Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Catalin
Posts: 4206
Joined: Wed Jun 13, 2018 7:49 am

Re: Powershell Automation - Control Panel Icon

Mon Apr 26, 2021 5:55 pm

Hello,

This improvement (adding the Control Panel icon) has been added in Advanced Installer 18.2, released on April 23rd, 2021.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

alext72
Posts: 8
Joined: Fri Nov 18, 2016 9:56 am

Re: Powershell Automation - Control Panel Icon

Thu May 27, 2021 3:14 pm

Catalin wrote:
Mon Apr 26, 2021 5:55 pm
Hello,

This improvement (adding the Control Panel icon) has been added in Advanced Installer 18.2, released on April 23rd, 2021.

Best regards,
Catalin
Hello Catalin,

Thanks for the info. I'm currently running the Version 18.2 (DE2BF547).
How do you add the control panel icon info ?
The only sub properties available for the property .ProductDetails are :
.Name
.ProductCode
.Publisher
.RegisterWithWindowsInstaller
.UpgradeCode
.Version

I've not found the information in the documentation https://www.advancedinstaller.com/user- ... ation.html

Catalin
Posts: 4206
Joined: Wed Jun 13, 2018 7:49 am

Re: Powershell Automation - Control Panel Icon

Thu May 27, 2021 4:51 pm

Hello Alex,

Here is how you could set the icon:

Code: Select all

$advinst = new-object -comobject AdvancedInstaller
$project = $advinst.loadproject("PATH_TO_PROJECT")
$project.ProductDetails.SetIcon("PATH_TO_ICON")
$project.save()
Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

alext72
Posts: 8
Joined: Fri Nov 18, 2016 9:56 am

Re: Powershell Automation - Control Panel Icon

Fri May 28, 2021 8:20 am

Thanks for your quick answer Catalin,

It works now, I was looking for a property rather than a method... My bad. :oops:

Catalin
Posts: 4206
Joined: Wed Jun 13, 2018 7:49 am

Re: Powershell Automation - Control Panel Icon

Fri May 28, 2021 9:17 am

You are always welcome, Alex!

I am glad everything works as expected now. :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”