Installing custom template from local nupkg contains additional files - .net-core

I'm successfully creating and installing a custom project template using the pretty good instructions here. The template is installed successfully, however, when I create a new project based on this template the resulting folder contains three additional things I actually don't want to have there:
_rels/.rels
[Content_Types].xml
The original nuspec file
The project template was created locally as a local NuGet package. See the flow of things in the screenshots and
Can anyone tell me how I can prevent these additional files to be part of the project that is generated from my template?

I have faced with the same problem. Found the solution with nuspec file.
the nuspec file was like
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>XYZ.Template</id>
<version>1.0.7</version>
<description>
Creates the XYZ API Template
</description>
<authors>XYZ</authors>
<packageTypes>
<packageType name="Template" />
</packageTypes>
</metadata>
<files>
<file src="**" exclude="**\bin\**\*;**\obj\**\*;**\*.user;"/>
</files>
</package>
The problem was file src expression. The ** expression will be include those files. Move your nuspec file to one folder above. Then change the following line.
<file src="api/**" exclude="**\bin\**\*;**\obj\**\*;**\*.user;"/>

You can exclude files. In your template.json:
"sources": [
{
"modifiers": [
{
"exclude": [ "[Content_Types].xml" ,"_rels/**", "Baumgarb.Demo.DemoWebApi.nuspec"]
}
]
}
]
But I would put all files that are not related to your template outside the template folder.

Related

QFile can't delete files on C drive

I have a listWidget that displays files. I can delete selected files on the desktop and other locations, but files on the C drive will not delete. How can I delete the files on C drive? I am only trying to delete single files, not a directory. I am using Windows. Here is my code snippet.
void MainWindow::on_removeSelectedFile_clicked() {
QString fileToRemove = ui->listWidget->currentItem()->text();
QFile::setPermissions(ui->listWidget->currentItem()->text(),
QFile::ReadOwner|QFile::WriteOwner|QFile::ExeOwner);
QFile::remove(fileToRemove);
ui->listWidget->takeItem(ui->listWidget->currentRow());
}
I have tried setting all of the different permissions.
I have also tried using code below but not sure if I was doing the right thing with it:
extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
qt_ntfs_permission_lookup++;
How can I delete files on the C drive of have permission to delete any file in any location?
To get this working, I needed administrator privileges when the program starts. Here is the solution.
1) Create the rc file :Open notepad and paste the following text inside then save the file as yourappname.rc This creates the rc file. Put the file in the folder that has all of your sourcecode and pro file.
#include <windows.h>
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "yourappname.exe.manifest"
2) Create the manifest file with notepad, paste the following text, and save it as yourappname.exe.manifest and put it in the same location as above.
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="2.0.0.0" processorArchitecture="X86"
name="yourappname.yourappname" type="win32" />
<description>A discription of your app</description>
<dependency />
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
3) In your pro file put the following text:
win32 {
RC_FILE = yourappname.rc
}
That's it. Now your application should start with administrator privileges.
There are similar post that describe this process too. Just make sure there are no spaces in your folder names or it won't work. Also you MUST run qt with administrator privileges for it to work. Right click Qt and run as administrator before trying to compile.

Nuget Packages with content in ASP.net 5

