Nuget: Is there a transformation token available to get the location of the package tools folder? - msbuild

I am trying to use Nuget to distribute a ms build .targets file. I need to modify some elements of the file to include the installed path of a few assemblies. For that I would like to use the tools folder. I am having a hard time finding the token (if it exists) to do the replacement. Has anyone encountered this problem or know of a workaround?
http://docs.nuget.org/docs/creating-packages/configuration-file-and-source-code-transformations

You'll have to go the PowerShell route to get this done, as no transform exists AFAIK. The init.ps1 file can process some parameters provided by the NuGet VSIX.
Simply add the following to the top of the init.ps1 file and use the $installPath variable in your scripts that modify the file content.
param($installPath, $toolsPath, $package, $project)
Check here for an example usage.

Related

Extracting MSDeploy Zip package using variables

I’m setting up an automated build in VSTS that will FTP the published files to my server.
I have this working but the way I’ve achieved it, I feel is hacky and non-sustainable.
the process as you can see from the screenshots will publish the artefact which consists of a readme, cmd file and a zip containing all my publish files and then I extract the ZIP with the very explicit location below.
$(Build.ArtifactStagingDirectory)\temp\Content\d_C\a\1\s\IntermittentBug\IntermittentBug\obj\Release_EukHosts\Package\PackageTmp
I’m using a hosted build server in VSTS but as the path contains
d_C\a\1\s\
I assume this will change in time. What I need is a variable to cater for this path so it will always succeed.
How can I update this to make it more efficient and sustainable?
First, as jessehouwing said that the variable is called Build.SourcesDirectory.
Regarding the path structure, the simple way is specifying /p:PackageTempRootDir="" msbuild argument in Visual Studio Build task to remove the source path structure, then the path will be like Content\D_C\PackageTmp.
On the other hand, you also can publish the web app through File System mode.
This variable is caught in a predefined variable called Build.SourcesDirectory. see the complete list of predefined variables here.
In your batch or powershell scripts this variable is available as a environment variable called %BUILD_SOURCESDIRECTORY% / $env:BUILD_SOURCESDIRECTORY.

What is the default path in .desktop files and how to change?

I am installing a package manually on my own system because I need to make some changes to it that aren't available in the basic version in my package manager. I also am trying to keep packages installed locally if possible, so I'm installing it with prefix=$HOME/.local instead of the more common prefix=/usr/local.
When I do this, I have no problem executing the program from my terminal, because I added ~/.local/bin to my PATH and the package was installed with relative paths to its shared libraries (i.e. ~/.local/lib/<package>). Executing from the command line is no problem, but I want to be able to access it from the favorites menu in gnome, and for that I need to make use of the <package>.desktop file.
I could hard-code the path to the executable in the .desktop file itself, but when I pull a later version down and re-install it, I'll have to redo those steps. I was wondering if there's a way to avoid that.
I've tried symlinking the executable to a directory where .desktop files do have included in their path, and the application is correctly treated as a GUI option, but launching the executable results in an error trying to find a shared library. I think this has to do with how cmake handles rpaths, which to my understanding is a way of relatively linking executables with their required libraries.
I think what I want to do is have PATH inside a .desktop file include ~/.local/bin, without changing the .desktop file itself. Can I alter the 'default' path used in accessing a .desktop file?
The answer to my question was found in the Archwiki:
Specifically, I needed to add ~/.local/bin to my path in ~/.xinitrc. Now my graphical programs work as expected.

SSIS Relative File Path for referencing .dtsx files on a execute package task

Hi I have an SSIS package in which i have a main package that references child packages, is there a way I can make the location path external using a Relative path or just the file name. I cant use the full C: drive path as this is subject to change.
yes, but you have to find a way of changing the current working directory of the execution of the package. I worked at one place where we ran bat files to execute the packages and the first line used cd to set the working directory to the folder location of the parent package. I think I've also seen people use a script task inside the parent package to set the working directory based on the runtime location of the parent package.
http://www.artisconsulting.com/blogs/greggalloway/2008/7/13/relative-paths-in-ssis
from what i found it is best to use the project reference system instead of file reference and you can reference any project file if you deploy to the SSISDB instead of the MSDB, it works much better than the MSDB as well as being able to work with package params easier

Howto create Directory in Temp Install Dir for Custom Action

I've got an C# Wix Custom Action which is reponsible for setting up Datatabase.
All needed Dlls are extracted during Installation into C:\windows\installer\currentinstalldir.
So thats fine. The needed Sql Files are in the same Directory, but they have to be copied to
C:\windows\installer\currentinstalldir\sqlscripts.
I've found a way to get what i want.
This code used as PostBuild Function does what i need.
%wix%SDK\MakeSfxCA.exe “$(TargetDir)$(TargetName).CA$(TargetExt)” “%wix%SDK\x86\SfxCA.dll” “$(TargetPath)” “$(TargetDir)Microsoft.Deployment.WindowsInstaller.dll”
Found on buildmaestro
But due to a limitation of cmd.exe (max Chars) I could not add all files I need.
My Workarround ist to Install these Files as a hidden feature and pass the Directory via Install Property to my Custom Action.

TFS api - candidates excluded by file extension

I am trying to import a set of files into TFS using the API. The method Workspace.GetPendingChangesWithCandidates excludes files that match the globally ignored file extensions (.dll, etc). How can I get these files from the API so that I can PendAdd them?
I found an answer but I think it's a kludge. You can edit the LocalItemExclusions.config file found here:
C:\Users\%username%\appdata\local\microsoft\team foundation\4.0\configuration\versioncontrol.
Ultimately, I think the ignored files should be overridden from the API, but I can't find such an option.
It is an older question, but this may help others: Another way to get files recognized as candidates is to create a file called ".tfignore" within the workspace that enables globally filtered files again.
# Do not ignore .dll files in this folder nor in any of its sub-folders
!*.dll
More details can be found here
MSDN: Add files to the server - Customize which files are ignored by version control