mplacko
Posts: 4
Joined: Mon Jun 09, 2025 7:34 pm

Folder Sync Not Working Consistently

I have a project with a very simple folder synchronization. It's APPDIR. However I noticed that it never seems to run when built via command line (we use automation to build the project).

<COMPONENT cid="caphyon.advinst.msicomp.SynchronizedFolderComponent">
<ROW Directory_="APPDIR" SourcePath="..\FilesToInstall\Application" Feature="MainFeature" ExcludePattern="*~|#*#|%*%|._|CVS|.cvsignore|SCCS|vssver.scc|mssccprj.scc|vssver2.scc|.svn|.DS_Store" ExcludeFlags="6" FileAddOptions="4"/>
</COMPONENT>

I'm outputting everything from the build server to the log, so I know the files are there at build time for it to synchronize. If I leave the above configuration, it does nothing at all. If I create explicit steps for subfolders like this example, then it will synchronize the subfolders without issue:

<COMPONENT cid="caphyon.advinst.msicomp.SynchronizedFolderComponent">
<ROW Directory_="APPDIR" SourcePath="..\FilesToInstall\Application" Feature="MainFeature" ExcludePattern="*~|#*#|%*%|._|CVS|.cvsignore|SCCS|vssver.scc|mssccprj.scc|vssver2.scc|.svn|.DS_Store" ExcludeFlags="6" FileAddOptions="4"/>
<ROW Directory_="images_Dir" SourcePath="..\FilesToInstall\Application\images" Feature="AI32BitFiles" ExcludePattern="*~|#*#|%*%|._|CVS|.cvsignore|SCCS|vssver.scc|mssccprj.scc|vssver2.scc|.svn|.DS_Store" ExcludeFlags="6" FileAddOptions="4"/>
</COMPONENT>

It still does not synchronize anything in the root application folder. Why? Because MainFeature can't synchronize files for some reason? Makes no sense, as which feature the synchronization is tied to is completely arbitrary. It just needs to run before the exe is created.

It will clearly log a folder it is going to sync and the files:
Notification: Starting synchronization of "APPDIR\fonts" with "C:\jenkinspdn\workspace\
otification: File added:"APPDIR\fonts\fonts.txt"
Notification: File added:"APPDIR\fonts\LICENSE"
Notification: File deleted:APPDIR\fonts\.keep
Notification: Ending synchronization of "APPDIR\fonts"

There is no log entry for simply "APPDIR" when there should be.
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Folder Sync Not Working Consistently

Hello and welcome to our forums,

In the build script that you execute on the server, could you please try adding the /ResetSync option and let me know if that helps?

Reset synchronized folder command option

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mplacko
Posts: 4
Joined: Mon Jun 09, 2025 7:34 pm

Re: Folder Sync Not Working Consistently

I unfortunately don't have the ability to modify the commands on the build server. This is wrapped in build automation, which several calls to set a certificate before the call to /build. I can edit the .AIP file. If this /Reset option is some sort of requirement, perhaps it should be the default behavior. In what condition would someone not want files in a synchronized folder to not synchronize?
I noticed by chance that its actually pulling in some sub folders automatically, even though I don't have them specified. It seems the issue is (mostly?) a problem with files directly in the Application Folder root. I only have a handful of files with a problem, so in the interim, I just created zero byte files with the same name, which are overwritten by the build.

This surely has to be a bug and not the intended behavior? I've watched my GIT commit history and I see the AI project adding and deleting the same file reference between pushes. Even for the zero byte files I created as place holders in APPDIR.

<ROW File="xxxxx.zip" Component_="MainFeature" FileName="xxxxx~1.ZIP|xxxxx.zip" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\FilesToInstall\Application\xxxxx.zip" SelfReg="false"/>

It's not easy to move these assets around in the project, but it seems like that's the best thing that could be done. Put nothing in the root because it is not reliable if it's dynamic.
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Folder Sync Not Working Consistently

Hello,

This might indeed be an issue.

To make sure that is the case, could you please give me a test-case so I can run some tets on my end and further investigate this?

