英文:
How to embed/include a file into a VSTO addin
问题
当我发布VSTO插件时,如何嵌入此工作簿,以便在安装VSTO插件时也安装/复制它?此外,如何访问此文件以及其安装位置?
英文:
I have a regular VSTO addin for excel(not the web addin). I have an excel file that I have included into my project, but fiddled with the file type and build properties.
The addin uses worksheets in this workbook as templates to create new worksheets.
I've set the file to copy always and that just copies it to the bin folder and not embed it into the VSTO installer when publishing.
When I publish the VSTO addin, how can I embed this workbook so that it is also installed/copied when the VSTO addin is installed? Also, how can I access this file in its installed location?
答案1
得分: 1
这取决于用于发布插件的安装程序选择。基本上,您有两种可能的方式:
ClickOnce
- 参见如何:指定ClickOnce发布的文件和如何:在ClickOnce应用程序中包含数据文件。MSI
- 如果将Built Action
属性设置为Content
值,文件应该会自动添加到安装程序中。当然,这仅在将项目输出选择为安装程序的基础时才可能。否则,您需要手动将文件添加到安装程序中。要执行更精确的操作,需要了解用于构建MSI文件的安装程序是什么。有关更多信息,请参见使用Windows Installer部署VSTO解决方案。
在处理安装程序时,您可以将VSTO插件视为常规的基于.NET的应用程序。
英文:
It depends on the installer chosen for publishing the add-in. Basically you have two possible ways:
ClickOnce
- see How to: Specify which files are published by ClickOnce and How to: Include a data file in a ClickOnce application.MSI
- if you set theBuilt Action
property to theContent
value the file should be added automatically to the installer. Of course, that is possible only if the project output was chosen as the base for the installer. Otherwise, you need to add a file to the installer manually. For more precise actions need to know what installer is used for building the MSI file. See Deploying a VSTO Solution Using Windows Installer for more information.
You can treat your VSTO add-in as a regular .net based application when you are dealing with installers.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论