TFAlex
Posts: 10
Joined: Wed Nov 13, 2019 1:20 pm
Location: Hürtgenwald
Contact: Website

Synchronized Folder: Removed files in subfolders not deleted in application folder

Hi,

I want to synchronize the folder for my SPA frontend build using create-react-app. The normal structure is, that there is a static folder, containing all other artifacts in different subfolders, e.g. js or css. The js and css files are named with hashes generated during build, to prevent from having caching problems in browsers.
So it looks something like this:

Code: Select all

frontend
- static
  - js
    - 2.26039a5f.chunk.js
    - main.1b7a1cea.chunk.js
  - css
    - 3.4b3ccb6c.chunk.css
So for each new version the file names change. I configured frontend to be synchronized into the application folder and unchecked "Keep in project files deleted from disk". I thought this would remove all old artifacts and copy over the new ones. But from what I see, the old js and css files are piling up and get never removed.
What am I doing wrong here?
https://www.timeflex.de - more than a group calendar
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Synchronized Folder: Removed files in subfolders not deleted in application folder

Hi and welcome to our forums.

This is only a UI limitation because the synchronized folders are refreshed when the project is reopen, when a build is triggered, when the synchronization settings are changed or when the "Refresh" toolbar button is used in the "Files and Folders" page.

So, even if the old files are still displayed in those folders, when the project is built, they will be removed and only the new/existing files will be kept.

Let me know if you have other questions.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
TFAlex
Posts: 10
Joined: Wed Nov 13, 2019 1:20 pm
Location: Hürtgenwald
Contact: Website

Re: Synchronized Folder: Removed files in subfolders not deleted in application folder

Hi Eusebiu,

at least for me that isn't the case. After installation I can still see all the old artifacts in the installation folder.
advanced installer sync.png
advanced installer sync.png (150.62 KiB) Viewed 4254 times
All the .map and .js files having the same name should not be there. You can see that even at the date of the files.

Regards,
Alex
https://www.timeflex.de - more than a group calendar
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Synchronized Folder: Removed files in subfolders not deleted in application folder

Hi Alex,

This happens only if those old files are still present in the folder from your local drive. They cannot be kept in the package if they are not present on the local drive anymore.

They are kept only when the "Keep in project files deleted from disk" option is selected, but in this case they will have a 0 KB size.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
TFAlex
Posts: 10
Joined: Wed Nov 13, 2019 1:20 pm
Location: Hürtgenwald
Contact: Website

Re: Synchronized Folder: Removed files in subfolders not deleted in application folder

Hi Eusebiu,

but how do I get rid of these obsolete files on target / customer machines? These files are not in the bundle anymore, as they are deleted when building a release version. As I said, the names of the files are created by a hashing function.

Regards,
Alex
https://www.timeflex.de - more than a group calendar
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Synchronized Folder: Removed files in subfolders not deleted in application folder

Hi Alex,

Normally, when a new version of a product is installed on a machine, it checks if any older version exists and first uninstalls it with all its resources. Doesn't this happen for you? Are the old files left on the machine after the new version is installed?

If so, can you please send me the two .AIP file (the old version and the new version) and a verbose log of the upgrade to support at advancedinstaller dot com, so I can investigate them?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
TFAlex
Posts: 10
Joined: Wed Nov 13, 2019 1:20 pm
Location: Hürtgenwald
Contact: Website

Re: Synchronized Folder: Removed files in subfolders not deleted in application folder

Hi Eusebiu,

I just tried to reproduce this for you on a fresh server, by installing an old version first and then the newer version. But alas, after that the old files were removed and only the new were left. So it worked just as expected.
So it may have been the problem before, that I copied some files there manually for testing, that were not added by the installer before. It seems that those files could not be removed. Does the installer track exactly which files it installed previously?
Overall this then is no real issue but just a coincidence. Thanks for your help nonetheless!

Regards,
Alex
https://www.timeflex.de - more than a group calendar
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Synchronized Folder: Removed files in subfolders not deleted in application folder

Hi Alex,

Yes, the installer keeps track of each file that it installed and only those files are removed on uninstall. If you want to remove other files, you can use the "File Removal" operation or the "Remove folder" option if you want to remove an entire folder.

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

Return to “Building Installers”