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!

jmoleary
Posts: 53
Joined: Mon May 13, 2019 7:30 pm

My Custom Action Dialog is hidden by my installer window

I am trying to use the custom action "Run a PowerShell inline script" to make my installer pop up a warning dialog. The boiler plate code that gets added gives me the ability to show a dialog and it works just fine except for one problem: The dialog pops up behind my installer window. I didn't realize this and thought the installer had hung. It was only when I moved it that I saw the dialog.

How can I make the dialog appear in front?

Here is the code to show the dialog that AI put into the task when I created it

Code: Select all

  # When testing or debugging your script, you can quickly display a message box
  [System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')
  [System.Windows.Forms.MessageBox]::Show($helloMessage)
I've looked up the documentation for

Code: Select all

 System.Windows.Format.MessageBox.Show
and there do seem to be many overloads. But about the only parameter I can see in those overloads that might let me specify a parent window is the

Code: Select all

IWin32Window 
interface argument. I don't think I have access to that in my script.
jmoleary
Posts: 53
Joined: Mon May 13, 2019 7:30 pm

Re: My Custom Action Dialog is hidden by my installer window

I should add that when I changed the custom Action's "Execution Time" setting from "Immediately to "When the system is being modified (deferred)", the dialog started appearing on top
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: My Custom Action Dialog is hidden by my installer window

Hello,

I have tried testing this just now and it looks like the PowerShell messagebox is displayed on top.

However, I remember this being reported in the past as well (or something similar). Unfortunately, it looks like the behavior can not really be predicted/controlled (i.e. sometimes the messagebox is displayed in the background, sometimes it is displayed in the foreground).

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

Return to “Building Installers”