Visual Studio 2012 - cannot find vsvars32.bat to use gacutil to install extra tools - visual-studio

I am running Visual Studio 2012 (version 11.0.50727.1)
I have been trying to install https://jsonsource.codeplex.com/, a tool to allow JSON data to be imported using SSIS. To install this, once I have copied the dll's into the correct folder, I need to register them using gacutilexe. this is where my problem starts. I am supposed to run Gacutil.exe from the Visual Studio command line. This is supposed to be present in the Start Menu as VS2012 x86 Native Tools Command Prompt (it isn't), I am also supposed to be able to access it using vsvars32.bat (using the add external tools menu in Visual Studio, and supplying the location of vsvars32.bat as an argument). However, I cannot find vsvars32.bat anywhere within my C drive.
I have found several versions of GacUtil.exe in various subfolders of C:\program files(x86)\Microsoft SDKs\Windows, although the installation guide lead me to believe it should be in C:\Program Files\Microsoft SQL Server\120\DTS\PipelineComponents, i.e. where I copied the dll's for the tool I am installing. I'm not sure which of these (if any) I should be using once I get to the visual studio command prompt. Could do with advice here as well.
vsvars32 is meant to be somewhere within C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools, but it is definitely not present any where within the Visual Studio folder.. There are also folders for Visual Studio 9 and 10, but these do not contain vsvar32 anywhere within them either.
if anyone could help I would be very much indebted - My options as to how to deal with the JSON source files otherwise are extremely limited. (using Management Studio 2012 rather than 2016, so can't use OPENJSON. If anyone can suggest any alternatives, let me know. This includes just any option to get the entire JSON file file into a cell - I could probably build some kind of extensive string manipulation to script to split it all out once I've got them in there, although this seems like entirely the wrong way to go about things...)

The first time you install the 3rd party package in Nuget Package manager, it will automatically download the .dll to your user temp folder, once you close it, it will gone, but it will register for you. If you need to find where the exactly location is, simply double click that new added .dll in solution window, if you try to reinstall, but it does not allow you to do that, delete the package.config file, and try to reinstall that package. Once that is added again, do not forget to double click that .dll, to see where is reside, move to your own folder, register using gacutil -i command, and should be good.

Related

In a Visual C++ project, how do I give users redistributable .dll files?

I'm a new C++ / visual studio learner so sorry if I don't know something that might be obvious.
Alright so I understand that to get my programs to run on machines without VS I need to distribute the correct .dll files to them. Here are my questions:
How do I know what files to distribute? Once I know the files I need, where can I find them? I already have the .dll package microsoft provides installed but I don't know where to find it or the files in it.
How do I supply these files to the user? Can I just include the files with the installer and then on program start through code move the files to the correct spot? How do I do this? Is it possible to move the files to the correct location through the installer or do I have to do it when the program launches for the first time?
Thanks! Sorry if I left out information or if I formatted this question improperly.
You can choose to statically link your application, then no C++ DLLs are needed.
Otherwise, Microsoft has "redistributable package" EXEs for each version of Visual Studio that you can include with the files that you provide to users. Your installer then runs these as a sub-install. (It does something like start another process that runs that package then waits for it to finish.)
Google visual studio redistributable.
Normally you would use a setup program / installer like InstallShield or WIX, and some of them already have built-in support for adding the redistributables for C++ and DirectX.

Force extension installation in Visual Studio

