Perl script to locate Visual Studio install - perl

I have a perl script that locates a Visual C install on a machine. It works on a colleagues machine. It fails on my machine. I think it is because I have a different version of Visual Studio and it is installed in a different location.
Here is where I think it is failing
$needpath = 1;
$path = $ENV{"PATH"};
if(grep(/VC/, $path)) {
print "Found Visual C on path\n";
$needpath = 0;
}
Q1. Can someone explain what $ENV{"PATH"}; is? The grep function says it is a LIST. A LIST of what?
Q2. My VS location is “C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\” Why can’t this script find it?
I’ve never used perl before. Please be kind! Thanks.

$ENV{"PATH"} is perl PATH environment variable. In your example grep filters list which size equals one, so same effect could be issued by
if ($path =~ /VC/) { .. }
It seems that your VS is not in the path, which can be checked from command line by set path

I have VS 2010 and VS 2013 installed on my machine.
Have nothing in my path and I believe that visual studio works with relative path.
I think you need something similar like this to look at the installed software.

Visual Studio does not update the PATH for a normal install. There are several command-line toolsets available in Visual Studio versions and some computers have two or more versions installed. These would lead to issues of which version should be placed in the PATH. To avoid this Visual Studio installs a number of shortcuts to command windows with the correct paths set for various purposes. These are written to the start menu folders for "Visual Studio 2013\Visual Studio Tools" and for "Microsoft Visual Studio 2012\Visual Studio Tools".
To find the version(s) installed you may be better looking in the directories where the Visual Studio software is installed. Places such as C:\Program Files and similar.

Related

Visual Studio Code Install Multi-User Image / School Environment [duplicate]

I've put Visual Studio Code on OneDrive, for the purpose of syncing it with its settings across my devices.
However, extensions are stored in %USERPROFILE%\.vscode\extensions on Windows.
Is it possible to change this folder's location so I can put it in the main Visual Studio Code folder?
At first I thought that copying the extensions in the resources\app\extensions of Visual Studio Code folder will be a nice workaround, but that doesn't work.
I've also searched for a solution on the documentation page and in the user settings, with no results.
What I did - after installing Visual Studio Code for the first time, I checked the documentation and added at the end of 'Target' field of editor's shortcut the following (there's a space before the two dashes):
--extensions-dir="DRIVELETTER:\VSCODE\extensions"
--user-data-dir="DRIVELETTER:\VSCODE\settings"
where DRIVERLETTER and VSCODE are the corresponding drive and directory where Visual Studio Code is installed. So mine looks like this:
"D:\Microsoft VS Code\Code.exe" --extensions-dir="D:\Microsoft VS Code\extensions"
Here is for the user data directory:
"D:\Microsoft VS Code\Code.exe" --user-data-dir="D:\Microsoft VS Code\settings"
Accessing the 'Target' field is done by right-clicking the shortcut and choosing 'Properties'
Anyway, there's a simpler solution to that problem - just use the portable version of Visual Studio Code. It works under Windows, Linux, and macOS:
Enable Portable Mode
Windows and Linux
After unzipping the Visual Studio Code download, simply create a data folder within Visual Studio Code's folder:
|- VSCode-win32-x64-1.25.0-insider
| |- Code.exe (or code executable)
| |- data
| |- ...
From then on, that folder will be used to contain all Visual Studio Code data, including session state, preferences, extensions, etc.
The data folder can be moved to other Visual Studio Code installations. This is useful for updating your portable Visual Studio Code version: simply move the data folder to a newer extracted version of Visual Studio Code.
macOS
On macOS, you need to place the data folder as a sibling of the application itself. Since the folder will be alongside the application, you need to name it specifically so that Code can find it. The default folder name is code-portable-data:
|- Visual Studio Code.app
|- code-portable-data
Portable mode won't work if your application is in quarantine, which happens by default if you just downloaded Visual Studio Code. Make sure you remove the quarantine attribute, if portable mode doesn't seem to work:
xattr -dr com.apple.quarantine Visual\ Studio\ Code.app
Note: On Insiders, the folder should be named code-insiders-portable-data.
UPDATE 14.12.2021
From Visual Studio Docs
Note: Do not attempt to configure portable mode on an installation from the Windows User or System installers. Portable mode is only supported on the Windows ZIP (.zip) archive. Note as well that the Windows ZIP archive does not support auto update.
A little hack:
Create a symbolic link to the folder %USERPROFILE%\.vscode\extensions under the Visual Studio Code install path.
https://code.visualstudio.com/docs/editor/extension-gallery
code --extensions-dir 'new_directory_to_set'
Set the root path for extensions.
Follow the below steps for changing the extension path in VS.
Set "code" path in environment variable.
path = VS_CODE_INSTALL_DIRECTORY/bin;
Open VS , in VS terminal execute the below command.
code --extensions-dir "new_directory_path"
Install the required extension.
All Done.
Note:Dont forget to vote the answer
According to this page, after installing VS Code we should make a language profilers folder like this:
mkdir code_profiles
cd code_profiles
mkdir code-ruby
cd code-ruby
mkdir exts
mkdir data
For Windows, I prepared a batch file (.bat) for each language I work on, it contains this line:
Start "" "D:\programs\VSCode\code.exe" --extensions-dir D:\programs\VSCode\code_profiles\code-python\exts --user-data-dir D:\programs\VSCode\code_profiles\code-python\data .
This is for Python. If I work on PHP, I will make code-php folder, then make exts and data folders in it and prepare another batch file for PHP, just like the one I made for python.
I put this batch file on the main project folder then double click on it to run VS Code with the preferred profile.

