alco
Posts: 79
Joined: Thu Nov 18, 2010 5:02 pm

Property value in localized property is not updated

Thu Nov 10, 2022 4:59 pm

I have a declared property called RELATEDPRODUCTFOUND_VERSION that is initially set to "0.0.0.0".
This property is used in another property called YourProperty that is set to "Downgrade from [|RELATEDPRODUCTFOUND_VERSION] to [|ProductVersion]?"
YourProperty is localized according to this guide.
Image
Image
A custom action sets RELATEDPRODUCTFOUND_VERSION to the detected installed version.
Another custom action, based on Display Message Box, uses YourProperty as the message.
But when this custom action runs, the property value of RELATEDPRODUCTFOUND_VERSION is not updated.
Image

Is this a bug? If not, what have I missed or done wrong? I'm using AI 19.8.1

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Property value in localized property is not updated

Fri Nov 11, 2022 1:51 pm

Hello,

Most likely, this happens because you are using a PseudoFormatted property, which is resolved at build time.

By default, properties referenced by PseudoFormatted ("[|propertyname]") field are resolved at build time. During installation only properties used in Formatted data fields are resolved.

During the installation you need to use only properties referenced by Formatted data types, for example "[ProductVersion]".

More details on our Windows Installer Formatted Type article.

Hope this helps! If you have any other questions, please don’t hesitate to contact us.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

alco
Posts: 79
Joined: Thu Nov 18, 2010 5:02 pm

Re: Property value in localized property is not updated

Tue Nov 15, 2022 12:56 pm

How to properly localize this then?

In editing the property value of YourProperty, the only way to reference a property is by PseudoFormatted format, so I suppose there's no way to reference a property that changes during installation. Is there no other way?

UPDATE:
As a workaround, I tried to duplicate the Display Message Box custom action so there's one for each ProductLanguage. This works for English (1033).
Image

Code: Select all

MSI (c) (3C:80) [20:09:44:856]: Doing action: FindXBC
Action 20:09:44: FindXBC. 
Action start 20:09:44: FindXBC.
...
Calling custom action CustomActionsCS!CustomActionsCS.CustomActions.FindRelatedProduct
MSI (c) (3C!80) [20:09:45:033]: Closing MSIHANDLE (187) of type 790531 for thread 25728
MSI (c) (3C!80) [20:09:45:080]: PROPERTY CHANGE: Adding RELATEDPRODUCTFOUND_PRODUCTCODE property. Its value is '{AB86837C-52A0-4589-9A0A-6709C0C8E2E5}'.
MSI (c) (3C!80) [20:09:45:081]: PROPERTY CHANGE: Modifying RELATEDPRODUCTFOUND_VERSION property. Its current value is '0.0.0.0'. Its new value: '4.4.2225.1004'.
MSI (c) (3C!80) [20:09:45:081]: PROPERTY CHANGE: Modifying RELATEDPRODUCTFOUND property. Its current value is '0'. Its new value: '-1'.
...
MSI (c) (3C:80) [20:09:45:093]: PROPERTY CHANGE: Modifying CustomActionData property. Its current value is '{535546C7-19BD-41C8-BC7C-76F9F5CE02C4}'. Its new value: 'Downgrade from 4.4.2225.1004 to 1.0.0? |Your Application Setup |MB_OKCANCEL,MB_ICONINFORMATION,MB_DEFBUTTON1|BTN_PRESSED|25148'.
Action ended 20:09:45: AI_DATA_SETTER_5. Return value 1.
MSI (c) (3C:80) [20:09:45:093]: Doing action: AskToUninstallNewerProduct_en
Action 20:09:45: AskToUninstallNewerProduct_en. 
Action start 20:09:45: AskToUninstallNewerProduct_en.
But for some reason, my custom actions are skipped when non-English is selected.

Code: Select all

MSI (c) (20:00) [20:10:12:607]: Skipping action: AI_DATA_SETTER_4 (condition is false)
MSI (c) (20:00) [20:10:12:607]: Skipping action: FindXBC (condition is false)
MSI (c) (20:00) [20:10:12:607]: Skipping action: AI_DATA_SETTER_5 (condition is false)
MSI (c) (20:00) [20:10:12:607]: Skipping action: AskToUninstallNewerProduct_en (condition is false)
MSI (c) (20:00) [20:10:12:607]: Skipping action: AI_DATA_SETTER_1 (condition is false)
MSI (c) (20:00) [20:10:12:607]: Skipping action: AskToUninstallNewerProduct_tw (condition is false)
MSI (c) (20:00) [20:10:12:607]: Skipping action: AI_DATA_SETTER_2 (condition is false)
MSI (c) (20:00) [20:10:12:607]: Skipping action: AskToUninstallNewerProduct_zh (condition is false)
MSI (c) (20:00) [20:10:12:607]: Skipping action: ErrorMessage (condition is false)

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Property value in localized property is not updated

Wed Nov 16, 2022 1:52 pm

Hello,
In editing the property value of YourProperty, the only way to reference a property is by PseudoFormatted format, so I suppose there's no way to reference a property that changes during installation. Is there no other way?
I just checked this and, indeed, properties referenced by Formatted data type are not supported.
As a workaround, I tried to duplicate the Display Message Box custom action so there's one for each ProductLanguage. This works for English (1033).
But for some reason, my custom actions are skipped when non-English is selected.
Can you please send us the .AIP (setup project) file so we can further investigate its' settings? You can attach the sample either here or you can send it by e-mail at support at advancedinstaller dot com.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

alco
Posts: 79
Joined: Thu Nov 18, 2010 5:02 pm

Re: Property value in localized property is not updated

Fri Nov 25, 2022 5:53 pm

Hi,

I just sent the AIP file via email. Sorry for the late reply.

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Property value in localized property is not updated

Tue Nov 29, 2022 11:08 am

Hello Albert,

I have replied to you over the email.

Let's continue the conversation there.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

alco
Posts: 79
Joined: Thu Nov 18, 2010 5:02 pm

Re: Property value in localized property is not updated

Thu Dec 01, 2022 10:38 am

Thank you, Liviu, for your help. The workaround is now resolved on our end.

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Property value in localized property is not updated

Fri Dec 02, 2022 9:11 am

You're always welcome, Albert!

Glad to hear it worked!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”