We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

BrianO
Posts: 9
Joined: Wed Dec 18, 2013 12:36 am

Clearing Data Folder

I am using AI to push out updates and patches. It is necessary to clearout a "data" folder each time an update is applied. I cannot figure out how to delete all files within the folder before applying new updates. Can you help?
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Clearing Data Folder

Hello Brian,

In order to achieve that you can use a DLL custom action for example, you can create your custom action as a custom action written in C# or a custom action written in C++.

Then you can go in the “Custom Actions” page and add a predefined Launch attached file custom action with sequence.
You can schedule it after the Searches stage. This type of custom action can execute an application (EXE or DLL) or run a script (VBScript or Java script). Also, the source file will be embedded in the MSI file but will not be deployed at install time with the other application files.

Also, you can take a look on the Remove a file or a folder during installation article which may be useful to you.

Please let us know if that helped otherwise give us more details about your specific scenario.

Happy New Year,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
BrianO
Posts: 9
Joined: Wed Dec 18, 2013 12:36 am

Re: Clearing Data Folder

Dan,

Thank you for your suggestions. I was able to get this to work using the files and folders options you suggested.
I took the following steps:

1. I added a property in INSTALL PARAMETERS to define the directory where the folder exists that I want to delete.
2. I used the New File Operation Wizard to delete all files within that folder.

So far it is working on a Win7 32-bit machine, testing now on 64-bit and XP

Return to “Building Installers”