sbaird
Posts: 57
Joined: Tue Sep 01, 2015 2:08 pm

Empty folders left behind on uninstall after using "Extract Archive"

I have a project in which I am adding a .zip file to the application folder and then using "Extract Archive" on that .zip. This archive creates multiple levels of sub-folders, each containing many files. On uninstall, all of the files are removed, but the folders it creates are left behind. I tried this both with and without Enhanced UI, and the behavior is the same.

I am aware that I can forcefully delete the parent folder, but this isn't optimal because if additional files are later placed in that structure, they shouldn't be removed by the installer.

Can this be fixed?
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Empty folders left behind on uninstall after using "Extract Archive"

Hello,

Please note that during an uninstall, Windows Installer removes only the data registered into the MSI file. All other data created by custom actions, by the installed application or by the user is not registered in the MSI, therefore it will not be removed.

If you want to also delete this data, you can use the "Uninstall Cleanup" wizard feature to remove any redundant files or folder. On the Files and Folders page, simply right click the folder that needs to be cleaned up upon uninstall and click “Uninstall Cleanup". The “Wizard” will guide you through the rest of the process.

If you need any help, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sbaird
Posts: 57
Joined: Tue Sep 01, 2015 2:08 pm

Re: Empty folders left behind on uninstall after using "Extract Archive"

I am confused by your response.

Obviously, the files contained in the .zip file are not registered with Windows Installer, but they get removed on uninstall. So, the AI custom action(s) related to handling archive files on uninstall do clean up these files. I was wondering how this works actually -- you must be querying the .zip file during uninstall to see which files need to be deleted. As a test, if I add an additional file to a folder that was created by the .zip extraction after install, this file is not removed at uninstall, so AI is not just deleting all files within the directory -- it is "smarter" than that. All I am asking is why the empty folders cannot also be removed. I understand the "Uninstall Cleanup" wizard workaround, but as I mentioned in my original post, this is not ideal. Am I being clear enough?
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Empty folders left behind on uninstall after using "Extract Archive"

Hello,

I apologize for my misleading reply.
I've tested the Extract Archive Dialog operation but I cannot replicate the described behaviour. The files and the folder where they are extracted are properly deleted during the uninstall.

In order to further investigate this, can you please send us a sample project that replicates this behaviour?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sbaird
Posts: 57
Joined: Tue Sep 01, 2015 2:08 pm

Re: Empty folders left behind on uninstall after using "Extract Archive"

Ok, I've done some more testing, and it does indeed work with a single .zip file. I guess I oversimplified my explanation of the scenario. I actually have two .zip files that I am installing and extracting in the following structure:

Code: Select all

Application folder
   |
    --> Subfolder1 (contains content1.zip)
           |
            --> Subfolder2 (contains content2.zip)
Both of these .zip files have a folder structure within them. All folders created by the .zip files are left behind.

Upon further testing, the issue also exists if both .zip files are installed to the same directory and extracted.
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Empty folders left behind on uninstall after using "Extract Archive"

Hello,

I've tested your scenario but I cannot replicate it.

I will need a sample installer (with .aip project file and all necessary resources to build it) to test this on my machine and troubleshoot this further. Please create such a sample that accurately reproduces your error and attach it on the forum.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sbaird
Posts: 57
Joined: Tue Sep 01, 2015 2:08 pm

Re: Empty folders left behind on uninstall after using "Extract Archive"

I've done some more testing with this, and I've narrowed the problem down to one .zip file. I'm attaching the project file and the .zip file that create the issue. I am using AI 12.5.1 and am testing on Windows 7 x64 SP1.

There is something strange about the attached .zip file. I've removed all but one file and its parent directory, and the issue occurs. If I unzip and then recreate the .zip file, everything works correctly. I don't build the .zip file initially -- it is handed off to me by another group, but they also provide another .zip file that does not produce this issue. I am checking with them to see if they do anything strange/differently when creating this .zip file, but I'm hoping you can take a look and see if you can figure out what causes AI to not remove the folder on uninstall, as it looks like an entirely valid .zip file, and I can't see any differences between the original and the re-zipped version. Sorry for all the earlier confusion.
Attachments
content.zip
(4.11 KiB) Downloaded 711 times
Your Application.aip
(23.28 KiB) Downloaded 528 times
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Empty folders left behind on uninstall after using "Extract Archive"

Hello,

We tested the scenario using your original ZIP file and we can indeed replicate the behavior. It seems this happens because your ZIP archive, when extracted with Zlib library (the API we use for our Extract Archive operation), doesn't reveal its folder structure. Thus we don't know which folders are created when this archive is extracted, therefore on uninstall only the extracted file is deleted. Unfortunately, we don't have any solution for your particular ZIP file.

I'm not sure how your ZIP was created, but as a best practice we encourage you to use ZIP files created using wide known archiving tools like 7-zip or Microsoft archiving mechanism.

Thank you for your understanding.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sbaird
Posts: 57
Joined: Tue Sep 01, 2015 2:08 pm

Re: Empty folders left behind on uninstall after using "Extract Archive"

Ok, thanks for the information. I found out we're using WinZip 12 to create the archives. We will try using a newer version.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Empty folders left behind on uninstall after using "Extract Archive"

You're welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”