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!

EllosGroup
Posts: 8
Joined: Thu Jul 24, 2014 4:19 pm

Problem getting a property through a inline Powershell script

Hello,

I'm recieving the error below when trying to get a property through a Powershell inline script Custom Action. Setting the property works fine.

I'm using AI_GetMsiProperty COMPANY. I've tried this at different points in the sequence and also with or without storing it to a variable.

Code: Select all

AI_MsiGetProperty : The term 'AI_MsiGetProperty' is not recognized as the name of a cmdlet, function, script file, or 
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try 
again.
At C:\Users\el23903\AppData\Local\Temp\pssB7CD.ps1:53 char:1
+ AI_MsiGetProperty COMPANY;
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (AI_MsiGetProperty:String) , CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
What's wrong?

Regards,
Carl
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Problem getting a property through a inline Powershell script

Hello Carl,

I've tested the "AI_GetMsiProperty" functionality and it seems the PowerShell script execution fails indeed when no new line character is added after the "AI_GetMsiProperty" line:

Code: Select all

$prop = AI_GetMsiProperty COMPANY
This is and Advanced Installer issue and a fix will be available in a future version of AI. Thank you for bringing this to our attention. We will notify you when the fix will be out.

Until then, as a workaround, you should add at least a new line character after the "AI_GetMsiProperty COMPANY" line like this:

Code: Select all

$prop = AI_GetMsiProperty COMPANY

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Problem getting a property through a inline Powershell script

Hello,

This was fixed in version 12.7 of Advanced Installer released on February 4th, 2016.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”