Windows 8 - Adding to PATH through Control Panel - windows-8

In order to install Laravel I need to put ~/.composer/vendor/bin into path.
Here is how I've done it but it does not work (homestead is still unrecognizable variable).
I'm on Windows 8. So I went to:
Control Panel -> System -> Advanced -> Environment Variables
Under System Variables I've searched for Path variable which was:
C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\ActiveState
Komodo Edit 8\;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program
Files (x86)\AMD
APP\bin\x86;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files
(x86)\Windows Live\Shared;C:\Program
Files\nodejs\;C:\HashiCorp\Vagrant\bin
I've added C:\Users\myname\composer\vendor\bin to it and therefore changed it to:
C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\ActiveState
Komodo Edit 8\;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program
Files (x86)\AMD
APP\bin\x86;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files
(x86)\Windows Live\Shared;C:\Program
Files\nodejs\;C:\HashiCorp\Vagrant\bin;C:\Users\myname\composer\vendor\bin
Please, take a look at the last words of this long piece of text. Are they written ok? Or should I write something else?
Besides, how do I check that Composer is indeed inside my C\Users\myname folder? The fact is: from wherever I run composer -v (with Git Bash or Windows CMD) I get a positive response. It looks like Composer is successfully installed but I can't actually see it anywhere as a folder.

The docs say to add .composer/vendor/bin/ and you've just added composer/vendor/bin/ (missing the . [full stop/period])
Does the directory on Windows have a . in the directory name?

Related

Xcode Build path and copying additional files

I'm writing a plugin for Elgato Stream Deck. https://developer.elgato.com/documentation/stream-deck/sdk/overview/
Basically it is a binary command line tool written in C++/OBJ-C/Swift combined with a JSON manifest and optionally some HTML and JS files as well as different assets (.png, ...). All files have to be included in a folder (com.companyname.pluginname.sdPlugin) which lives in Library/Application Support/com.elgato.StreamDeck/Plugins/
At the moment, I'm building the binary to the default build path (derived data, ...) and manually copy it to the above folder. But I need to build and run that binary with an executable (Stream Deck app) defined in the scheme for debugging under Xcode. The JSON manifest and assets also lives in my xcode project folder and have to be copied manually.
So Before:
After:
So my question: how can I automate that under Xcode? I assume I can do some sort of post build scripting, but I have no knowledge about all that stuff.
Thanks
Solution:
go to target -> build settings
Deployment Location = YES
Installation Build Products Location = / (empty this one!)
Installation Directory = path to folder (= $INSTALL_PATH)
this will copy your binary to the defined installation path
go to target -> build phases
new phase -> run script
cp -r "$SRCROOT"/<FILE OR FOLDER NAME> "$INSTALL_PATH"/<FILE OR FOLDER NAME>
repeat this for all files and folders you need to be copied to the installation path. be careful with empty spaces in the folder/file names, they won't be recognized correctly and you have to use quotation marks

How to fix 'VSTest.Console.exe' is not recognized as internal or external command

i am trying to run my MSTest from the command line, and I cannot for the life of me figure out why this isn't working. Yes it works if I manually change the directory to the executable, but I don't want to do that every time.
In the image below, you can see I have set up the environment variable, and yes I have restarted my computer many times.
You need to add it to your PATH variable. In that same dialog edit the Path variable and add the folder to the path. For example, I have enterprise installed, so I used this path:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow
After updating the path you will need to close and restart the cmd window.

Visual Studio ASP.NET Web API Precompiled files placed in a different folder with TFS

I have an asp.net web api project whose output needs to be packaged in a setup project using wix.
I would like to precompile the site. The problem is that the precompilation process generates variable file names (ie. *.compiled files in particular).
I also would like to build the setup in a TFS build.
It seems that my only option is to generate a .wxs file wihtin the prebuild step of the wix project.
The .wxs files source paths are using $(var._My_Web_Project_.TargetDir). This seems to be translated to a Sources based directory.
I'm using paraffin to do that already and it works perfectly fine when building the solution with visual studio.
When building the solution through a TFS build, the .compiled files are copied to a Binaries folder, whereas all the other related web site files are copied to a Sources based directory.
The build errors are like the following :
The system cannot find the file 'd:\BuildAgents\___basedir___\Binaries\___web_project_dir\_PublishedWebSites\___site___\bin\textsample.cshtml.c6fb271c.compiled'.
The file is indeed in the Sources directory.
'd:\BuildAgents\___basedir___\Sources\___web_project_dir\_PublishedWebSites\___site___\bin\textsample.cshtml.c6fb271c.compiled'
I think I somehow need to redefine the aspnet_compiler output or something like this, but can't figure out how to do that.
The msbuild command line arguments are the follwing:
/p:GenerateProjectSpecificOutputFolder=true /p:VisualStudioVersion=14.0 /p:DeployOnBuild=true /p:PublishProfile=local /p:CleanWebProjectOutputDir=False /verbosity:d
EDIT 1: I'm using XAML build.
Any help appreciated.
EDIT 2:
With the new task based build, it works as is (no need to use an additional Copy Files task).
The aspnet_compiler output the .compiled files in the correct folder :
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -p D:\BuildAgents\vNext\_work\1\s\Softs\__Solution__\__Web_Project\obj\Release\AspnetCompileMerge\Source -c D:\BuildAgents\vNext\_work\1\s\Softs\__Solution__\__Web_Project__\obj\Release\AspnetCompileMerge\TempBuildDir
In the new tasks based build system, it's easy to copy files from a source folder to a target folder with Copy Files task.
Source Folder: Folder that contains the files you want to copy.
Contents: Specify minimatch pattern filters (one on each line) that you want to apply to the list of files to be copied.
Target Folder: Folder where the files will be copied. In most cases you specify this folder using a variable.

