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!

DynamicWT9
Posts: 2
Joined: Wed Oct 18, 2017 4:41 pm

Let the user decide where to install

Hello support team,

As a new user I could use some pointers that I cannnot find on your website (but are probably there). I'm building an installer that has to point to a folder in the local user folder and then a folder inside that folder.

c:\user\documents and settings\installfolder1\installfolder2

I have been able to accomplish this, but I also want the user to be able to select an install folder of his own choice (if he does not want to use the folder I defined) by using the 'browse' button in the FolderDlg. How can I accomplish this? Because when I test my installer and point to another folder of my choice in the folder dialog the installer still installs to the path I defined above.

I assume this should be easy to accomplish, but I can't find the solution.
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Let the user decide where to install

Hello and welcome to our Forums,

This could be achieved by modifying the default "Application Folder" from "Install Parameters" page. You could enter "[PersonalFolder]Folder1\Folder2" in this field. This will set the default installation path to "C:\Users\UserName\Documents\Folder1\Folder2\" leaving the user the option of changing it.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
DynamicWT9
Posts: 2
Joined: Wed Oct 18, 2017 4:41 pm

Re: Let the user decide where to install

Thank you Sorin. If I want the installer to search for this folder as well I assume it is possible to do this with your suggestion above? I mean seting a search for folder2 and setting it as the default application folder?
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Let the user decide where to install

Hello,

You are welcome!
You could implement this scenario using a file search operation. This search should return the parth of a file contained by your folder.

Then you should use the method described in this article in order to obtain the path of the folder: How to remove a file or a folder during installation in "Find the folder which contains a file" section.
Basically this method involves a VBScript custom action that will get the full path from the search (that includes the file name) and parses this string in order to obtain the path without the file name. This custom action should run after Searches in both "Wizard Dialogs Stage" and "Install Execution Stage". In order to execute a custom action in both these stages just drag and drop it while pressing Shift key.

Then you could store this result in an Windows Installer Property (using this method: How to set an installer property using custom actions) and use this property to set the "Application folder" fron "Install Parameters"

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

Return to “Building Installers”