Emmanuel
Posts: 17
Joined: Fri Mar 05, 2021 4:01 pm

Automation : how to set an existing property?

Hello,

How to set an existing property? For example : ARPURLINFOABOUT

I tried the code below, but since the property ARPURLINFOABOUT already exists, we get an error...

Code: Select all

$objPropComp = $project.PropertyComponent
$PropARPURLINFOABOUT = $objPropComp.NewProperty("ARPURLINFOABOUT","https://www.advancedinstaller.com")   
Thank you for your help

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

Re: Automation : how to set an existing property?

Hello Emmanuel,

In order to achieve what you want, you can proceed as it follows:

Code: Select all

$aboutProp = $proj.PropertyComponent.FindProperty("ARPURLINFOABOUT")
$aboutProp.value = "your_value_here"
Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Emmanuel
Posts: 17
Joined: Fri Mar 05, 2021 4:01 pm

Re: Automation : how to set an existing property?

Thank you Catalin!
Catalin
Posts: 6582
Joined: Wed Jun 13, 2018 7:49 am

Re: Automation : how to set an existing property?

You are always welcome, Emmanuel!

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

Return to “Building Installers”