asp.net core gulp path too long

The gulp files installed in a asp.net5 web project use the maximum path length. If you have a project path with more than a few characters long, the folders cannot be deleted.
This post refers to how to build using a short temp directory:
"Path too long" when publishing asp.net 5 from Visual Studio 2015
The question is, how do you easily remove these files when you need to clean up, restore, or archive a project?
Simple answer is file system basics. Create a directory in the same root as your project and give it a really short name (like "c:\t"). Then move all the files in node_modules there. then delete them.
I hear ms is working on a more workable gulp folder structure.
The reason you are hitting the NTFS file, path and name length limit of 255 characters is because of NPM nesting of package dependencies, which is a known Node issue on the Windows stack. You should try to update NPM to the latest version, 3.0 or greater, where they now use a flat approach to handle package dependencies. This will help you avoid the problem "unable to delete" because you will never have paths beyond 255 characters.
Perform the following:
1) Update NPM on your machine, by updating to the latest version of Node (download from https://nodejs.org/download).
2) Update Visual Studio 2015 External Web Tools to point to the folder with the new tools. (Tools-Options-Projects And Solutions-External Web Tools).
Usually:
C:\Program Files\nodejs"
or
C:\Program Files (x86)\nodejs"
Make sure this is the top option on the list of paths.
3) (On automated build) Make sure that Visual Studio does not use the packaged NodeJS version when building your project by passing in the following parameter to MSBuild.
/p:ExternalToolsPath="C:\Program Files\nodejs"
or (x86) if applies:
/p:ExternalToolsPath="C:\Program Files (x86)\nodejs"
After doing a lot of head hunting, I found about robocopy and this command has been my friend since then. I use the following steps to remove a file or folder when the windows path is too long
Create a folder anywhere in your system to use as a source (leave it empty).
Take back up from the folder you want to delete (if there is something important)
Open Command prompt
Type the following command. Modify the placeholders to suit your needs.
robocopy C:\path-to-source-empty-folder E:\path-to-folder-you-cant-delete /purge.
Note: If there are spaces in source or destination path in Step 4, the path must be enclosed by quotation marks.
After successful execution of the command, you will get execution report like the following
Everything inside the destination folder will be deleted forever.
You can also type robocopy in command prompt to see other options.
I hope this helps.

No 'server' JVM at '...'

I'm running a java application that we distribute as a server-side system. I'm trying to write a launcher ("write" is somewhat of an overstatement here, I'm basically just copying the Java.exe file so that we can get the desired name in the process explorer of windows). This exe is in our bin/ directory of our application file tree.
Now, we also have a jre/ directory in our file tree, which is where Java.exe actually resides (we ship our product with the Java environment). When I use Java.exe as the launcher, which is located in \jre\jre1.6.0_21\bin, or if I place the copy (call this exectuable 'Orange.exe') I made in this directory, it works just fine. But, if I put my 'Orange.exe' in the bin\ directory, then I get the following error:
Error: no 'server' JVM at 'C:\Program Files\Java\jre6\bin\server\jvm.dll'
I think I understand what is happening here - I want to use the server version of the jvm.dll file, which is in our jre directory. The problem is, I don't understand WHY it doesn't look in the jre\jre1.6.0_21 directory in my application path. I've set my JAVA_HOME environment variable to this location. It seems like it's defaulting to another, system-wide expected location.
Does anyone know how I can change this, so that it looks in my application-provided java environment directory? Ideally, this will be an environment variable, as I need to call this application with parameters using a batch file.
There is a little trick to get the server JVM up and running:
Copy "server" folder from the JDK's JRE's bin folder example: C:\Program Files\Java\jdk1.6.0\jre\bin\server
Paste the "server" folder to JRE's bin folder example: C:\Program Files\Java\jre1.6.0\bin
Done
See official readme for details.
I've just been struggling with this same problem in Eclipse and I noted that as suggested by the answer above the JBoss site has a thread on this issue saying the same as the answer above to copy files from the jdk to the jre folder.
I noticed that you can avoid having to do this if you define the runtime to be the jdk when you create the server. I didn't find how to edit an existing server though.
AFAIK, the JRE usually doesn't ship with a server VM (only the client VM). If you really need the server VM, you have to use the JDK installation.
See Oracle Java for Developers Download page for JRE's with Server VM.
I had the same problem here but, in my case, I just had not properly update the JAVA_HOME and my PATH for my recently installed JDK.
I just updated it to my new JDK location and the server started just fine.
Windows looks for DLLs in LIBPATH environment variable.
And make sure your 1.6.0_21 is somewhere first in PATH.
I solved the same problem by setting the JAVA_HOME path to C:\Program Files (x86)\Java\jre1.8.0_131\bin
The easiest fix is simply to copy the contents of client folder inside bin and put in a newly created folder 'server' inside bin.
Copy from C:\Program Files (x86)\Java\jre1.8.0_261\bin\client
Paste in C:\Program Files (x86)\Java\jre1.8.0_261\bin\server
*server is the new folder
Make sure that server/jvm.dll file must be there when we are trying to run servers like servicemix.
Copy "server" folder from the JDK's JRE's bin folder example: C:\Program Files\Java\jdk1.6.0\jre\bin\server
Paste the "server" folder to JRE's bin folder example: C:\Program Files\Java\jre1.6.0\bin
I paced problem, I went through above..That's working fine.
Thanks!