K7LER
Posts: 21
Joined: Wed Jan 12, 2022 7:33 pm

Copying Files from existing folders

Wed Jan 12, 2022 7:47 pm

I'm coming from Installshield and am still learning Advanced Installer.

My products have always created data folders in the Public Documents folder in a style of PRODUCT1\Data, PRODUCT2\DATA, PRODUCT3\DATA, with 3 being the prior major version, 2 being the year before and 1 being the first year's product.

I've authored the AI to install data into PRODUCT4\Data. No issues.

I have search/custom action to determine if the customer ever installer the 3 prior versions and which is the newest. No issues.

I don't want the AI installer to create the PRODUCT1\Data, PRODUCT2\DATA, PRODUCT3\DATA folders to copy all files from the newest product they have to the product being installed with the AI installer, however I don't see a way of using the copy files operation without creating those folders. I simply want to reference them.

How do I do this? Thank you in advanced.

Lance

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

Re: Copying Files from existing folders

Thu Jan 13, 2022 12:38 pm

Hello Lance and welcome to our forums,

First of all, thank you for considering Advanced Installer and I am glad to hear almost everything is going on as intended so far.

Regarding the issue you are facing, I am not quite sure I fully understand what you want to achieve.

If I understand correctly, you have 3 previous versions of your product. On the machine where you install the 4th, you want to check whether any previous version was installed and if so, copy all the files from the newest to the installation folder of the 4th.

Normally, when using the "File Copy" operaiton, you would need to recreate the path in the "Files and Folders" page, which would indeed result in the folder being create on the disk by your setup.

Most likely, this can be avoided by using your own custom action. This custom action could retrieve the path to the newest folder by retrieving the value of the property that stores the "Search" result. After doing so, the custom action would copy the files in the "Application Folder" (APPDIR property).

Hope this helps!

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

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

Re: Copying Files from existing folders

Thu Jan 13, 2022 3:07 pm

As a followup to my last thread, here would be an article which explains how to retrieve the value of a property in a custom action (somehow forgot to mention it there):

How to set an installer property using custom actions

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

K7LER
Posts: 21
Joined: Wed Jan 12, 2022 7:33 pm

Re: Copying Files from existing folders

Fri Jan 21, 2022 2:18 am

Thank you. I decided to go the route of a custom C# action.

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Copying Files from existing folders

Fri Jan 21, 2022 2:23 pm

You're welcome!

Please let us know if you encounter any problems implementing something.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”