tdo
Posts: 5
Joined: Wed Apr 26, 2017 7:47 pm

How to copy all files in a folder into the Application Folder?

I have a folder A. When creating the installer as part of the build process, I need Advanced Installer to copy all files in A into the Application Folder. How can this be achieved? The content of A is dynamic so I cannot add its files into the installer ahead of time. I also need other files not in A into the Application Folder, so I cannot just use the Synchronize feature.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to copy all files in a folder into the Application Folder?

Hello and welcome to our forum!

In order to achieve this you need to take the following steps:

1. Go to "Files and Folders" page in your project and Add a new folder (Your A Folder)
2. Right click on this folder and go to "Properties". Select "Install folder content into the parent folder"
3. Go to "Synchronize" tab. Check "Synchronize with folder from disk"

By this method the content of your A folder from disk is included in your package at build time. The content will be installed directly into the application folder.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
antoinea
Posts: 4
Joined: Fri Jun 14, 2019 4:49 pm

Re: How to copy all files in a folder into the Application Folder?

Hello, how can this folder be set depending on the build ? for example, in a Release build i want to take folder X, in a Debug build i want to take a folder Y.
Thanks!
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: How to copy all files in a folder into the Application Folder?

Hello,

Unfortunately, it is not exactly possible to achieve what you want.

However, we can get pretty close to it.

Here is how you can proceed:

You can create a pre-build event, in which you can add a simple .BAT file which can do these changes for your. For instance, you can use our predefined support for adding synchronized folders.

Here is how your .BAT file can look like:

Code: Select all

"C:\Program Files (x86)\Caphyon\Advanced Installer 16.5\bin\x86\AdvancedInstaller.com" /edit "C:\Users\Catalin\Desktop\Your Application.aip" /NewSync APPDIR\NewFolder "C:\Users\Catalin\Desktop\NewFolder"
ECHO "Please open the .AIP file and rebuild the project once again, so the changes will be saved into the MSI as well."
PAUSE
Now please go to "Builds" page --> select your build --> "Build Events" --> "Add" --> "Pre-Build event" --> "New"

The build event can look like this:
buildEvent.png
buildEvent.png (12.25 KiB) Viewed 5472 times
Now, this event will be executed every time you build your project. However, please keep in mind that these changes are done to the .AIP file, not to the MSI file itself. With that being said, after building once --> the .AIP file will be modified (e.g. your folder will now be synchronized) --> but the MSI will not yet contain these changes. Therefore, you need to open the .AIP file once again and do a rebuild.

Hope this helps.

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

Return to “Common Problems”