Veverke
Posts: 7
Joined: Tue Oct 13, 2020 8:54 am

Reference Manufacturer and ProductName variables in powershell custom action script

Sun Jun 04, 2023 10:16 am

Hi, I need to manipulate some files maintained by my app in order to support migrating it to a version with a breaking feature.
In order to do that, I need to reference the installation folder (defined by Manufacturer variable) and app folder (ProductName variable) so I can access them.

I am yet to succeed doing so.
Have tried:

$manufacturer=[Environment]::GetEnvironmentVariable('Manufacturer')
Write-Output "Manufacturer variable: [$manufacturer]" > $logPath
Write-Output "Manufacturer variable: $env:Manufacturer > $logPath
The same for ProductName.

Not working.
How should I be doing this ?

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

Re: Reference Manufacturer and ProductName variables in powershell custom action script

Wed Jun 07, 2023 12:01 pm

Hello,

In order to retrieve a property's value in PowerShell, here's how you can proceed:

Code: Select all

$manufacturer = AI_GetMsiProperty Manufacturer
How to set an installer property using custom actions

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


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

Re: Reference Manufacturer and ProductName variables in powershell custom action script

Tue Jun 27, 2023 4:18 pm

You are always welcome!

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

Return to “Common Problems”