Clickonce missed out folder in bin - c#

Hi how do i publish the files from my bin folder using clickonce?
i successfully copied a folder of .sql script to the bin folder using the Build Events xcopy "$(ProjectDir)\..\project.Sql\AlterProductionServer" "$(TargetDir)\AlterProductionServer" /i /y
My purpose for doing that is to ask the system to check for any database script changes on startup. The system will check the scripts from the bin folder. The reason i xcopy to the bin so that when deploy, my client pc will read it from the same location too. If found, then it will run the .sql scripts to update the database first before running the system.
However, when i clicked on Publish - > Application Files, i do not see the AlterProductionServer folder which contain .sql files that i have already copied to the bin appear for me to choose to Include.
please advice.

When publishing via ClickOnce from within the Visual Studio IDE, it will only offer files from the project/solution, not from the file system. You could add your .sql file to the project, set the build action to Content and specify that it be copied to the output directory. This removes the need for your xcopy build action and makes VS aware of the importance of the file.
If it will still not show in the Application Files section after a rebuild, you may have to look at the prospect of writing your own application/deployment manifest files (XML) and using the command-line ClickOnce utilities to publish your solution. I found this was necessary when including items in my ClickOnce distribution which were not dependencies of the main project.

Related

How can i place zip files in a folder during installation of an msi?

The solution exists out of a wpf project and a setup project. When the user will run the msi, I also want to place some zip files on the file system of the target machine. These zip files would be placed under an already existing path on the target machine (has to be checked for during installation).
Is there a way to implement this by copying the zip archives in the solution and adding file system entries (how?). Or should this be done with "custom action" on the setup project (again, how?).

A C# Setup Project that will copy an additional file if it exists in the SOURCE folder

I've created a setup project which works just fine. However, I'd like to have the ability where if I were to place a config.ini file inside the SOURCE directory of the setup.exe file, this will be copied to the installation directory during installation.
So if there is no config.ini file in the setup folder, the installer would run as normal. But if there is one, this would be copied over to the installation directory on the client machine.
Does anyone know if this is possible, and if so... how?
Many thanks in advance.

Remove unnecessary files from release directory

I use NSIS to create an installer for my project. Wishing to have as small a filesize as I can, I began looking into my project's dlls, included files and prerequesites and noticed the following are all different:
the minimal files required to run, as determined by educated guess + trial and error. I made sure the application works properly with this minmal set of files.
the files exported by the "Publish" fonction for click once deployment (excluding click once specific files)
the files in the release directory (excluding the pdb and vshost files)
It seems VS2015 generates an xml file for every dll. Some dlls I don't use and don't reference are copied as well.
My question is why is there so many unnecessary files and how can I configure VS2015 to not have them in /release?
If you set VS build log level to verbose you will see exactly what happends during build and why a file goes to release folder. Once you determine the reason, you may either change your project file to adjust predefined behavior or add post-build event to remove unwanted files produced by build process.
MSBuild file, located at "C:\Program Files (x86)\MSBuild\12.0\Bin\Microsoft.Common.targets" is very useful to dig into build process details as well.
However, if you indend to distribute the content of release folder to other machines I'd suggest you look at some installation software, like Wix, for example. Once you create a setup project which includes files you do want, there will be no need to fight for release folder content.

How to publish a folder containing some necessary files inside a project

I am going to publish a C# windows form application project.
I have a folder named "Reports" Containing some report file.
when I publish the project , my application cannot find the path of reports.
How can I publish my Reports inside the project?
From solution explorer, choose each file that you need to include in the publish and in the properties of the file set Copy to Output Directory to true. This way your files will be included in bin\debug folder of your application in their current folder names.
Then if you want to use Publish command, go to properties of the project, in publish tab, click on Application Files and check Show All Files and change the Publish Status of the files you need to Include.
Pay attention, if your file's Build Action is Embedded Resource then you don't need to do anything else to include in the publish because it's included (embedded) in resources of your application.

Plugin installation on TeamCity

according to the documentation, installation for tcWebhooks is as follows
Download the jar file. Locate the plugins directory for your TeamCity
install. This is normally $HOME/.BuildServer/plugins/. Create a new
directory (folder) inside the plugins directory called "tcWebHooks"
(it can be named whatever you want). Copy the jar you downloaded into
the tcWebHooks directory. Restart TeamCity.
TeamCity Professional 7.1.4 (build 24331) didn't create a .BuildServer folder and I cannot find that anywhere on my machine. Does anyone know the default path for the installation of plugins? I see there is a plugins folder at "C:\TeamCity\buildAgent\plugins" which contains a lot of plugins but following the above instructions still doesn't seem to pick up the plugin.
You should put your plug-ins into server. They will be deployed to agents automatically.
Just copy the zip file of the plugin into the plugins folder in the teamcity data folder, which by default is C:\ProgramData\JetBrains\Teamcity\plugins.
If you are not sure you can find it under administration > global settings

Categories

Resources