prerak6962
Posts: 111
Joined: Mon Dec 08, 2014 5:26 pm

Duplicate Folder Creation on Uninstall

Tue Jun 08, 2021 5:26 pm

Hello,

In one of my installer, I have added a popup dialog requesting from the user if he wants to delete certain configuration during uninstallation.
If the user selects "Yes", the installer should delete everything. And this works fine.

However, if the user selects "No", a folder in the installation dir should not be deleted.

In the test project that is attached here, the "Pacakges" folder should not be deleted. But after uninstallation, the a new "Pacakges" folder is created inside the installation directory and the original "Packages" folder goes inside it.

So,
  • When installed: C:\Program Files (x86)\TestCompany\FolderTest\Packages\1.0
  • After unstallation: C:\Program Files (x86)\TestCompany\FolderTest\Packages\Packages\1.0
The reason I do not want the change in the folder structure, is so that if the user installs the application again, he/she will have the old folder intact and all the changes performed inside it.

Thank you.
Prerak
Attachments
FolderTest.aip
(20.58 KiB) Downloaded 4 times

Catalin
Posts: 4086
Joined: Wed Jun 13, 2018 7:49 am

Re: Duplicate Folder Creation on Uninstall

Thu Jun 10, 2021 6:53 pm

Hello Prerak,

Thank you for the provided resources.

I was indeed able to replicate the described behavior.

Now, to be fully honest with you, I am not sure if this is an issue or the intended behavior.

I tend to believe this is the intended behavior, the reason being the fact that we make that option available to our users through a backup.

Basically, during the uninstall, a backup of the "Packages" folder is created --> the folder is removed --> the folder is recreated, resulting in the folder being duplicated.

The solution to this would be setting the "Do not overwrite existing file" on the leaf nodes (e.g. the folders 1.0 and 2.0).

Hope this helps!

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

prerak6962
Posts: 111
Joined: Mon Dec 08, 2014 5:26 pm

Re: Duplicate Folder Creation on Uninstall

Fri Jun 11, 2021 10:53 am

Hi Catalin,

Thank you for the suggestion. I managed to make it work now.
However, I had some files inside these folders (1.0, 2.0) so I had to set the Do not overwrite existing file on those files. Because if I set the condition on the leaf folder instead of leaf file, it was showing similar behavior (C:\Program Files (x86)\TestCompany\FolderTest\Packages\1.0\1.0 after uninstall).

Couple of suggestions:
  • It would be better to explain this behavior in the documentation in order to get a clear idea
  • I only had one file inside these folders, so it was very easy for me. However, in a scenario where there are multiple folders with multiple files, adding the condition on each of them would really be a painful task. So, may be adding a way to simplify this would be also a good option.
Thanks once again and have a nice day ahead :)

Prerak

Catalin
Posts: 4086
Joined: Wed Jun 13, 2018 7:49 am

Re: Duplicate Folder Creation on Uninstall

Fri Jun 11, 2021 2:59 pm

Thank you for your followup on this and for offering your feedback, Prerak!

I am glad to hear everything works as expected now.

Regarding your feedback, I will discuss with our Technical Writing team and hopefully we will improve the documentation in the future.

You have a nice day and weekend as well! :)

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

Return to “Common Problems”