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!

vinegredz
Posts: 1
Joined: Fri Jan 29, 2016 2:50 pm

How to determine the path to an already installed program?

Hello!

Building Installers. The files must go over the files of another program, thus creating a backup of the replaced files. There were two questions: 1. How to determine the path to the installed program? 2. How to make a backup of the original files so when you uninstall my program restored the files?
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: How to determine the path to an already installed program?

Hello and welcome to Advanced Installer forums,
1. How to determine the path to the installed program?
For this, you can create a search operation in the Search view of Advanced Installer. Use the [ New Search Wizard ] toolbar button, to quickly and easily set up a new search, following step-by-step directions. For example you can search the the .EXE.

Note that the property assigned to the search operation, will contain the full path, including the .EXE name (e.g. C:\InstallDirectory\MyProgram.exe) if the .EXE file is found, otherwise the property will be empty.
2. How to make a backup of the original files so when you uninstall my program restored the files?
In this case, you need two custom action. The first custom action will be executed during install and it will create a back up. The second custom action will run when your application will be uninstalled and it will restore the original files.

To backup the existing folder, you will need to create a custom action. For example, you can create your custom action as a custom action written in C# or a custom action written in C++. Please take a look on the How to integrate and debug custom actions? article which may be useful to you.

If you will use the DTC C# approach, then you can take advantage of the Directory.Exists Method.

You can also use the Robocopy CMD to copy a folder. For example, you can use something like this:

Code: Select all

ROBOCOPY  <source_folder> <destination_folder> /E
To launch a .bat file, please follow the steps from the How to launch a CMD or BAT file? article.

You can also take a look on the "How to backup and restore files/folders in APPDIR?" thread which debates a similar issue.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

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

Return to “Building Installers”