Hello and welcome to Advanced Installer forums,
Unfortunately, this scenario is not so easy to automate (will explain why a bit later).
It's commun that the user has more than one version of this software, so i need to determine the last version installed and point the installer to that one (ex.: c:\program files\Corel\CorelDRAW Graphics Suite XXXX\Draw\GMS , where XXXX is the version of the software.. like 2020, 2019, X8 ...).
Let's start with this.
First of all, we will need to find an element that is related to Corel that is always constant (it does not change from one installation to another) and that can help us identify the version. Such element could be: a registry entry, a file, etc..
For instance, most installation packages write into the registry the version that they install. Most likely, this is the case for Corel as well.
Based on this criteria, we will create in Advanced Installer a
Search. For instance, if we are looking for a registry, we can create a
Registry Search.
Now, considering your files are all placed in the
"Application Folder" (in the
"Files and Folders" page), we will need to change its default value to our folder. This can be done through a
"Set Property" custom action, scheduled in the
"Wizard Dialogs Stage", between
"Searches" and
"Paths Resolution" action groups. This custom action should set the APPDIR property to your desired value (the APPDIR is the property that stores the path of the
"Application Folder"). The custom action could look like this:
Property: APPDIR
Value: <desired value>
Condition: here we can use the property that stores the value of the search
Now, why I have said that the process is not easy to automate and hardly any part of the process is programmable.
Well, there are a lot of things that can differ from a user machine to another.
For instance, is the user running a 64-bit version of Windows? If so:
- does he have installed a 32-bit version of Corel? If so, the path will look like this:
C:\Program Files (x86) instead of
C:\Program Files
- does he have installed a 64-bit version of Corel? If so, then the path will look like this:
C:\Program Files
What if the user decided to install Corel into a completely new directory (e.g.
D:\SomeFolder\Corel\[...]). If this is the case, then all we've done above will be pretty much useless.
Hope this helps somehow.
Best regards,
Catalin
FOLLOW US
Get the latest news in Application Packaging