We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

saikat
Posts: 3
Joined: Mon Nov 25, 2019 2:56 pm

Using the AI_SERVAL_RESPONSE_CODE for creating folders dynamically

Hello guys,

We need to dynamically create folders on the basis of the response code received in AI_SERVAL_RESPONSE_CODE.
We have created a PHP script to return custom AI_SERVAL_RESPONSE_CODE codes.

For example:
>AI_SERVAL_RESPONSE_CODE = 234, create folders - x,y,z
>AI_SERVAL_RESPONSE_CODE = 154, create folders - a,b,z
>AI_SERVAL_RESPONSE_CODE = 251, create folders - x,b,a

Is it possible to do something like this in Advanced Installer Professional ?

Kindly help. We already have the Professional licence for Advanced Installer.
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Using the AI_SERVAL_RESPONSE_CODE for creating folders dynamically

Hello and welcome to Advanced Installer forums,

I'm not sure I fully understand your scenario here, but if you want to dynamically create folders under the "Application Folder" (in "Files and Folders" page), then you can proceed as it follows:

- go to "Files and Folders" page

- create the folders under the "Application Folder" (right click on "Application Folder" --> "New folder" --> "Regular")

- right click on the folder --> "Properties" --> make sure that the "Create folder on target machine" option is checked

- now please right click on the folder --> "Go to Component". This will redirect you to "Organization" page. Here, please condition the installation of the component by using the "Condition" field.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
saikat
Posts: 3
Joined: Mon Nov 25, 2019 2:56 pm

Re: Using the AI_SERVAL_RESPONSE_CODE for creating folders dynamically

Hi Catalin,

Thanks for your response.

In response to your reply, in the "Organization" page, we want to provide a condition using the AI_SERVAL_RESPONSE_CODE.

Ex- lets say there are 3 folders. We want to provide conditions as below:

1. Folder 1 to be created only when the AI_SERVAL_RESPONSE_CODE code contains the digit 1.
2. Folder 2 to be created only when the AI_SERVAL_RESPONSE_CODE code contains the digit 2.
3. Folder 3 to be created only when the AI_SERVAL_RESPONSE_CODE code contains the digit 3.


For example if the AI_SERVAL_RESPONSE_CODE contains the number 123 all the three folders should be created.
If the AI_SERVAL_RESPONSE_CODE contains the number 235 only Folders 2 & 3 should be created and not the Folder 1.
If the AI_SERVAL_RESPONSE_CODE contains the number 735 only Folder 3 should be created and not the Folders 1 & 2.

Hope this explains.

We just want to know how we can configure the above conditions in the Advanced Installer professional.

Thanks.
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Using the AI_SERVAL_RESPONSE_CODE for creating folders dynamically

Hello,

Thank you for the explanation.

In order to achieve that, you can use the "Sub-String/Bitwise operators", such as:

>< - TRUE if left string contains the right string.
~>< - TRUE if left string contains the right string. The comparison is case insensitive.
<< - TRUE if left string starts with the right string.
~<< - TRUE if left string starts with the right string. The comparison is case insensitive.
>> - TRUE if left string ends with the right string.
~>> - TRUE if left string ends with the right string. The comparison is case insensitive.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
saikat
Posts: 3
Joined: Mon Nov 25, 2019 2:56 pm

Re: Using the AI_SERVAL_RESPONSE_CODE for creating folders dynamically

Hello Catalin,

We tried to implement the same but have one more query.

Can we use strings in AI_SERVAL_RESPONSE_CODE property?

I am afraid that whenever I pass a string (for example- " 123,456,789-987 "), the advanced installer doesn't responds to it.

Does it works only with integer values for AI_SERVAL_RESPONSE_CODE?
Kindly help.

Regards,
Saikat
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Using the AI_SERVAL_RESPONSE_CODE for creating folders dynamically

Hello Saikat,

Unfortunately, it is not possible to pass a string to the AI_SERVAL_RESPONSE_CODE.

As presented in the "How do I configure server-side serial number validation?" article:
Optionally, you can return a custom AnswerCode in case you consider the received serial number as valid and want to dynamically change the course of installation according to this response. The AnswerCode sent by the server after the validation will be available by accessing the Windows Installer property AI_SERVAL_RESPONSE_CODE.
Based on that above, we notice that the AI_SERVAL_RESPONSE_CODE stores the value of the AnswerCode, which should be a number.

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

Return to “Building Installers”