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
FOLLOW US
Get the latest news in Application Packaging