ChrisR.
Posts: 4
Joined: Thu Oct 05, 2017 4:29 pm

Installing into specific folder

Hello, I am having some trouble getting the Install Parameters -> Installation Folders -> Application folder to work properly.

I want the program to install to the My Documents; then into a should be preexisting folder; and then create a folder and install into that.

For example: My Documents; Folder: THIS FOLDER; Create folder: HELLO ; and install the files into HELLO.

I am having great trouble with this. I have read over the manual and countless forum posts with no luck. Every time I run the installer, the install path is set default as C\User\Documents and stops there. I need c\users\documents\'THIS FOLDER'\'HELLO'\ to appear as the default. LIke I said I could also use a search function to attempt to automatically find this.

Also given some users move this documents folder around, what would be a good way to search for this folder across drives? I have tried using the search function with no luck.


Really could use some help

Thanks,
-Chris
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Installing into specific folder

Hello,

In order to set the default installation path to " C:\Users\user-name\THIS FOLDER\HELLO" you need to go to "Install Parameters" page and enter the following value in the "Application folder" field :

"[PersonalFolder]\THIS FOLDER\HELLO\"

PersonalFolder is a property that will be resolved at install time to User Documents path as you can see in this article :

Paths of the folders in the "Files and Folders" Page
Also given some users move this documents folder around, what would be a good way to search for this folder across drives? I have tried using the search function with no luck.
For finding the folder you would have to implement a search for a file contained by this folder.

In order to implement this, go to "Searches" page and add a new "File search". Then right click on the search and select "Add Search Location - Folder". In the path field enter the folder where you want the search to be performed. For the entire Windows partition you could enter [WindowsVolume] formatted reference. You should also specify a depth of the search (in how many sub-directory levels the scan will be performed). Please note that the higher the depth of the scan is, the longer it takes for the search to complete.

The result property of this search will be resolved to the full path of the file, for example : "c:\folder\file.exe". In order to obtain the path of the folder you have to parse the result property, removing the file name from the full path. This could be implemented using a VBS custom action implemented like my colleague Dan has explained on this topic : How to get folder path containing specific file

In order to install files in the folder obtained by the search, you could create a new property based folder based on the RESULT_PROPERTY (after it's value has been parsed by the VBS custom action).

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”