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

Automation : how to set an existing property?

Thu Mar 11, 2021 10:04 am

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: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Automation : how to set an existing property?

Mon Mar 15, 2021 9:18 pm

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?

Mon Mar 29, 2021 10:42 am

Thank you Catalin!

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

Re: Automation : how to set an existing property?

Mon Mar 29, 2021 4:39 pm

You are always welcome, Emmanuel!

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

Return to “Building Installers”