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!

hein.ve
Posts: 1
Joined: Wed Feb 08, 2017 9:36 am

Installing to multiple locations

Hi,

I've written an installer using the Enterprise version of Advanced Installer, and I've managed to get the following correct using inline powershell, but I'm hoping there is a built-in solution that works better.

We would like to install a 3rd party plugin for a platform that have multiple versions running. The user is given a list of possible directories of the platform. This list is constructed during installation based on a certain file that exists (I basically iterate through %APPDIR% directories, looking for directories that contain this file) as we don't know the directory names when building the installer. The user then ticks which directories the plugin should be installed into and continues with the installation.

What I'm currently doing, is I've added the plugin-files to the Temporary Directory of the installer, and no files in the Application Folder. Then based on the directories the user chose, I use a custom inline powershell script to copy the files from the Temporary Directory to the chosen directory.

As I said this works with the powershell script, but I run into problems when the directory chosen gives Access Denied errors, which makes rolling back a big problem with this solution.

I'm hoping there is a built-in way to do the above in Advanced Installer?


Thanks in advance.
--
Hein.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Installing to multiple locations

Hi Hein and welcome to Advanced Installer forums.

The way to copy a file to multiple locations is to add it to the desired folders from the "Files and Folders" page. However, if you do not know those locations when you configure the project, the recommended solution is to copy it to one location, then create a custom action that will copy that file to the other locations (just as you tried).

Please note that it is not necessary to copy that file to a temporary directory, you can place it in the "Application Folder" from the "Files and Folders" page, then set the "APPDIR" property to the first location the file should be copied to (before the "Path Resolution" action group), then copy the file to the other locations from the first one. The custom action must be executed after the "Add Resources" action group as "deferred" with "no impersonation".

Another method (if you know the maximum number of locations), is to add the file in a predefined folder, create more property-based folders, then create a "Duplicate File" operation in each folder, assign those locations to each property-based folder and execute the "Duplicate File" operations conditionally by setting the appropriate condition for their related components from the "Organization" page.

Just let me know if you need more details.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”