I have a couple packages that include content files (an example would be the wurfl package for getting device data from a user agent, it includes it's database file in the nuget package marked as content).
When adding these packages in an asp.net 5 setting, the content doesn't get added anywhere.
Where or how do I get at the content of these nuget packages added to my solution?
http://blog.nuget.org/20150729/Introducing-nuget-uwp.html
Deprecated Features
Starting with NuGet 3.1 when using project.json, we are deprecating support for executing the install.ps1/uninstall.ps1 scripts and delivering elements in the /content folder of packages. Installing packages that have these elements will not execute the install.ps1 file and will not copy content to your project.
Read the link for more on why...
This is an old question, but my even so old solution seems to work still for Net 5. Here it is:
Include a YourPacakgeName.targets file in your package like this:
<file src="YourPacakgeName.targets" target="build" />
The content of the .targets file should then be:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<MySourceFiles Include="$(MSBuildThisFileDirectory)..\Content\**\*.*"/>
</ItemGroup>
<Target Name="CopyFiles" BeforeTargets="Build" AfterTargets="Clean">
<Copy
SourceFiles="#(MySourceFiles)"
DestinationFolder="$(MSBuildProjectDirectory)\%(RecursiveDir)"
SkipUnchangedFiles="true"
/>
</Target>
</Project>
Effectively this copies the content files before a build and after a clean action.

Where is the update site for `org.eclipse.fx.javafx` (Unable to locate installable unit)?

I have a plugin based product file using:
org.eclipse.fx.javafx
org.eclipse.fx.osgi
I think these plugins come from the e(fx)clipse project.
I am trying to build a target file providing those plugins (a maven+tycho build will be my next step). I thought I could get them on this p2 update site:
http://download.eclipse.org/efxclipse/updates-released/1.0.0/site
My target file looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="my_target" sequenceNumber="1">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.fx.javafx" version="2.2.0.201408150502"/>
<unit id="org.eclipse.fx.osgi" version="1.0.0.201408150502"/>
<repository location="http://download.eclipse.org/efxclipse/updates-released/1.0.0/site"/>
</location>
</locations>
</target>
But I get this error: "Unable to locate installable unit org.eclipse.fx.javafx".
If I edit the location, I can select one of those items:
I have the same behavior with the nightly update site:
http://download.eclipse.org/efxclipse/updates-nightly/site
You should NOT use this update-site to setup a target platform! Use http://download.eclipse.org/efxclipse/runtime-shared-released/1.1.0/site when creating target platforms.
.
The XML content of the Target file looks like this:
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.fx.runtime.min.feature.feature.group" version="1.1.0.201411050602"/>
<repository location="http://download.eclipse.org/efxclipse/runtime-shared-released/1.1.0/site/"/>
</location>
The feature with minimal content is described here: Easier runtime consumption through special features.
in this there is org.eclipse.fx.*
http://download.eclipse.org/efxclipse/updates-nightly/site
if you have problem you can dowload in zip:
http://download.eclipse.org/efxclipse/updates-nightly/site_assembly.zip

Sharepoint 2010 - Feature(Module) Cannot copy sample.txt to "Shared Documents" on web

I am making a feature in sharepoint 2010 foundation and the procedure is below:
1- I created a empty c# project in visual studio and made 3 files in their (feature.xml, elements.xml and sample.txt) (it has been made to copy the sample.txt file to "Shared Documents library"
2- I copied the three files in the 14 Hive features folder in my new folder named "demofeature"
3- I ran command to install the feature which is (stsadm -o installfeature -name demofeature) it ran successfully
4- I am now able to see my feature in (site settings > manage features page) the site/web and I activated it from there
5- I went to shared documents but I cannot see my file there i.e: sample.txt and also I didnt see any errors during the deployment.
Please let me know, what can be wrong here?
I am pasting my code below :
feature.xml
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
Id="2BAC8ED9-3CFF-4922-9E4F-81F8AD9500F9"
Scope="Web"
Title="RHM test feature" >
<ElementManifests>
<ElementFile Location="elements.xml"/>
<ElementFile Location="Sample.txt"/>
</ElementManifests>
</Feature>
elements.xml
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
<Module Name="Deploy" Url="Shared Documents" Path="Shared Documents" >
<File Url="Sample.txt" Type="GhostableInLibrary" Path="Sample.txt">
</File>
</Module>
</Elements>
and a sample.txt file which is placed in the new feature folder.
Thanks
Raj
I would highly suggest using Visual Studio 2010 for creating your features and modules. Otherwise, it is only a high priced text editor. From the menu, select Project > Add New Item, then select Module from the SharePoint 2010 templates. This would generate all of the XML for you correctly.
To your question, try the following XML:
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
Id="2BAC8ED9-3CFF-4922-9E4F-81F8AD9500F9"
Scope="Web"
Title="RHM test feature" >
<ElementManifests>
<ElementManifest Location="elements.xml"/>
<ElementFile Location="Sample.txt"/>
</ElementManifests>
</Feature>
The elements.xml file must be in an ElementManifest element, not an ElementFile element.
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
<Module Name="Deploy" Url="Shared Documents">
<File Url="Sample.txt" Type="GhostableInLibrary" Path="Sample.txt">
</File>
</Module>
</Elements>
Having a Path attribute in the Module element means that SharePoint will search a Shared Documents folder within your feature for all files (which does not exist).

How to add additional files to adobe air installer?

I've created an AIR application, but it uses an external SWF for extra functionality. I want that SWF to be included in the install, but currently it's not. Is there anyway I can get FlexBuilder or any other tool to include this extra file in the installer? I've tried manually adding the file (as a .air file is just a zip file in disguise), but there must be hash checks inside the file.
If you place the SWF file in your application's src directory it will give you the option to include in the installer (previously I tried putting it in the application's root folder).
If you are working in Flash, go to File>Adobe AIR 2.0 Settings. At the bottom of the dialgoue box is a list of included files. Add your SWF to that list.
What if you wanted to add a text file instead to the installer using Flex Builder? I tried to add it using the export release build wizard, but I don't see the text file generated in the application directory...any ideas?
I would add a custom builder, under project -> properties -> builders
I use something like the following for one of my projects that I want to package some mxml and as files with so that the compiler doesn't try to compile them on export. Save the xml below as something like copy_files.xml and add a new Ant Builder to your project. Under the targets tab of the builder I have mine set to run the copy-files target on every clean.
<?xml version="1.0" encoding="UTF-8"?>
<project name="SampleProject">
<target name="copy-files" description="Copy Source Files">
<copy todir="bin-debug/sources">
<fileset dir="sources" >
<include name="**/*.*" />
</fileset>
</copy>
<copy todir="bin-release/sources">
<fileset dir="sources" >
<include name="**/*.*" />
</fileset>
</copy>
</target>
</project>

Resources