From what I can see, you are using Jenkins with our extension and you try to sync APPDIR with another folder (where is this folder from?) and the synchronization does not work. You also mentioend that subfolders or APPDIR are synchronized (here I'm assuming they are synchronized with the same folder APPDIR should be synchronized with?)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mplacko
Posts: 4
Joined: Mon Jun 09, 2025 7:34 pm

Re: Folder Sync Not Working Consistently

On disk, it's pretty straight forward:
<Jenkins Build Root>/installer/os/theproject.aip
<Jenkins Build Root>/installer/FilesToInstall/Application/
<Jenkins Build Root>/installer/FilesToInstall/Application/fonts
<Jenkins Build Root>/installer/FilesToInstall/Application/images
<Jenkins Build Root>/installer/FilesToInstall/Application/lib

4 of the folders are listed to synchronize in the project, Application as APPDIR, which in theory should automatically synchronize everything under it: fonts, lib, images, and anything in the Application folder itself.

These should not be needed IMO, but they are there because I don't think this works right:
Fonts, listed in the project as a child of APPDIR is also listed to synchronize.
Images, listed in the project as a child of APPDIR is also listed to synchronize.
Lib, listed in the project as a child of APPDIR is also listed to synchronize.

Jenkins will populate the fonts, images, and lib folders with files generated during build time. It will also populate <Jenkins Build Root>/installer/FilesToInstall/Application/ with a couple new files.

When AI runs, the log will show fonts, images, lib synchronizing. It will also show the static individual files listed in the project placed in APPDIR.

What does not work, is anything dynamically placed by Jenkins into <Jenkins Build Root>/installer/FilesToInstall/Application/, will never sync to APPDIR. The log never shows that running, when it clearly shows the other folders running the synchronize process.
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Folder Sync Not Working Consistently

Hello,

I have tested this on my end and the synchronization of APPDIR works just fine for me.

Here is the console output:
Screenshot_104.png
Screenshot_104.png (39.2 KiB) Viewed 4781 times

Here is how I have the build step configured:
Screenshot_105.png
Screenshot_105.png (41.82 KiB) Viewed 4781 times

and here is the resulted folder after installing the setup (to showcase the files were actually synchronized):
Screenshot_106.png
Screenshot_106.png (20.11 KiB) Viewed 4781 times

Could you please give me a more detailed, step-by-step test case so I can try to reproduce this on my end? Although the scenario is quite simple, I might be doing something wrong here.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mplacko
Posts: 4
Joined: Mon Jun 09, 2025 7:34 pm

Re: Folder Sync Not Working Consistently

I don't know what "NewSync" is in your log file above. Here is an abbreviated version of the log file from when this runs, which is similar to what you show, but there is no NewSync at the start of the /build command. It doesn't start by synchronizing the APPDIR, it sync's the FontFolder twice and it never sync's APPDIR itself. Although I've omitted files for brevity, this is the entire run and each Start/End message that was logged.

11:26:22 C:\jenkinspdn\workspace\productname\installer\Windows\AI Files>call "C:\Program Files (x86)\Caphyon\Advanced Installer 22.2\bin\x86\AdvancedInstaller.com" /build "projectfile.aip"
11:26:23 Notification: Starting synchronization of "FontsFolder" with "C:\jenkinspdn\workspace\productname\installer\Windows\FilesToInstall\Application\fonts"
11:26:23 Notification: File added:"FontsFolder\DejaVuSans-Bold.ttf"
11:26:23 Notification: File added:"FontsFolder\fonts.txt"
11:26:23 Notification: File added:"FontsFolder\LICENSE"
11:26:23 Notification: File deleted:FontsFolder\.keep
11:26:23 Notification: Ending synchronization of "FontsFolder"
11:26:23 Notification: Starting synchronization of "APPDIR\fonts" with "C:\jenkinspdn\workspace\productname\installer\Windows\FilesToInstall\Application\fonts"
11:26:23 Notification: File added:"APPDIR\fonts\DejaVuSans-Bold.ttf"
11:26:23 Notification: File added:"APPDIR\fonts\fonts.txt"
11:26:23 Notification: File added:"APPDIR\fonts\LICENSE"
11:26:23 Notification: File deleted:APPDIR\fonts\.keep
11:26:23 Notification: Ending synchronization of "APPDIR\fonts"
11:26:23 Notification: Starting synchronization of "APPDIR\images" with "C:\jenkinspdn\workspace\productname\installer\Windows\FilesToInstall\Application\images"
11:26:23 Notification: File deleted:APPDIR\images\.keep
11:26:23 Notification: Empty Folder added:"APPDIR\images"
11:26:23 Notification: Ending synchronization of "APPDIR\images"
11:26:23 Notification: Starting synchronization of "APPDIR\jvm" with "C:\jenkinspdn\workspace\productname\installer\Windows\FilesToInstall\Application\jvm"
11:26:23 Notification: File added:"APPDIR\jvm\bin\java.dll"
11:26:23 Notification: File added:"APPDIR\jvm\bin\java.exe"
11:26:23 Notification: File added:"APPDIR\jvm\lib\resources.jar"
11:26:23 Notification: File added:"APPDIR\jvm\lib\security\cacerts"
11:26:23 Notification: File deleted:APPDIR\jvm\.keep
11:26:23 Notification: Ending synchronization of "APPDIR\jvm"
11:26:23 Notification: Starting synchronization of "APPDIR\lib" with "C:\jenkinspdn\workspace\productname\installer\Windows\FilesToInstall\Application\lib"
11:26:23 Notification: File added:"APPDIR\lib\angus-mail-2.0.5.jar"
11:26:23 Notification: File added:"APPDIR\lib\slf4j-reload4j-2.0.9.jar"
11:26:23 Notification: File deleted:APPDIR\lib\.keep
11:26:23 Notification: Ending synchronization of "APPDIR\lib"
11:26:23 Notification: Starting synchronization of "APPDIR\audit" with "C:\jenkinspdn\workspace\productname\installer\Windows\FilesToInstall\Application\audit"
11:26:23 Notification: File deleted:APPDIR\audit\.keep
11:26:23 Notification: Empty Folder added:"APPDIR\audit"
11:26:23 Notification: Ending synchronization of "APPDIR\audit"
11:26:23 Notification: Starting synchronization of "APPDIR\sampletemplates" with "C:\jenkinspdn\workspace\productname\installer\Windows\FilesToInstall\Application\sampletemplates"
11:26:23 Notification: File added:"APPDIR\sampletemplates\Check.TXT"
11:26:23 Notification: File added:"APPDIR\sampletemplates\invoice.txt"
11:26:23 Notification: File added:"APPDIR\sampletemplates\logo.jpg"
11:26:23 Notification: File added:"APPDIR\sampletemplates\logoblack.jpg"
11:26:23 Notification: File added:"APPDIR\sampletemplates\statement.TXT"
11:26:23 Notification: File deleted:APPDIR\sampletemplates\.keep
11:26:23 Notification: Ending synchronization of "APPDIR\sampletemplates"
11:26:23
11:26:23 Checking builds status
11:26:23 Build required.

The entire SychronizedFolderComponent:

<COMPONENT cid="caphyon.advinst.msicomp.SynchronizedFolderComponent">
<ROW Directory_="APPDIR" SourcePath="..\FilesToInstall\Application" Feature="MainFeature" ExcludePattern="*~|#*#|%*%|._|CVS|.cvsignore|SCCS|vssver.scc|mssccprj.scc|vssver2.scc|.svn|.DS_Store" ExcludeFlags="6" FileAddOptions="4"/>
<ROW Directory_="FontsFolder" SourcePath="..\FilesToInstall\Application\fonts" Feature="AI32BitFiles" ExcludePattern="*~|#*#|%*%|._|CVS|.cvsignore|SCCS|vssver.scc|mssccprj.scc|vssver2.scc|.svn|.DS_Store" ExcludeFlags="6" FileAddOptions="4"/>
<ROW Directory_="fonts_1_Dir" SourcePath="..\FilesToInstall\Application\fonts" Feature="AI32BitFiles" ExcludePattern="*~|#*#|%*%|._|CVS|.cvsignore|SCCS|vssver.scc|mssccprj.scc|vssver2.scc|.svn|.DS_Store" ExcludeFlags="6" FileAddOptions="4"/>
<ROW Directory_="images_Dir" SourcePath="..\FilesToInstall\Application\images" Feature="AI32BitFiles" ExcludePattern="*~|#*#|%*%|._|CVS|.cvsignore|SCCS|vssver.scc|mssccprj.scc|vssver2.scc|.svn|.DS_Store" ExcludeFlags="6" FileAddOptions="4"/>
<ROW Directory_="jvm_Dir" SourcePath="..\FilesToInstall\Application\jvm" Feature="AI32BitFiles" ExcludePattern="*~|#*#|%*%|._|CVS|.cvsignore|SCCS|vssver.scc|mssccprj.scc|vssver2.scc|.svn|.DS_Store" ExcludeFlags="6" FileAddOptions="4"/>
<ROW Directory_="lib_Dir" SourcePath="..\FilesToInstall\Application\lib" Feature="AI32BitFiles" ExcludePattern="*~|#*#|%*%|._|CVS|.cvsignore|SCCS|vssver.scc|mssccprj.scc|vssver2.scc|.svn|.DS_Store" ExcludeFlags="6" FileAddOptions="4"/>
<ROW Directory_="audit_Dir" SourcePath="..\FilesToInstall\Application\audit" Feature="AI32BitFiles" ExcludePattern="*~|#*#|%*%|._|CVS|.cvsignore|SCCS|vssver.scc|mssccprj.scc|vssver2.scc|.svn|.DS_Store" ExcludeFlags="6" FileAddOptions="4"/>
<ROW Directory_="sampletemplates_Dir" SourcePath="..\FilesToInstall\Application\sampletemplates" Feature="AI32BitFiles" ExcludePattern="*~|#*#|%*%|._|CVS|.cvsignore|SCCS|vssver.scc|mssccprj.scc|vssver2.scc|.svn|.DS_Store" ExcludeFlags="6" FileAddOptions="4"/>
</COMPONENT>
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Folder Sync Not Working Consistently

Hello,

The NewSync command is the one responsible for sync-ing the folder.

How do you synchronize it on your end?

Do you have the option enabled in your project already and from Jenkins you just trigger a build? If so, before building, could you try to trigger the synchronization from the command line just like I did and let me know if that helps?

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

Return to “Common Problems”