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!

Viper786
Posts: 1
Joined: Sat Jun 07, 2014 1:35 am

Move all files to a new folder if installation already exist

Hello, I was wondering if it is possible that after a user selects a path to install the software, if that folder already exists, I would like to move everything in that folder to a new folder, for example appname.old or something like that. Is this possible to do? If so, how do I go about doing this?

Thanks!
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Move all files to a new folder if installation already e

Hello and welcome to Advanced Installer forums,

In order to achieve that you can create your own custom action which implements this functionality, to search if the related folder already exist on the target machine. 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 without sequence. 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.

You need to execute this custom action on the Next > control from the FolderDlg as a Published Events. Please take a look on the How do I execute a custom action when a button is pushed? article with related information for hints and guidance.

In order to determine if a directory exists, you can use the Directory.Exists() method.

Please let me know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”