0

I would like to detect if a previous program is installed, and if yes, copy some specific files and folders from this program.

I need to detect this program installed dir, as the user is able to change the installation dir, and abort the installation if the program is not installed.

I`ve created an entry in the upgrades session, selecting the program msi, and the installshield instalation designer already filled the entry with the program upgrade code. But after trying to recompile the program without the program installed, i was able to install the same way. Creating an entry in the upgrade session does not make the install to interrupt when the program is not present, and i didnt understand where i have to put the detect property value to make the install stop.

Fábio Carneiro
  • 115
  • 2
  • 11

1 Answers1

1

You need to use Application Search rather than Upgrade.

Upgrade tables are used to find previous versions of the same application and, if found, perform the upgrade: remove the previous version and install the new version.

Read Searching for Existing Applications, Files, Registry Entries or .ini File Entries, or similar sections in documentation for InstallShield.

Alexey Ivanov
  • 11,541
  • 4
  • 39
  • 68
  • Thx a lot for your answer. The only option that i was able to find in install shield premier was "system search". It opens a wizard that helps me find files, folders, registry entries, ini file values, xml file values. I`m not sure if i`m able to use them to find if a another msi was installed and copy some files from this app to my app install folder. – Fábio Carneiro Oct 21 '12 at 22:27
  • "File or directory searches are used to determine whether a user has already installed a version of an application." What if the user selected a different installation path? This option does not solve my problem. – Fábio Carneiro Oct 21 '12 at 22:54
  • First of all, it's not a recommend way to copy files from another installation. They must belong to the same component, in that app and in your app – then the installer automatically detects it. – Alexey Ivanov Oct 22 '12 at 10:15
  • The installation paths are usually stored in the registry. So you would look up the installation registry keys of that application, perform a file search on the path obtained from the registry. Nevertheless the best way is to make your installation package self-contained: the package itself contains all the required files to run. What is even more important is that you can't copy those files using Windows Installer engine unless you add temporary rows to the msi database or, which is not msi-way, using a custom action. What if that app is uninstalled? – Alexey Ivanov Oct 22 '12 at 10:21
  • My application is a path for another program not created by me. My goal is to detect if this program is previously installed, get the install dir, create my own installdir, make a copy of that program to my own folder and apply my files to this new folder, so the original version of the program will not be affected. – Fábio Carneiro Nov 02 '12 at 21:00
  • It will not be a good idea to include the other program, as it very big (1.5GB+), and i dont want my user to download it if the user already has everything necessary to run. If the app is uninstalled, the user has to install it before. Also, i coudlnt find the path in the registry, i`m not sure if i knew where to find. – Fábio Carneiro Nov 02 '12 at 21:16