berqo127
Posts: 21
Joined: Tue Aug 06, 2019 1:35 pm

conditionally copy binaries

Tue Mar 16, 2021 10:05 am

Hi,

I have an app that suites all my customers except one that requires an additional binary. my main build process compiles all binaries and I have another build process that compiles the specific additional binary for the exceptional customer ().

My question is how can I use same AI package for both customer type. the only difference is that for the exceptional customer I need to copy another binary to one of the app folders.

I looked at the option of the conditionally file copy under Organization but it assumes the binary always exists which is not true in my case when building the package not for the exceptional customer.

I've attached the aip file.

Thanks,
Shlomi

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: conditionally copy binaries

Wed Mar 17, 2021 3:41 pm

Hi Shlomi,

It seems that you forgot to attached your project file. Anyway, in order to achieve this you can either add that additional binary file in all your packages and set a condition so it will be installed only for that exceptional customer or you can add two different builds in the "Builds" page of your project where one contains that file and one does not.

You can take a look on the "Branding of the installer" thread and watch the "Multiple Builds Configuration" video for more details.

Let me know if this helped, otherwise please give me more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

berqo127
Posts: 21
Joined: Tue Aug 06, 2019 1:35 pm

Re: conditionally copy binaries

Wed Mar 17, 2021 4:30 pm

Hi,

I uploaded the file
iGreen.rar
(125.17KiB)Downloaded 219 times
again. hope that works now.
regarding your response, this is the thing that at the time of building the aip I don't have always the extra binary (only when running the CI build process for the exceptional customer) so I would like some kind of custom action that checks if the binary exists and if it does it copies it to the location it needs to be.

Best,
Shlomi

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: conditionally copy binaries

Mon Mar 22, 2021 5:21 pm

Hi Shlomi,

In order to achieve this, you can create a script that checks if that file exists and if so it adds it to the project and re-builds the project. You can use the "Add File" command line for this.

You can see a BAT script example below:

Code: Select all

IF EXIST "D:\file.txt" (
"C:\Program Files (x86)\Caphyon\Advanced Installer 18.0\bin\x86\AdvancedInstaller.com" /edit "D:\test.aip" /AddFile APPDIR "D:\file.txt"
) ELSE (
echo File does not exist.
)
"C:\Program Files (x86)\Caphyon\Advanced Installer 17.9\bin\x86\AdvancedInstaller.com" /rebuild "D:\test.aip"
PAUSE
Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”