Roberto
Posts: 13
Joined: Wed Jun 24, 2015 4:52 pm

How to configure XML search

Hello,
I have a text file named License.lic.
The file contains data stored in XML format

<License>
<Id>1c991f79-8dfa-4fa1-a7e5-a3d9bf2013f3</Id>
<Type>Standard</Type>
<Customer>
<Name>Acme two</Name>
<Email>info@example.com</Email>
</Customer>
<LicenseAttributes>
<Attribute name="L_MaxLine">10</Attribute>
</LicenseAttributes>
<Signature>xxx</Signature>
</License>

I need to compare a value found in the file with a value typed from the user in the installation dialog.
I'm trying to find the value of the key "Id" but I'm not able.

1 - Can you show me how to perform the search?
2 - Is it possible to compare the value found at the step 1 with a value typed in the a dialog?

Attached you can find two images of my configuration.

Thanks in advance.
Roberto
Attachments
Search.PNG
Search.PNG (10.36 KiB) Viewed 5281 times
FilesAndFolders.PNG
FilesAndFolders.PNG (61.61 KiB) Viewed 5281 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to configure XML search

Hi Roberto,

Your XML search seems to be configured correctly, however it may not work because the value of the [License_Dir] property is not already set when the search is performed. Please take a look on the "Problem with Search XML: backup some installed file tags" thread which debates the same problem.

The value found in the XML file will be stored in the "EDIT_LICENSEKEY" property that you set for it. The value typed in the edit box from a dialog will also be stored in a property related to that box. So, you can compare those properties using the "=" character (e.g. EDIT_LICENSEKEY = EDIT_PROP).

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Roberto
Posts: 13
Joined: Wed Jun 24, 2015 4:52 pm

Re: How to configure XML search

Hi Eusebiu and thanks for your reply.

I made some test and I understand the problem:
1 - my need is to save all my install package (including .lic (xml) file on CD (this is OK)
2 - I need to read the content of the .lic file when the installation starts. At that time the file is still located on the CD. This is the problem: I'm not able to read the file because I need to use RELATIVE PATH but I'm not able and every attempt fails.

The CD folder structure
cd.PNG
cd.PNG (7.34 KiB) Viewed 5255 times
I need to read the content of the file contained in the Documents folder.
How can I create the relative path?

Thanks and regards,
Roberto
Roberto
Posts: 13
Joined: Wed Jun 24, 2015 4:52 pm

Re: How to configure XML search

Update:

Now I'm struggling with the property [AI_SETUPEXEPATH].
I can't believe that is not possible to get the relative location of the.exe file.

I need to put my installer files in a CD for the user. The user can have any drive letter for his cd player. (F:\, H:\, what you prefer...)

At the begin of the installing proscess I need to load data from an XML file contained in a folder next to the EXE file; moreover If needed the user can open a help file (.pdf) by click a button in the dialog forms.

At the moment these operations are impossible because It is not understandable how to "load data"/"open files" contained in a folder next to the EXE installer file.
This is a limbo between the BUILD process and the INSTALLATION process. I have the UI open to configure the installation process but is not possible to refer to a path next the EXE installer file.

Attached a new configuration attempt.
I try to save the EXE path in the SETUP_EXEPATH variable. Next I try to use that variable to compose the path to open my files from the CD drive.

Thanks and regards,
Roberto
Attachments
setproperty.PNG
setproperty.PNG (49.99 KiB) Viewed 5246 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to configure XML search

Hi Roberto,

The path to the folder that contains the EXE setup file is stored in the "SETUPEXEDIR" property. So, you can use for your XML search the following path: [SETUPEXEDIR]\Documents\License.lic

To open a file from the same folder when the user clicks a button from the dialogs, you can add a "Launch file" custom action on that dialog that uses the same "[SETUPEXEDIR]" property.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Roberto
Posts: 13
Joined: Wed Jun 24, 2015 4:52 pm

Re: How to configure XML search

Hi Eusebiu,
now "open file from dialog" and "search in xml file" are working fine.

Open file from dialog refers to this configuration
CA_SearchXml.PNG
CA_SearchXml.PNG (11.55 KiB) Viewed 5225 times
Search in xml from dialog refers to this configuration
CA_OpenFile.PNG
CA_OpenFile.PNG (36.04 KiB) Viewed 5225 times
Thanks for your support.
Roberto
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to configure XML search

You're welcome Roberto. I'm glad to got these to work.

If you have other questions, just let us know.

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

Return to “Building Installers”