ChrisGue
Posts: 93
Joined: Tue Feb 03, 2009 7:26 pm

Display a message box with OK - Canel, and on Cancel pressed exit the installation

Sat May 15, 2021 8:55 pm

I use: AI 14.1.1 enterprise

I want to do this:
1. search for a Registry key
2. if it exists, show a message box with OK and Cancel (in the wizard dialog stage after the searches)
3. When Cancel pressed, exit the installation


Step 1. and 2. are not problem
To show the message box I use the custom action 'Display message box'
But I do not manage to exit the installation when cancel is pressed, as it seems the return value of the message box is ignored.

The message box shall be displayed when the installation is started with the parameter /qr, as well.


Or I can add an additional dialog before the 'license agreement' dialog, but this is not shown when the installation is started with the option /qr
If it is possible to show a step even with /qr I would prefer this.

(I tried to show a message box via a Vbscript and by an attached exe file, but the message box is never shown in 'Wizard Dialog stage', only when I move the according custom action to Install Execution state)

Thank you, Chris

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

Re: Display a message box with OK - Canel, and on Cancel pressed exit the installation

Wed May 19, 2021 6:15 pm

Hello Chris,

I am not quite sure how you are trying to achieve this, because you did not mention.

However, please note that the installation is not automatically aborted when the "Cancel" button is pressed on the message box.

If you want to do so, you can proceed as it follows:

- right after your messagebox custom action, add an "ErrorMessage" custom action

- set the appropriate message for the user and set its' condition to:

BTN_PRESSED = "IDCANCEL"

where BTN_PRESSED is the property that stores the result of the messagebox custom action.

I have created, for your reference, a sample project that implements the steps presented above. Please find it below:
Chris Sample Project.aip
(12.55KiB)Downloaded 248 times

Hope this helps!

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

ChrisGue
Posts: 93
Joined: Tue Feb 03, 2009 7:26 pm

Re: Display a message box with OK - Canel, and on Cancel pressed exit the installation

Mon May 24, 2021 11:08 am

Thanks a lot. This is working fine now.

But how do I localize the texts displayed in the message/error boxes.
The context menu does not show the item 'Localization...'

ChrisGue
Posts: 93
Joined: Tue Feb 03, 2009 7:26 pm

Re: Display a message box with OK - Canel, and on Cancel pressed exit the installation

Mon May 24, 2021 11:41 am

I have added a message box wiht english and one with german texts, and added a condition with SystemLanguageID <> "1031" / SystemLanguageID = "1031"

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

Re: Display a message box with OK - Canel, and on Cancel pressed exit the installation

Tue May 25, 2021 3:21 pm

Hello Chris,

Thank you for your followup on this!

I am glad to hear it works as expected now.

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

Return to “Common Problems”