mplacko
Posts: 3
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: 7606
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: 3
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: 7606
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: 3
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.

Return to “Common Problems”