Unable to find the TF executable while adding tfs to VSCode

I am adding TFS to Visual Studio Code IDE(1.42.0) for that I have installed Azure Repos extension.
In VS code at File-->Preference-->Setting-->Tfvc:Location, when I am entering path C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe.
Getting error
(team) Unable to find the TF executable. Please ensure TF is installed
and the path specified contains the filename.
How can I solve this issue?
Edit 1: After installing Azure Repos extension, I am entering above path in tfvc:Location(for both tabs User and Workspace), but after entering path nothing happens. Check below screenshot
Edit2: Now I am getting this error at right below in VS code IDE
Since you have not got any help yet. I will take a shot. Any chance there is a issue with finding the executable and casing for the extension? My local TF is capitilized. \TF.exe
Also might want to checkout the Github and readme for TFVC.
Make sure you have installed VS on your computer. With a typical installation of Visual Studio, the Windows version of the TFVC command line client (tf.exe) is available under the Program Files (x86) folder. It will typically be placed in a location similar to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe. On the 2017 version of Visual Studio Community, it can be found in a location similar to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe.
I found a .vscode folder in my project
delete it, close and reopen vscode solved the problem

Doxygen for verilog code

I need to document my verilog code using Doxygen. I've installed doxygen version 1.8.10 and doxverilog version 2.6. Moreover, I've xilinx 12.0 and microsoft visual studio 2010 for windows 64 bit. I've followed the following steps and need guidance more as I'm very new to this Doxygen software.
Copy the Verilog files verilogparser.y verlogscanner.l and the others source files from "C:\Doxverilog2.7\sources" to the "C:\doxygen-1.8.10\src".
Copy the patch file "windows.patch" from "C:\Doxverilog2.7\sources" to the "C:\doxygen-1.8.10".
The next step is mentioned in the "ReadMe" file of "Doxverilog2.7" as:
open a shell in the doxygen-1.8.1 directory
make patch # patch -F3 -p1 < windows.patch
but how do I open it? and what is meant by this shell? From where I can get it?
The next step is provided as"Open doxygen-1.8.1\winbuild\Doxygen.vcproj with Visual C++ 2008 Express Edition" but when I build this project in Visual Studio 2010 then it gives me several errors and it is not successfully built. Is there any such project that can be run on visual studio 2010 instead of visual studio 2008?
Also, I want to use Doxywizard so, do I need to follow these steps? Please help me out of this problem.
Thank-you.

Building QGIS source code on Windows 7 - Not working

