VS Setup project: install files in different directories

喜你入骨 提交于 2019-12-01 05:40:50

问题


I have Visual Studio Setup project. And I want to install one of my file to some directory on drive C. How am I supposed to do it?

An example:

I'm installing my app in C:\MyApp. And one file, settings.ini, to C:\Settings\MyAppSettings\


回答1:


You can try using the WindowsVolume property:

  • go to File System Editor
  • right-click the "File System on Target Machine" tree item and select "Add Special Folder" -> "Custom Folder" context menu
  • rename the new folder to something friendly, for example "C Drive"
  • select the folder
  • in its Properties pane set DefaultLocation to [WindowsVolume]
  • in this custom folder add the folder structure you want (MyApp, Settings etc.)



回答2:


As this turned up quite high in the Google results - anyone looking to put the file onto a drive that is not the Windows volume (ie a network drive, or if Windows is not on C drive):

Follow the answer provided by @Cosmin above (add special folder in installer's file system), but put the literal drive path in.

Eg set DefaultLocation to c:\MyApp or z:\desired\location.



来源:https://stackoverflow.com/questions/11499301/vs-setup-project-install-files-in-different-directories

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!