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
FOLLOW US
Get the latest news in Application Packaging