As mentioned here I've tried to build the QGIS on Windows 7.
There are two methods one using Visual Studio Express Edition installer and the second one using MinGW.
I've found both of them broken and don't know what to do next
In building using Visual Studio
The link to visual studio actually installs the version 2010 but documentation assumes it version 2009. So "set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\Tools\" path is not found.
Also I'm confused about the context of this line:
If the path to bison and flex contains blanks, you need to use the
short name for the directory (i.e. C:\Program Files should be
rewritten to C:\Progra~n, where n is the number as shown in `dir /x
C:``).
In Building using MinGW 4.2.1. MSYS link is not found(404) but when I try to build step by step I find XDR 4.0 not found(404) in this page
So what's the way to build it?
All I want is to change the title and startup photo of QGIS Desktop software.
Using another application I'm now able to change the title of running QGIS but don't know where to change the photo which shows "Loading plugins...".
The build instructions for Windows 7 are a tad long in the tooth, but they work for the most part. I did not try MinGW.
I immediately changed the VS90COMNTOOLS path to point to the Visual Studio 2010 directory and it seemed to work for me:
set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio 10.0\Common7\Tools\
Regarding bison and flex configuration, I used the latest version of CMake (3.3.1 as of now) and didn't encounter any warnings/errors pertaining to bison or flex. Are you encountering any right now? If not, you should be able to proceed.

The web publishing extension is not installed which is required to publish

I was tring to deploy an ASP.NET Web Application to a Windows Azure Web Site by following the tutorial through this link: https://www.windowsazure.com/en-us/develop/net/tutorials/get-started/
After download the public profile, which is a ".PublishSettings" file, I go back to Visual Studio and right-click the project in Solution Explorer and select Publish from the context menu as the tutorial said. However, a warning box jumped up and it showed me that "The Web Publishing extension is not installed which is required to publish. You can install it from http://go.microsoft.com/fwlink/?LinkID=208120."
I already installed "Windows Azure SDK for .NET (VS 2012)" and I also tried to uninstall this and install again, but the same problem is still there.
Anyone knows how to solve this? I am really appreciated.
I ran into 2 issues, which were related. One was the web publishing extension is not installed which is required to publish, and the other was the web extension package did not load.
I'm upvoting and reposting user3918092's solution for others who run into this issue and do everything including:
Deleting the ComponentModelCache out of
C:\Users\...\AppData\Local\Microsoft\VisualStudio\12.0 and
C:\Users\...\AppData\Roaming\Microsoft\VisualStudio\12.0
Repairing Azure SDK 2.4 and VS2013U3 Uninstalling and reinstalling
both Azure SDK 2.4 and VS2013U3
Removing extensions from the solution
Ignoring the extensions on VS startup
Using devenv /setup and devenv /updateconfiguration to try to reset the configuration
The solution is:
Reinstall the following items to your GAC using the following commands from the vs command line run as an administrator:
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Publish.dll"
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Internal.Contracts.dll"
Thanks to user3918092!
I had the same problem on Visual Studio 2013 (Asp.net and web tools 2013 extensions have not been installed)
Solve it by re-install Visual Studio 2013 update 3.
http://www.microsoft.com/en-us/download/details.aspx?id=43721
This has worked for me.
I had Visual Studio express 2012 then installed Visual Studio 2013 needed the azure tools so I installed 2.4. I lost publishing at this stage and
unistalled Visual Studio express 2012.
So that is how I think it got out of kilter.
The solution was to reset the assemblies for Contract and Publishing using the Developer command prompt as Administrator.
If you have used the default installation setting then this is probably the path
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Publish.dll"
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Internal.Contracts.dll"
Same issue with Visual Studio 2015.1 after installing a Web Tools update.
The assmeblies that have to be installed into gac are now:
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Publish.dll"
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Publish.Core.Contracts.dll"
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Publish.Contracts.dll"
I have the same problem. After reinstalling VS 2013 update 4 and Azure SDK 2.6 problem still persists.
But then I tried the next thing:
In section Control Panel > Programs > Programs and Features select and repair Microsoft ASP.NET and Web Tools 2013.4.
And publish option started to work again.
I had this issue upgrading VS 2013 Ultimate from update 3 to 4. I had also a message about Microsoft.VisualStudio.Web.PasteJson.JsonPackage did not load properly when loading a Solution.
Repairing VS was enough for me to work again the publishing option.
http://connect.microsoft.com/VisualStudio/feedback/details/758298/not-able-to-publish-web-application-after-installing-visual-studio-2012-rtw has a work-around but it's a painful reinstall with additional folder deletion.
register GAC also work when have this problem after update VS 2013.2 to VS 2013.3
I had similar problem, but my error is related to scaffolding item.
I need to uninstall visual studio and went through all the related folders, registry and re-install visual studio in order to make it work!
Folders that I checked:
%App Data%
%Program Data%
%Program Files%
Windows
Hope that help :)
I uninstalled VS2012 again. Before I re-installed (a 3rd time), I went to my user's AppData and Documents folders and found all instances of Visual Studio 2012 and deleted them. Then I re-installed VS2012 and now Web Publishing is working.
Folders I deleted after uninstall:
C:\Users\USERNAME\Documents\Visual Studio 2012
C:\Users\USERNAME\AppData\Local\Microsoft\VisualStudio\11.0
C:\Users\USERNAME\AppData\Roaming\Microsoft\Microsoft Visual Studio\11.0
C:\Program Files\Microsoft Visual Studio 11.0
C:\Program Files (x86)\Microsoft Visual Studio 11.0
I had this happen today out of the blue for a vs2013 project that was publishing fine previously.
I solved it by downloading a 'Visual Studio Web Publish Update' package from here.