Change install location - sometimes! - Advanced Installer Community

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!

PhilB
Posts: 95
Joined: Fri Jul 06, 2007 4:13 pm

Change install location - sometimes!

I have two separate requirements for items installed via a merge module, depending on the parent install.
The normal requirement (which is working) is simply to install the files from the merge module into the target directory specified in the folder dialog from the main installation. The second requirement is to install the modules into a (pre-defined) location on the same drive as the target location specified in the folder dialog, i.e. if the target location is f:\program files\appname then I need to install the merge module contents in f:\anotherlocation.

I can't seem to find a way to achieve this - can anyone help?

Phil
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Change install location - sometimes!

Hello,

What you need to do is extract the drive letter from the APPDIR property. I am afraid this operation is not directly supported by Windows Installer. Your only option would be to use a custom action to extract that drive letter and form the full install path for your merge module, then store it in a property, say MYTMPFOLDER( i.e. after the custom action has finished, MYTMPFOLDER property's value should be "f:\anotherlocation" without the quotes)

This custom action would be executed in the main msi, not the merge module, under InstallExecuteSequence->Begin standard action. After the execution of this custom action, right after it add a "Property Set with Formatted" custom action that will set MERGEFOLDER.<module GUID> property to [MYTMPFOLDER]. More details about this can be found here and here.

In your merge module, go to "Module Details". On this page, create the MERGEFOLDER property and set it to a default value. On the "Files and Folders" page you will need to add a Property Based Folder and set its property to MERGEFOLDER by selecting it from the list.

Attached is an example project that implements this behavior.

Regards,
Gabriel
Attachments
MergeModuleCustomInstallLocation.zip
(80.99 KiB) Downloaded 341 times
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
PhilB
Posts: 95
Joined: Fri Jul 06, 2007 4:13 pm

Re: Change install location - sometimes!

Thanks for the help - everything is working now!

Phil

Return to “Common Problems”