Copy files from server - Advanced Installer Community
borrbr01
Posts: 7
Joined: Thu May 07, 2020 2:01 pm

Copy files from server

HI,

In my project I need to copy a file from one server among several, depending on the user's choice in a window of the interface.
So I would like to put a condition on the copy of the file.

I tried to set a condition in the copy window, but it doesn't work. The file is not copied.

When reading on the Internet, I have to put the condition on the component and not in the copy window.

My problem is that I don't have a specific component for these files (Advanced Installer didn't create components) to put the condition.

How to create a component with my file and finally put the condition.

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

Re: Copy files from server

Hello,

Indeed, Advanced Installer does not create a component for each file you add in the "Files and Folders" page.

However, you can do this yourself. To achieve this, let's consider the following example:

Let's say we have the following files in the "Files and Folders" page:

FaFPage.png
FaFPage.png (25.93 KiB) Viewed 3962 times

In "Organization" page, only a component is created for both files:

Component.png
Component.png (27.59 KiB) Viewed 3962 times

If you right click on the "a.txt" file, you will be able to move it to a new component:

MoveToNewComponent.png
MoveToNewComponent.png (35.77 KiB) Viewed 3962 times

If you have more files, the easiest way to find the component to which your file belongs is to go in the "Files and Folders" page --> right click on your file --> "Go to Component" (or F8 button).

After doing so, you can condition the installation of your file's component.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
borrbr01
Posts: 7
Joined: Thu May 07, 2020 2:01 pm

Re: Copy files from server

Hi

Thanks for your answer, I know this procedure, but if the file is copied (New File Operation - File Copy/Move) you can't "Move to New Component"

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

Re: Copy files from server

Hello,
if the file is copied (New File Operation - File Copy/Move) you can't "Move to New Component"
Please note that the "File Copy/Move" operation is intended for files outside the package only.

If you want to copy a file that you deliver with your setup, please consider using the "File Duplicate" operation.

With that being said, it will be bound to the component that conditions the copy/move operation and indeed, it is not possible to move it to a new component.

However, this is the reason why the "Condition" field is there in the "Edit File Copy/Move" dialog.

Through that field, you can give an additional condition that will need to be met in order for the operation to execute.

You have mentioned that you want to execute the operation based on the user selection. For instance, let's consider you want to execute this operation only if a checkbox is checked by the user.
Checkbox.png
Checkbox.png (287.72 KiB) Viewed 3876 times

If we have a checkbox control like in the screenshot above, the condition should look like this:

EditFileCopy.png
EditFileCopy.png (21.15 KiB) Viewed 3876 times


If the checkbox control is selected, then the property CHECKBOX_1_PROP will have the value "CheckBox", otherwise the property will be empty.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
borrbr01
Posts: 7
Joined: Thu May 07, 2020 2:01 pm

Re: Copy files from server

Hi

Yes, the file is an external file from my package. I copy the file from a server.

And I'm sorry but your last explanation doesn't work.
I have implemented this scenario on my project, and the file is not copied when there is the condition.
When I remove the condition the file is copied properly.

I found another scenario:
I have created one parameter for each server. (Server1 = \\server1\share, Server2=\\server2\share)
With these parameters, there is one component, I put my copied file on this component and the condition in the component.

Thanks a lot
Regards
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Copy files from server

Hello,

Thank you for your followup on this and for sharing your solution with us.

I am glad everything works as expected now.

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

Return to “Common Problems”