wyUpdate.exe deletes empty foldersSolved

Hi!wyUpdate.exe 2.6.14.0 seems to remove all empty folders from my application. For example the user has version 1.0 of my program and he let's wyUpdate to check updates. wyUpdate finds a new version 1.1 which has only a minor change in one text file. Updating goes without problems, only one file is downloaded. But...also all empty folders, like an empty log and tmp folders of my program doesn't exist anymore. This is not supposed to happen. Can this be prevented?

Regards, Pekka

Hey Pekka,

When wyBuild compares versions of your software it decides which files will be added, which files will be patched, and which files/folders will be deleted. Let's say you have version 1.0 and version 1.1. If in version 1.0 you have a folder "YourFolder" and in version 1.1 this folder isn't present in wyBuild then wyBuild will see that as "OK, I'll delete the YourFolder in the version 1.1 update".

Does that make sense?

So to prevent wyUpdate from deleting files and folders then make sure they exist in both the old version and the new version. In the step-by-step walkthrough will tell you to add all the files and folders for every version. Are you doing that?

Hey Sam,

I made a new simple wyUpdate project and noticed again that empty folder is removed even if it exists in the new version. I believe you could verify this by making a tiny project that has only one text file and an empty folder in version 1.0. Then make version 1.1 which has also one text file and the same empty folder. Do any change into the text file. Then let wyUpdate update version 1.0 to 1.1. and check if the empty folder still exists or not.

In my real program I found a way to avoid this problem by putting a dummy text file into all empty folders. Then the empty folders are not removed by wyUpdate.

I have noticed the exact same problem. For now I will also use a dummy file so that empty files don't get deleted during updates.

Regarding use of a dummy file:

You can actually just add it to the wyBuild project only in the "Files & Folder" screen; they don't need to be in your installed software.

The dummy file never changes between versions so it is never included in the incremental wyBuild updates; so even if the dummy file is not in your installed product, wyUpdate won't know and won't download the "catch-all" update.

Also, since the dummy file is added to the "Files & Folder" screen, wyUpdate won't delete the empty folder since it thinks it's not empty.

wyBuild 2.6.16 is now out -- this bug is fixed.