a.guelle
Posts: 97
Joined: Tue May 19, 2015 2:23 pm

[solved] Custom Action "Target" attribut and "TargetUnfomatted" attributes deliver wrong search results

Dear Advanced Installer team,

Custom actions are stored in the TargetUnformatted XML attribute of the XML tag <ROW/>. Somehow there is another attribte target that containes a previous version of the action...
Unfortunately the Advanced Installer search displays results from the "target" attribute instead of the "TargetUnfromatted" attribute, at least in my version 17.5.

Why do both attributes exist?
Why are not both attibutes updated when changing an action?

Best regards,

Angelo
Last edited by a.guelle on Mon Mar 11, 2024 2:22 pm, edited 1 time in total.
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Custom Action "Target" attribut and "TargetUnfomatted" attributes deliver wrong search results

Hello Angelo,

Unfortunately, I am not quite familiar with the two attributes you have mentioned.

If possible, could you please give me some more details (e.g. a step by step test case) so I can reproduce this on my end as well?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
a.guelle
Posts: 97
Joined: Tue May 19, 2015 2:23 pm

Re: Custom Action "Target" attribut and "TargetUnfomatted" attributes deliver wrong search results

Hi Catalin,

add a custom inline action with some VBS script. Then open your AIP file with an editor and search for your action. You will see the <ROW/> tag has two attributes containing your VBS script.

In the following example you can see the content of the custom action is doubled, but the "Target" attribute contains an older version of the script. In fact it always seems to be the content from the first creation.

Code: Select all

<ROW 
Action="MyCustomAction" 
Type="38" 
Target="&apos; Displays an error message if IS_SYSADMIN is not 1.&#13;&#10;&apos;&#13;&#10;&apos;&#13;&#10;&apos; @date 03-05-23&..." 
TargetUnformatted="&apos; Displays an error message if IS_SUPERUSER_MDAT is not &quot;1&quot;.&#13;&#10;&apos;&#13;&#10;&apos;&#13;&#10;&apos; @date 28-11-23&..." 
WithoutSeq="true"/>
Best regards,

Angelo
a.guelle
Posts: 97
Joined: Tue May 19, 2015 2:23 pm

Re: Custom Action "Target" attribut and "TargetUnfomatted" attributes deliver wrong search results

As you can see in the attached screenshot:

When searching for a date 01-02-17 Advanced installer finds the action "CheckIDAT_SQL_PASSWORD_PROP" because it searches in the "Target" attribute. But the actual date string is 19-02-24.
Attachments
2024-02-23_16h42_20.png
2024-02-23_16h42_20.png (209.26 KiB) Viewed 22197 times
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Custom Action "Target" attribut and "TargetUnfomatted" attributes deliver wrong search results

Hello Angelo,

Thank you very much for the explanation!

I think I understand your scenario now, but I'm afraid I'm not quite able to reproduce it.

So I have a VBScript message box with the following attributes:

Code: Select all

Target="Script Text" TargetUnformatted="msgbox(&quot;something&quot;)"
when I search for "something", it returns the correct result and it looks like the criteria is "TargetUnformatted"
Screenshot_111.png
Screenshot_111.png (51.28 KiB) Viewed 22193 times

If it were to look for the "Target" attribute, it would return nothing, or that's what I would expect, since "something" is not part of "Target".


Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
a.guelle
Posts: 97
Joined: Tue May 19, 2015 2:23 pm

Re: Custom Action "Target" attribut and "TargetUnfomatted" attributes deliver wrong search results

Hi Catalin,

thanx for checking this. What happens if you search for "Script"?

Best regards,

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

Re: Custom Action "Target" attribut and "TargetUnfomatted" attributes deliver wrong search results

Hello Angelo,

Indeed, when I search by "Script", it looks to look in the "Target" attribute.

The thing is I don't quite see why this would need an improvement here, as I can't imagine a scenario where the two would interract and pose a problem.

Could you please let me know a combination of old script content (Target attribute) and new script content (TargetUnformatted attribute) that would pose problems when it comes to the "Search" functionality?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
a.guelle
Posts: 97
Joined: Tue May 19, 2015 2:23 pm

Re: Custom Action "Target" attribut and "TargetUnfomatted" attributes deliver wrong search results

Hi Catalin,

in our case the target attribute does not contain "Script Text" but the whole script from the first time the action was created. This might be a legacy bug in AI installer.

Can you figure out what the target tag should normally conatin? I would then run a regular expression exchanger over the AIP file.

Best regards,

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

Re: Custom Action "Target" attribut and "TargetUnfomatted" attributes deliver wrong search results

Hello Angelo,

Please allow me some more time to discuss this with our dev team and I will followup as soon as I will have more information.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Custom Action "Target" attribut and "TargetUnfomatted" attributes deliver wrong search results

Hello Angelo,

So, after further tests, it looks like before verson 10.0 of Advanced Installer, in the XML file there existed only the "Target" field.

In later versions, we have added the "TargetUnformatted" as well.

In your case, the Target is set to an old version of your script because you have used a version older than 10.0 of Advanced Installer.

At project conversion, the Target became the old version and the newer versios of your script were added in TargetUnformatted.

It is to be noted that the Target is not modified by us anymore at all, so you can simply open the Advanced Installer in a text editor and modify it.

Additionally, this Target tag is only used if TargetUnformatted is empty (basically never, since you never leave the custom action empty).

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
a.guelle
Posts: 97
Joined: Tue May 19, 2015 2:23 pm

Re: Custom Action "Target" attribut and "TargetUnfomatted" attributes deliver wrong search results

Hi Catalin,

thank you very much for digging deeper in to that. Replacing all values of the "Target" attributes of my custom actions with "Script Text" did the trick.

Best regards,

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

Re: [solved] Custom Action "Target" attribut and "TargetUnfomatted" attributes deliver wrong search results

You are always welcome, Angelo!

Glad I could be of help.

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

Return to “Common Problems”