Deepak Singh
Posts: 13
Joined: Tue May 12, 2020 12:05 pm

Change error message string in the ErrorDlg

Hi,

I have added a custom action to launch a batch file, and selected the option Fail installation if custom action returns an error. Refer the image below.
1. Launch File condition.png
1. Launch File condition.png (146.16 KiB) Viewed 8551 times
.

When custom action returns an error the following dialog is displayed by the installer.
3. Error Message when bat fails.png
3. Error Message when bat fails.png (4.53 KiB) Viewed 8551 times
Can we add our own custom error message instead of the default error message displayed in the image above?

Thank you!
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Change error message string in the ErrorDlg

Hello,

Those error messages are predefined messages offered by the Windows Installer technology.

Windows Installer Error Messages

For instance, the message you are getting is from:
Error 1722:

There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action [2], location: [3], command: [4]
Unfortunately, I am afraid it is not possible to add a custom error message for your custom action, as this is all handled by Windows Installer.

It is, however, possible to modify that message. Please note, though, that the message should be a generic one since all the custom actions that will fail with the error 1722 will return that message.

To do so, you can go to "Table Editor" page --> "Error" table and modify the message for the "Error 1722".

To achieve the above, an Enterprise (or above) license type is required.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Deepak Singh
Posts: 13
Joined: Tue May 12, 2020 12:05 pm

Re: Change error message string in the ErrorDlg

Hi Catalin,

I am able to add the custom message by modifying the error message through the Table Editor, since there is only one custom action in the package so need not to worry about other custom actions.

Thanks for the help.
Deepak Singh
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Change error message string in the ErrorDlg

You are always welcome, Deepak!

I am really glad you got this working.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Deepak Singh
Posts: 13
Joined: Tue May 12, 2020 12:05 pm

Re: Change error message string in the ErrorDlg

Hi Catalin,

I am working on localizing the custom dialogs and strings that I have added into the Installer. If I keep the default error message for the error code 1722 as it is then the text changes to the system defined locale format when I apply translation, but if I modify the error message to my custom error message then even for other locale the string/message is displayed in the English language. Do you have any suggestion on the same?

Thanks and Regards!
Deepak Singh
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Change error message string in the ErrorDlg

Hello Deepak,

I have tried reproducing this behavior, but unfortunately I was not able to do so. Here is how I've tested this:

- create a new project

- add a new language to it (e.g. French)

- checked the "Create only a multilingual package" and the "Automatically use the current user language for installation" options

- add a test text control in "Dialogs" page, in a newly created dialog (e.g. "Hello, how are you?")

- I have added the translation for this string in the "Project Strings" tab of the "Translations" page

- at this point, I have run the installation and the string was correctly translated

- I have now changed the message for error 1722 and rebuilt the project

- upon running the project, I noticed that the string is still translated as expected

In order for me to further investigate this, could you please give me a test-case which I can follow in order to reproduce this issue on our end?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Deepak Singh
Posts: 13
Joined: Tue May 12, 2020 12:05 pm

Re: Change error message string in the ErrorDlg

Hi Catalin,

First I have added the Chinese(Simplified, PRC) localized string for the error message 1722 in project strings tab of translation page refer the image below:
4. Translation page.png
4. Translation page.png (52 KiB) Viewed 8509 times
Actually this error message pops up whenever there is an error in custom action created in the project.
On runtime the error string doesn't change which was expected it would change and the English version of the string is displayed.
Refer the image below.
6. Custom action fails.png
6. Custom action fails.png (14.88 KiB) Viewed 8509 times
I have tried the same scenario with French translation as well, but the result is same the English error message string is displayed.
Are there any other steps/settings required apart from adding the message for different language into the projects strings tab?
Can you share your approach which you followed to localize the error message for error code 1722?

Thanks and Regards!
Deepak Singh
Deepak Singh
Posts: 13
Joined: Tue May 12, 2020 12:05 pm

Re: Change error message string in the ErrorDlg

Hi Catalin,

I am sharing you a sample project in which I have created to add translation string of error message with code 1722.
Please refer the project and let me know if you find any changes which can be applied to this project so as to display the customized error message as per user's current language.
Demo_AIP_20May2020.zip
(13.37 KiB) Downloaded 410 times
I tried to attach the msi but the fill is too large so it didn't get uploaded. You can build this project at your end and check for the localization of the error message for the error code 1722.

Thanks and Regards !
Deepak Singh
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Change error message string in the ErrorDlg

Hi Deepak,

Changing the text of the error directly in the "Table Editor" works only when you have a single-language project. If you have more languages in your project, you need to follow the steps below:
- revert the value from the "Error" table
- set the desired translation in the "Default Strings" tab and save the changes
- re-open and re-build the project

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Deepak Singh
Posts: 13
Joined: Tue May 12, 2020 12:05 pm

Re: Change error message string in the ErrorDlg

Hi Eusebieu,

If I revert the Error message to default I am able to get the translation correctly in other languages but the error message which I customized is now replaced by default message for English translation i.e. either I can customize the error message(error 1722) in single (English) language or I have to go with the default error message for English and change the default string for different translation right? Can I add the message for English translation as well so that instead of using the default error message for English, it should display the customized message for English as well. Without modifying the Table Editor can we assign customized value for English translation as well?

Thanks and regards,
Deepak
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Change error message string in the ErrorDlg

Hi Deepak,

Yes, the English text can be also customized in the "Default Strings" tab.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”