Hello Roman and welcome to Advanced Installer forums,
Yes, that is possible. I am not sure what kind of custom action you have created for this task, but here you can find a PowerShell script that calls the ShowDialog() method from within the [System.Windows.Forms] assembly:
Code: Select all
Add-Type -AssemblyName System.Windows.Forms
$string = 'Hello there, how are you?'
$saveDlg = New-Object -Typename System.Windows.Forms.SaveFileDialog
$saveDlg.ShowDialog()
$string | Out-File $saveDlg.FileName
This can be easily implemented in your project by following these steps:
- go to "Custom Actions" and add a "PowerShellScriptInline" custom action without sequence. In order to add a custom action without sequence, simply press the "Add custom action without sequence" button which is placed to the right side of the custom action's name.
- now please copy paste the above code under the "Your code goes here." comment.
- the last thing that needs to be done is to show the dialog control (button) that will trigger this custom action. For instance, you can go to "Dialogs" page --> click on WelcomeDlg dialog --> click on the "Next" button --> under "Published Events" click "New..." in order to create an event as it follows:
Event: Execute custom aciton
Argument: PowerShellScriptInline
Condition: leave default
Now please schedule this event before the "Display a specific dialog" event. To do so, simply press on your event and then press the "Up" button which can be found on the right side.
Also, for your reference, please find attached to this thread a sample project I have created:
Hope this helps.
All the best,
Catalin