Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Execute PowerShell script as a build event

Mon Mar 07, 2022 9:38 am

Hello,

Although Advanced Installer has support for predefined operations executed as build events, you can also execute custom PowerShell scripts.


Build event.PNG
Build event.PNG (40.7KiB)Viewed 323815 times


It is a simple PowerShell script that displays a messagebox with the path where the folder is located.

Code: Select all

$workingPath = Get-Location

#Display current location in a message box
[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')
[System.Windows.Forms.MessageBox]::Show($workingPath)


The sample project is attached to this thread, so if you are interested to take a look directly at my project, you are more than welcome to download the ZIP file.

Best regards,
Dan
Attachments
Run PowerShell script pre-build event.zip
(3.07KiB)Downloaded 1789 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Sample Projects”