Copying a file to a specific directory during installation using Visual Studio Setup Project
I have a file - say readme.txt that I want to copy or insert to a directory say
C:\Documents and Settings\fooUsername\Application Data\BarSoftware
during the 开发者_StackOverflow社区installation of my program using Visual Studio's setup project - I know it is something to do with File System Editor but not exactly sure as it has been some time since I have done this type of thing.
- Right click your setup project -> View -> File System
- Right click "File System on Target Machine" -> Add Special
Folder -> User's Application Data
Folder
- All special folders are listed here http://msdn.microsoft.com/en-us/library/s2esdf4x but the "Application Data Folder" is the one that will put files in C:\Documents and Settings\username\Application Data\
- Right click "User's Application Data Folder" -> Add -> Folder
- Name the new folder whatever you like (e.g. BarSoftware)
- Right Click new folder (e.g. BarSoftware) -> Add -> File
- Find your Readme.txt to add to that folder.
For others that stumble across this, if you need a more general location (outside your application directory) see question:
VS Setup project: install files in different directories
精彩评论