Because it is based on the Microsoft® Windows® installer, Microsoft® Visual Studio® Installer works with files grouped as components. Every file you add to an installer project is initially the key file for its own complete component. For example, when you add File1.txt to your Visual Studio Installer project, you create a component that contains only File1.txt. File1.txt is also established as the key file for this component. Any additional files you now add to the component will be non-key files.
Note Registry entries may also be included in components and can be component keys. For information about working with registry entries in components, see Manipulating the Target Machine Registry.
You may want to modify the file structure of your installer components. With the Visual Studio Installer File System editor, you can easily:
You can also manage the file structure of components by working in the Component Properties dialog box. For more information, see Component Properties Dialog Box.
Note All files included in a component must be maintained in the same folder on the target machine. By default, Visual Studio Installer initially adds files in the Application Folder. You may want to move the files you want to group so they are all in the same target folder.
Important You can only select files to group into components. Your selection cannot include a shortcut or a folder.
Note Notice you set the component key file by right-clicking it. If your selection already includes a key file but you don't right-click that file here, it will be demoted (along with all its non-key files) to a non-key file in the target component.
The right pane of the File System editor displays the selected files grouped together as a component. The component key icon with the key file's name indicates the key file. Non-key files are indented in the display and subordinate to the key file.
If you select one of these files, the Component property in the Properties window also reflects the component structure.
To ungroup files from a component
Selected files are ungrouped from the component. Each ungrouped file becomes the key file for its own new complete component. The right pane of the File System editor shows these new components. The files' Component property in the Properties window also reflects the new component structure.
Tip You can also ungroup non-key files from components simply by dragging them away from their component key file to any white space in the right pane of the File System editor.
–or–
The right pane of the File System editor shows the selected files were added to the component. The files' Component property in the Properties window also reflects the new component structure.
To move files among components
Note If you select a component key file, all the files in that component will move with it. If you select a non-key file within a component, you will delete only that file from the existing component.
Each selected non-key file becomes the key file for a new component in this directory. Each of these new components initially contains only its key file.
If you have selected a component key file, the entire component moves to the new directory. If you have selected non-key files, they each become their own component in the new directory.
Note After completing any of these movements, you can regroup or rearrange files in components. (For more information, see To group files in components.)
The file hierarchy in the File System editor's right pane shows component structures, with subordinate files grouped together under key files. You can also review which files belong to which components by checking the file's Component property in the Properties window.
To delete files from components
Note If you select a component key file, you will delete only that file and not any other files in the component. To delete an entire component, see To delete components.
Note If you delete a component's key file, all remaining files from that component become key files for their own complete component.
In the File System editor, you can move a component from one folder to another on the target machine.
All files in a component will move with the selected key files.
The component you moved is placed in the new target folder.
The entire component is deleted from the installer project.
Important You must select all files in the component to delete the component. If you select only the component key file, you will delete only that file. When you delete only the component key file, all non-key files in the component become key files of their own individual components.