I have a custom Dialog (SelVer), where the User will select (via checkbox), which version of an application they already have installed. Using a custom PowerShell script I am able to verify if this application is truly installed:
If ((AI_GetMsiProperty CHECKBOX_APP_PROP -eq "CheckBox") -and (AI_GetMsiProperty APP_INSTALL_PATH -eq ""))
{
[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')
[System.Windows.Forms.MessageBox]::Show('The APP was not found. Close this window and select an App version that is currently installed.','APP Validation Error!','OK','ERROR')
}
This works as written, however when the User clicks on the ‘OK’ button of the Windows.Forms.MessageBox I want them to remain on the SelVer Dialog where they were selecting the APP version. Currently, it sequentially moves on to the next Dialog. I need to have them remain on the current Dialog so they cannot proceed with the install until they select the proper App version or press CANCEL.
So my question is does PowerShell have code to manipulate the ‘OK’ button to go to a specific Dialog much like Advanced Installer has?
If this is not possible, my only other thought was to create a custom Dialog which essentially would work like an ErrDlg. That way I may be able to have it revert/stay on the SelVer Dialog using an Event. But I am not having luck in getting the conditions to work to have the custom Dialog appear. I am not even sure if I can use a Dialog in this manner?
In my custom SelVer Dialog for the NEXT button, I have under the Published Events tab I created a new Event with the Argument choosing SpawnWaitDialog and using the following Condition below:
CHECKBOX_P3D_PROP = "CheckBox" AND APP_INSTALL_PATH = ""
But no luck in having the message window to appear. Any help would be most appreciated.
Oh, another quick question... can a Dialog be a Property (thinking powershell code here).
Happy Holidays
Marcus
FOLLOW US
Get the latest news in Application Packaging