We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

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

Reference Manufacturer and ProductName variables in powershell custom action script

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

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

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

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

You are always welcome!

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

Return to “Common Problems”