How to install in specific folder - 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!

SenTnel
Posts: 1
Joined: Wed Jul 09, 2008 12:20 pm

How to install in specific folder

Hello ! Probably Im doing something wrong because is not working the way I need to, I need to install some files in an specific location, let's say:
" C:\Program Files\aplication\sample\icon\ " , I have a couple of pc's, it works fine in the pc's that the operating system is in the common C:\ , but I have a pc with a D:\ drive operating system, when installing in that machine it change my intended path to D:\ , but I need my folders (because of a network link) to be located ALWAYS in " C:\Program Files\aplication\sample\icon\ " , please help me acomplish that.

A second question if I may, can I include in my installation file another installation? Let's say that my application runs with Google Earth, wich is a free download, can I make my installation and have the Google Earth installation in it, and run it with my app installation?

Thanks!
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: How to install in specific folder

SenTnel wrote:Hello ! Probably Im doing something wrong because is not working the way I need to, I need to install some files in an specific location, let's say:
" C:\Program Files\aplication\sample\icon\ " , I have a couple of pc's, it works fine in the pc's that the operating system is in the common C:\ , but I have a pc with a D:\ drive operating system, when installing in that machine it change my intended path to D:\ , but I need my folders (because of a network link) to be located ALWAYS in " C:\Program Files\aplication\sample\icon\ " , please help me acomplish that.
Hello,

I don't understand this problem description. What do you want to do in case there is no C: drive? Abort the installation?
SenTnel wrote:A second question if I may, can I include in my installation file another installation? Let's say that my application runs with Google Earth, wich is a free download, can I make my installation and have the Google Earth installation in it, and run it with my app installation?
This is possible. For example add the other installer file as a temporary file in "Files and Folders" (right click on desired location, pick "Add temporary files...") and execute it via a custom action (see "Custom Actions" in "Project Details"). I am not sure at which point that custom action would have to added, however.



Bye bye

clemens
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: How to install in specific folder

Hi,
I need my folders (because of a network link) to be located ALWAYS in " C:\Program Files\aplication\sample\icon\ " , please help me acomplish that.
Usually the files of your application are placed in the "Application Folder" directory in the Files and Folders page. The default path of this directory is set in the Install Parameters page to:

Code: Select all

[ProgramFilesFolder][Manufacturer]\[ProductName]
Since the [ProgramFilesFolder] property is always resolved to the path of the "Program Files" folder on the target machine, the path of "Application Folder" may differ on each machine (depending on the partition on which Windows is installed).

Therefore, if you want to always install your files in the "C:\Program Files\aplication\sample\icon\" folder, you can follow these steps:
- go to the "Install Parameters" page
- create a new property and name it MY_DIR (you can use any name you want as long as it contains only uppercase letters)
- set the value of this property to C:\Program Files\aplication\sample\icon\
- go to the "Files and Folders" page
- create a property-based folder by using the custom property
- add your files in this folder

Note that if the C:\ drive does not exists on the target machine, the installation may not work. Therefore, you should test if this drive exists and set a valid path for the folder otherwise. For this you can use a search and a "Property set with Formatted" custom action:
- go to the Search page and create a new search
- right-click it and use the "Add Location" menu to add a Folder as the search location
- set this folder to the C:\ drive
- rename the search to something meaningful (for example "C_DRIVE")
- go to the Custom Actions page
- use the "Show Standard Action" button on the toolbar to show the "InstallUISequence" -> "AppSearch" standard action
- under "AppSearch" create a "Property set with formatted" custom action
- set the "Property Name" field to MY_DIR
- set the "Formatted Text" field to [ProgramFilesFolder]aplication\sample\icon
- set the "Expression" field (at the bottom of the page) to NOT C_DRIVE (the property of the search negated)

The search will try to find the C:\ drive. If it cannot find it then the property of the search will be empty ("NOT C_DRIVE" is true) . Therefore, the custom action will set the path of the installation folder to a valid path.
can I include in my installation file another installation?
Windows Installer does not allow to MSI-based installations to run at the same time. Therefore, if you want to launch another MSI-based package, you can add it as a prerequisite (recommended) or launch it through a custom action scheduled under InstallFinalize (not recommended). However, if you want to launch a non-MSI installation package, you can use a custom action.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”