mumbles76
Posts: 29
Joined: Mon Nov 16, 2015 7:29 pm

Powershell Custom actions that write to Install Log

Tue Feb 23, 2016 10:23 pm

Hello All,

Is there a way within a powershell custom action to write to the install log?

I hadn't thought about writing directly to the install log until recently when trying to debug a particular scenario.

TIA.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Powershell Custom actions that write to Install Log

Wed Feb 24, 2016 12:24 pm

Hello,

I'm afraid currently we don't have support for this request. We added your request on our TODO list and hopefully such an improvement will be available in a future version of Advanced Installer. Thank you for your suggestion.

Until then, as a workaround, you can do that by calling a VBS log script within your PowerShell script.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

mmichal
Posts: 2
Joined: Thu Mar 24, 2016 12:36 am

Re: Powershell Custom actions that write to Install Log

Thu Mar 24, 2016 12:38 am

I second this, having this feature would be nice.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Powershell Custom actions that write to Install Log

Thu Mar 24, 2016 11:04 am

Hello,

I noted down your request too and hopefully this improvement will get a higher priority. We'll update this thread as soon as the improvement will be available.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Powershell Custom actions that write to Install Log

Thu Mar 22, 2018 9:02 am

Hello,

Our development team investigated this scenario and it seems you can write to the MSI installation log by simply using the "Write-Output" cmdlet into your PowerShell custom action code.

Hope this is still valuable help for you. Also, if you have any questions or doubts just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Nerdiculous
Posts: 7
Joined: Tue Jul 28, 2020 9:23 pm

Re: Powershell Custom actions that write to Install Log

Tue Dec 08, 2020 10:24 pm

I tried the cmdlet "Write-Output" and it did not write to the log file.

Can Advanced Installer please give an example of how this works for the development team as stated in the previous post?

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

Re: Powershell Custom actions that write to Install Log

Mon Dec 14, 2020 6:14 pm

Hello,

I have tested this just now and everything seemed to be working as expected.
Can Advanced Installer please give an example of how this works for the development team as stated in the previous post?
The only thing that you need to do is to add the "Write-Output" cmdlet to your PowerShell custom action, e.g.:
PSCA.png
PSCA.png (79.22KiB)Viewed 5596 times

After doing so, you should launch the MSI with a command line as it follows:

Code: Select all

msiexec /i <path_to_msi> /L*V <path_to_log>
e.g.:
MSICMD.png
MSICMD.png (18.07KiB)Viewed 5596 times

In the log file, you should be able to find the output of the cmdlet, e.g.:
outputCA.png
outputCA.png (187.86KiB)Viewed 5596 times

Hope this helps!

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

Return to “Building Installers”