How to set installation path. - Advanced Installer Community
nvn2005
Posts: 2
Joined: Mon Oct 14, 2013 7:54 pm

How to set installation path.

Hi,

I wanted to install an add-in package to a folder that existed on a target computer. How do I set the installation path the same as the directory where the file search property located.
example: File XYZ.exe is located in folder ABC of target computer.
I created a PROPERTY search for file XYZ.exe to obtain the path, however when run the install package the path always came up as
C:\\Program files\ABC\XYZ.exe
How do I omit \XYZ.exe and keep the path as C:\\Program files\ABC

Thank you for your help
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: How to set installation path.

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

Please note that you can search the folder path, so the the path will be something like: C:\\Program files\ABC . In order to achieve that you can go in the Search page and use the [ New Search Wizard ] toolbar button, to quickly and easily set up a folder search, following step-by-step directions.

Then you can go in the Files and Folders page and add a Property based folder. Property based folders will be resolved at install time to the values from the respective property. This property will be the result of a Search operation.

You can also take a look on the Install in another application's folder article which may be useful.

Please let us know if that helped otherwise give us more details about your specific scenario.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
nvn2005
Posts: 2
Joined: Mon Oct 14, 2013 7:54 pm

Re: How to set installation path.

Dan,

Thank you for your replied. The reason I used File search instead of Folder search because of minimum version of the file XYZ.exe must be specified. Also user might install XYZ.exe in another folder other than ABC.

My scenario is I wanted to install some add-in files that I created into a program (ABC) that already existed on the target computer.
1) Search for file XYZ.exe to check whether program ABC is existed on the target PC. If XYZ.exe Not exist or incorrect version then direct user to install ABC program / update XYZ.exe to newer version prior install my custom add
2) After obtained the location of file XYZ.exe then I can copy my add-in files into specific folders under program ABC. So the installation path c:\\program files\ABC must be located for the add-in files to copy into the correct folders

Thanks,
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: How to set installation path.

Hi,

In order to achieve that you can use your own custom action that retrieve the path C:\\Program files\ABC from C:\\Program files\ABC\XYZ.exe.

Then you can go in the “Custom Actions” page and add a predefined Launch attached file custom action with sequence. This type of custom action can execute an application (EXE or DLL) or run a script (VBScript or Java script). Also, the source file will be embedded in the MSI file but will not be deployed at install time with the other application files.

Please note that I used the predefined Execute inline script code custom action with sequence added after the Paths Resolution "Wizard Dialogs Stage" and I manage to get the folder path where that file was installed.

Code: Select all

 Session.Property("FLD_PTH") = Left(Session.Property("FILE_PTH"), InStrRev(Session.Property("FILE_PTH"), "\")-1)
where:
  • FLD_PTH is a public property that will contain the folder path
    FILE_PTH is the property assigned to the file search operation in the Search page.
Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”