copy files from appropriate folder - Advanced Installer Community
sitesv
Posts: 15
Joined: Tue Jan 26, 2016 10:35 am

copy files from appropriate folder

Hello!
In my project i have the same file structure:

Code: Select all

    MYDIR
         SUBDIR_1
               main_file
         SUBDIR_2
               main_file
         main_file
Only root main_file is using in program.
I need to copy main_file from appropriate folder (source SUBDIR_1 or SUBDIR_2 depends on RadioGroup selection) to root main_file that.
Please, explain, how to do this. Thanx.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: copy files from appropriate folder

Hi,

To achieve this, you can implement the steps described in the "How to install two files with the same name in the same folder" tutorial.

Just let us know if you need more details.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sitesv
Posts: 15
Joined: Tue Jan 26, 2016 10:35 am

Re: copy files from appropriate folder

Eusebiu wrote:Hi,

To achieve this, you can implement the steps described in the "How to install two files with the same name in the same folder" tutorial.

Just let us know if you need more details.

Best regards,
Eusebiu

Thank you!
But if i have the next situation:

Code: Select all

	ROOT_DIR
		file
		SUBDIR_A
	        	file
	      		SUBDIR_A1
	      			file
	      		SUBDIR_A2
	      			file
I need for in first step copy 'file' from SUBDIR_A1 (or SUBDIR_A2) to SUBDIR_A (depends on radiogroup selection) and next i need to copy result file from SUBDIR_A to ROOT_DIR.
If i also select SUBDIR_A property ''Install folder content into the parent folder", i will not have a success result.

Sorry, there is something wrong in my project. It's work.
sitesv
Posts: 15
Joined: Tue Jan 26, 2016 10:35 am

Re: copy files from appropriate folder

Is it possible to do next:

Code: Select all

DIR
	file
	file1
	file2
if i select in radiogroup item needs to copy 'file2' into 'file' or 'file1' to 'file'.
Is it possible without creation directory for file1 and file2?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: copy files from appropriate folder

Hi,

I'm afraid that I do not fully understand your scenario. Do you want to only rename the "file1" and "file2" files to "file" based on a condition? If so, you can try to achieve this through a "File Duplication" operation.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sitesv
Posts: 15
Joined: Tue Jan 26, 2016 10:35 am

Re: copy files from appropriate folder

Eusebiu wrote:Hi,

I'm afraid that I do not fully understand your scenario. Do you want to only rename the "file1" and "file2" files to "file" based on a condition? If so, you can try to achieve this through a "File Duplication" operation.

Best regards,
Eusebiu
I create 'file duplication' for 'file1' to 'file'...
But i can't create 'file duplication' operation for file2 to 'file', a see a message 'A file duplication with this name already exist'
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: copy files from appropriate folder

For this, you can create a new property in the "Install Parameters" page (e.g. FILE1) with value "file", then use it in the "Destination name" field of the second file duplication (e.g. [|FILE]).

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sitesv
Posts: 15
Joined: Tue Jan 26, 2016 10:35 am

Re: copy files from appropriate folder

Eusebiu wrote:For this, you can create a new property in the "Install Parameters" page (e.g. FILE1) with value "file", then use it in the "Destination name" field of the second file duplication (e.g. [|FILE]).

Best regards,
Eusebiu

Using vertical line in expression like [|FILE] in 'destination name' field is unavailable.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: copy files from appropriate folder

This should be possible as in the attached screenshot.

Best regards,
Eusebiu
Attachments
File Duplication.png
File Duplication.png (6.8 KiB) Viewed 7510 times
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sitesv
Posts: 15
Joined: Tue Jan 26, 2016 10:35 am

Re: copy files from appropriate folder

Eusebiu wrote:This should be possible as in the attached screenshot.

Best regards,
Eusebiu

Sorry... something wrong with project again...
Is it possible to do this for 'file copy' operation? There is not available condition for the duplicate operation.
I need to keep file1, file2 and file after installation.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: copy files from appropriate folder

In order to execute a duplicate operation based on a condition, you can select the desired component from the "Component" combobox, then go in the "Organization" page and set a condition for that component. All the files will be kept if you use the duplicate operation.

I'm afraid that copying the files from the project to another folder, after they were installed, is not possible through the "File Copy" operation.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sitesv
Posts: 15
Joined: Tue Jan 26, 2016 10:35 am

Re: copy files from appropriate folder

ok.
I have a 5 files:

Code: Select all

	file
	file1
	file2
	file3
	file4
for file1 i directly set destination name 'file' - OK
for file2 i set destination name [|FILE2] with value = 'file' - OK
But for next files ([|FILE3], [|FILE4]) there is an error: 'A file duplication with this name already exist'.
sitesv
Posts: 15
Joined: Tue Jan 26, 2016 10:35 am

Re: copy files from appropriate folder

Is there some decision?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: copy files from appropriate folder

Hello,

I'm afraid this is the normal behavior. The related error is displayed when you are trying to define in the same directory multiple file duplication operations using the same destination name. There is a nonsense to add two file duplications with the same name. Please not that our file duplication operation only create a copy of a file in the specified destination folder. It doesn't copy the content of a file into another file content.

If you need to append into a file content the content of another file, then you should develop and use your own custom action for this. Also, I'm not sure if this suits for your needs, but you can also try to use our Text File Update mechanism and see if this helps.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sitesv
Posts: 15
Joined: Tue Jan 26, 2016 10:35 am

Re: copy files from appropriate folder

Daniel wrote:Hello,

I'm afraid this is the normal behavior. The related error is displayed when you are trying to define in the same directory multiple file duplication operations using the same destination name. There is a nonsense to add two file duplications with the same name. Please not that our file duplication operation only create a copy of a file in the specified destination folder. It doesn't copy the content of a file into another file content.

If you need to append into a file content the content of another file, then you should develop and use your own custom action for this. Also, I'm not sure if this suits for your needs, but you can also try to use our Text File Update mechanism and see if this helps.

All the best,
Daniel
Hello, Daniel!
'file1', 'file2', 'file3' - this are various versions of binary files. 'file' - file, that is used by my soft.
In installation process RadioGroup selects current version of target file.
I need to copy 'fileX' to 'file'. And my soft will be using it.

'fileX' and 'file' are located in the same directory.

How to do this? Thanx!

Return to “Common Problems”