Emptying a folder first before copying new files? - Advanced Installer Community
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Emptying a folder first before copying new files?

Hello,

I have created an installer which needs to delete the files inside an existing (APPDIR) folder, empty it first before copying the new files. How to do that please?

Furthermore, I also want to rename a file in folder without overwriting it. If the file already exists then rename it and then copy the new one. How can I do this as well please?

:)
K
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Emptying a folder first before copying new files?

Hi,
I have created an installer which needs to delete the files inside an existing (APPDIR) folder, empty it first before copying the new files. How to do that please?
In order to achieve this you can go in the Files and Folders page and create a "File Removal" operation in the folder you want to empty, with the following configuration:
  • Name: *.*
    Component: <any component from your package>
    Remove On: Component install
Furthermore, I also want to rename a file in folder without overwriting it. If the file already exists then rename it and then copy the new one. How can I do this as well please?
Unfortunately, we don't have predefined support for this. In order to achieve this you can create your own custom action with this functionality and place it before "Remove Resources" action group in the Custom Actions page.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Emptying a folder first before copying new files?

Hello,

It was really helpful. Thanks for your support.

:D
K
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Emptying a folder first before copying new files?

You're welcome. Glad to help.

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

Return to “Common Problems”