I am using VSTO to build an Excel AddIn. In this project, I also added some python
Publish page of an office add-in project doesn't have an
Application Files button which means you can not include some files in the click once installer in the way that you do it for applications. As an option, you can put your files as embedded resources and then at startup of the add-in, extract them from resources and copy them to add-in output directory.
To do so, you can add your file to
Resources.resx and then at
StartUp of your add-in, extract the file from resources and save it to the deployment directory and use it.
var assemblyLocation = System.Reflection.Assembly.GetExecutingAssembly().Location; var assemblyFolder = System.IO.Path.GetDirectoryName(assemblyLocation); var file = System.IO.Path.Combine(assemblyFolder , "test.py"); if (!System.IO.File.Exists(file)) System.IO.File.WriteAllBytes(file, Properties.Resources.test);
Now the file is in the path specified in