We're working in quite a large project and is having a hard time getting people to configure their Visual Studio correct (tabs instead of spaces etc.). We found a great solution in using the EditorConfig extension for Visual Studio.
However there are still some developers that seems to ignore our request to install this extension to their Visual Studio and hence I'm wondering if there is any way to force an extension to be installed before a solution can be opened, maybe some setting in the .sln file?
No there is no such option built-in. If your machines are domain joined, you could push out the installer through System Center or domain logon scripts.
You could cheat and create a solution level pre-build step. Create a target file named: before.{solutionname.sln}.targets and store it next to your solution file. Check it into source control. In the targets file you can use standard MsBuild to see if the extension is installed (you'll need to check the file system probably) and if not present force the installation by calling vsixinstaller.exe to trigger the install.

Deploy a VSPackage to create a new project type using Setup Project

I create a new custom project type using a VSPackage project inheriting of MPF library (http://mpfproj11.codeplex.com/). As a result I obtain a .vsix but I need add this project type using a .msi. I'm using the Visual Studio 2010 Setup projet for it. In my setup project I add the content of the VS Package in the same directory where the .vsix put then, but I think Ineed to put in the registre the new type of project because when I use the setup , the project template does not come out in Visual Studio and when I give double click the file with extension of the type of new project and does not recognize it. When I look the registry after install the vsix, this was one of the things that I found diferent. I add this entries in my setup project but It's not working yet.I'm missing something else?
In the projecttemplatedir is the directory where I put the .dll of the project type, the vsixmifest and pkgdef. The project template is in [User]\Documents\Visual Studio 2013\Templates\ProjectTemplates\[Name of new Project Type]\[projecttemplate.zip]
Best Regards
PS: The project type is for VS 2013 but I'm using the VS 2010 Setup project ;)
OK, so first the "don't"s of doing this:
In general, if you are installing via MSI you shouldn't be doing anything user-specific -- no writing in HKEY_CURRENT_USER, nor writing within their Documents folder, LocalAppData, or Visual Studio folders, etc. If you see yourself writing files or registry keys in either of those places, that should be your hint that there's a better way to do what you're trying to do. For what you've shown so far, this raises more than a few red flags for me.
Second, don't ever go writing keys into 12.0_Config. That part of the hive is nothing more than a cache that's built up from other parts of the registry and on-disk .pkgdef files from extensions. It's rebuilt in any number of senarios, including installing new extensions. Any writes there you should presume will get blown away at any time. If you need to write things there you should either (a) write in HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\[version] and run devenv /setup or (2) [preferred] put your keys in a .pkgdef inside your extension which gets merged into 12.0_Config for you automatically.
Now the dos:
You said you already had a .vsix produced by the SDK: you can put project templates in there. You can then register those templates in the .vsixmanifest and those will pull in. That's far easier than mucking around with files in Documents -- that's the user's directory...don't go playing with that.
Once you have a .vsix that does most of what you need, you should simply take the files within that and install the files in a folder within C:\Program Files [(x86)]\Microsoft Visual Studio 12.0\Common7\IDE\Extensions. Even better, you might just want to WiX toolset to build your installer, since it has built-in support for installing extensions. It also has built-in support for invoking the "/setup" process if that's what you need to do as well. Visual Studio Setup projects are no longer supported in newer versions of Visual Studio, so you're better off starting with a technology that isn't already obsolete. WiX is even what we use at Microsoft to do the setup work for Visual Studio itself, so it's definitely up to the task.
Last point: almost everything when it comes to Visual Studio extensibility can be done with a VSIX directly, so presume there's a good way to do something that way before falling back to an MSI. Internally, we can register the entire C# and VB language services with just a VSIX -- they're quite powerful.
I found the answer in this link Registering Project and Item Templates. I set projecttemplatedir entry with
[User]\Documents\Visual Studio 2013\Templates\ProjectTemplates[Name of new Project Type][projecttemplate.zip] that is where i put the project template.

Installing Visual Studio Project Templates without deleting the ProjectTemplatesCache

I'm working on an installer that needs to add several files to AVR Studio 5, an IDE developed by Atmel that is based on the Visual Studio Isolated Shell. These files include project templates for the "New Project" dialog.
By experimenting, I found that I can successfully add the project templates and get them to show up in the dialog if I simply copy them into C:\Program Files (x86)\Atmel\AVR Studio 5.0\ProjectTemplates\ and then delete or rename C:\Program Files (x86)\Atmel\AVR Studio 5.0\ProjectTemplateCache\cache.bin. I have not been able to find any good documentation on how the Visual Studio ProjectTemplateCache folder works. It seems to contain the same files as the ProjectTemplates folder, plus the cache.bin file, so I'm not sure why it would be useful. After I rename cache.bin, Visual Studio does not regenerate it, which makes me worried that renaming it might have some permanent consequences. Is renaming cache.bin a bad idea? What problems can it cause?
Is there another, easy way to install new project templates? Ideally I would like something that is easier than creating a Visual Studio Extension (.vsix) file, as recommended in this previous StackOverflow question: Installing a custom project template with Visual Studio Installer project
The installer I am working on uses NSIS, if that matters.
For my isolated shell I copy my template .zip files to 'Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates' and '\ItemTemplates'. I then run my isolated shell with the command line '/installvstemplates'. This rebuilds the caches and when you next run the isolated shell, they show up properly.
I also had to target the isolated shell in my extension manifest files.
Have you tried any of these?
If per user project templates are fine, you can drop them in <My Documents>\AVRStudio\Templates\ProjectTemplates.

Why can't Visual Studio 2008 locate afxcontrolbars.h?

I have installed VS 2008. When I try to build a project, I am getting an error saying:
Cannot open include file: 'afxcontrolbars.h': No such file or directory
So, I guess I need to have ribbon controls installed for this. Could you please tell me where the SDK is available for download? A link would be very helpful; I googled for it myself, but I could not find it. :(
This seems like a weird problem to me. afxcontrolbars.h is certainly included in a standard VS 2008 installation. The only way you might be missing MFC components is if you installed the Express version, which doesn't come with support for MFC.
The first thing I would do is check to see if I could create and compile a brand new, blank MFC app using one of the built-in templates. If that works, there's something wrong with your project's properties.
Also check manually in the \Microsoft Visual Studio 9.0\VC\atlmfc\include directory to see if you can locate the header file before you try to manually re-install the platform SDK. It may be as simple as Visual Studio not being able to locate the file. To remedy that, open the Options dialog, expand the "Projects and Solutions" tree, select "VC++ Directories", select "Win32" and "Include files" from the combo boxes at the top, and ensure that $(VCInstallDir)atlmfc\include is included in the list:
Of course, the ribbon control (and other ribbon-specific items) weren't added to VS 2008 until the MFC Feature Pack. You will need to download and install that in order to compile applications that take advantage of those features in VS 2008. You can download the Feature Pack here for free.
I have VS2008 on a Win7 64 bit machine.
In my case the include files where installed in the c:\program(x86) folder, but VS was installed in c:\program.
By changing the path to the "hardcoded" path
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\include
it now works!

Resources