Best Practice regarding VC Runtime - visual-studio-2010

Let us take VS 2010 as example. I have an app and that needs to be deployed on the end user's system. I have the following algorithm:
1) If the code is built using Visual Studio 2010 (without SP1) then
the installer needs to check/install atleast VC++ 2010 runtime
10.0.30319.
2) If the code is built using Visual Studio 2010 SP1 then the
installer needs to check/install at-least VC++ 2010 runtime
10.0.40219.
I know that the latest Service Pack(SP) of VC++ 2010 runtime would support the apps developed using non-SP/old SP Visual Studio 2010.
Thus, is it not the best practice to install the latest version of VC++ Runtime on the end user machine, irrespective of the Service-Pack-status of Visual Studio? I feel this will be the safer option when it comes to security etc..
Please enlighten me.

Consider the VC runtime as yet another module in the system, not different from a regular application for the aspect that interests you. Just like for an application, in general you should always have the latest version since it should (at least in theory) be more stable, has more features and less bugs. That said, if you know that a specific version contains a critical bug or a change that interferes with your usage model (e.g., it was freeware and became shareware), you should skip it or adopt your software accordingly.

Related

Programmatically determine if future versions of Visual Studio runtime are installed

When deploying software with the Visual Studio redistributable 2015, if a more recent redistributable is found, the user is presented with a confusing dialog box that implies that something is wrong with the software.
To avoid this, when deploying software with the 2015 runtime, the developer must first check for the existence of more recent versions of the Visual Studio runtime, by polling the registry, and avoid the install attempt if a newer version is found.
For example, here are some checks on a 64 bit system for Visual Studio 2015/2017:
//Check for VS2015 on x86 architecture
if(installer.value("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\
VisualStudio\\14.0\\VC\\Runtimes\\x86\\Installed") == 1)
{
doInstall = false;
}
//Check for VS2017 on x86 architecture
if(installer.value("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\
VisualStudio\\15.0\\VC\\Runtimes\\x86\\Installed") == 1)
{
doInstall = false;
}
if(doInstall===true)
{ //Install }
(Written in Qt for installscript.qs)
You can see the check differs only by the version number, and this currently holds true for all the existing Visual Studio runtimes. I can poll any existing version of Visual Studio and confirm if that install is present by simply changing the version number.
So for now, it's a simple case of checking if 2015 or 2017 exist, and react accordingly.
The problem: After I have released my software, there will certainly be later versions of Visual Studio that I am not currently testing for. I need to future proof my release so that my installer does not attempt to install the Visual Studio 2015 redistributable if there is a hypothetical Visual Studio 2020 already present.
At the moment I feel the only solution is to add in a whole bunch of tests for these hypothetical Visual Studio versions, following the naming convention and going up to some large number that will cover the intended life of the program.
This looks like a Y2kbug type mistake. It feels like there should be a better way. I can't seem to find any posters even considered this problem, let alone solutions for it, so I'm guessing there must be some commonly known, obvious solution, that I'm just missing.
My best guess is that there might be a common registry key that simply indicates if 'any' Visual Studio product is installed, but I have yet to find one.
I would personally regexp parse the version from the path VisualStudio\\**15.0**\\ and then test if myRequiredVersion>ParsedVersion. There is always a possibility that MS (or any company) goes haywire with naming conventions and change the whole path in the future, but that is the risk with everything really. You should maybe ask the user anyways whether he knows there is (newer) runtime/redistributable and allow installing even if you cannot find a proper match.

What can I scrape off the Visual Studio 2015 installation package (like SQL) and still leave it functional?

What can I uninstall from this large chunk of programs without breaking Visual Studio Community 2015. I do not use any SQL services or any .NET frameworks for any sort of development, so I don't need SQL or .NET features. Unfortunately VS forced them upon me.
In fact, I only really use Visual Studio to code C/C++ and Fortran, and have no use for its other features.
In search for a solution I came across this cool preview build which would almost exactly be the solution to my predicament, but I need Intel C/C++/Fortran compiler and Intel Visual Fortran (extension for VS) compatibility to be maintained. Intel does not support non-official releases so VS Preview won't do.
Did you install the VS 2015 through the default installation or custom default? If you chose the default installation, those installed items in your first screenshot should be required for the VS 2015, it is better to keep it to make the VS work stable.
If you chose the custom installation, please have a look at the article and it lists the custom components, then you can remove them if you do not need it anymore. To remove them, you can right click the VS 2015 item under Uninstall a program list table and choose Change-Modify, then uncheck the checkbox of those components that you selected in your original custom installation, then the VS installer will auto uninstall those components. Before you try to uninstall any components, I recommend you backup your Windows OS firstly, you can find the backup method per your OS edition search here.
The .NET Framework is required and the basic component for VS, when you try to create any project types in VS, there is a default .NET Framework version like the following:

Have anyone succeeded in ThinApp'ing Visual Studio?

The purpose is to have a USB flash to have a developer seat everywhere. The idea is to use application virtualization to package Visual Studio.
However, AFAIK, there are big problems.
Have anyone succeeded in packaging Visual Studio (2010, 2008) using ThinApp, App-V, ...
P.S. I'm aware of google.
This is not possible. There's nothing "thin" about Visual Studio, it has an enormous mass of files in many different directories and a very large number of critical registry entries. Including many COM components. That it works as well as it does is one of the modern day's Seven World Wonders of software engineering.
Your license allows you to install VS on more than one machine as long as only one user uses it. I recommend you take advantage of it.
It is possible to install Visual Studio 2013 in App-V, it takes a lot of time to load and takes about 3Gb in .dat file. Compiling and debugging in C++ tested and works but really slow. No errors or popups for missing components so far. After experimenting I made a final virtualization script that works. p.m me.
It is possible to make Visual Studio portable version using VMWare Thinapp. No installation will be needed for Visual Studio, .net Framework or any other dependency. It works with Visual Studio Express edition 2008 as I have experimented but for version 2010, it say "Invalid Licence Data. Reinstall...". If you find a way, please tell me!

What development tool should I use to code in F#?

I got started with F# back in the day (before VS2010 beta); at the time, if I remember correctly, there was not an Express version of F#, but one could use the VS Shell (I think that was the name) and then install F# on top of it.
What's the current state of affairs? I've read out there that there's no 2010 Express version of F#; is there a 2010 Shell that one can download and install F# latest on top of? If not, what's the best way (if any) to code in F# 2010 for free?
I'm aware that asking for free stuff is A LOT to ask for. But this was possible in VS2008 and I'm wondering if it's also possible in VS2010.
Thanks!
PS - I believe (not sure though) that VS2010 beta can be downloaded for free; the problem with that is that when the final release comes out, one will have to pay for a license. For a guy who codes for fun like myself it doesn't make much sense to buy the full version if I can get the very basic features for free...
See
https://stackoverflow.com/questions/734525/getting-started-with-f
Basically right now you can use the free VS2008 integrated shell along with the F# CTP, or use the VS2010RC (which is free as a Beta).
(I don't know if there is a VS2010 shell published yet, and I don't know if the F# CTP works with it; for the moment, your best long-term-free strategy is to use 2008.)
I think you can also use SharpDevelop with F#:
http://www.icsharpcode.net/OpenSource/SD/Features.aspx
If you mean visual F# the best tool is Visual Studio 2010 RC:
Check out these links :
Creating Your First F# Program with Visual Studio
Using Visual F# to Create, Debug, and Deploy an Application
**[Update]**Check out this link too:Features of the Visual Studio 2010 Release of Visual F#

What to do if I don't have Visual Basic 6.0 and need to compile a VB6 project?

A client wants me to do some maintenance work to a VB 6.0 application (migration to .NET is also in the pipeline), but he doesn't have the development tools because he received just the source code and running application from the original programmer, who is no longer available.
Microsoft doesn't sell Visual Studio 6.0, as far as I know. How can I modify and compile the source code for a VB6 application without VB6? or Where do I get Visual Studio 6.0 if Microsoft is not selling it?.
Even if I migrate everything to .NET without releasing a new VB6 version, I would like to be able to open the project and see it compile and run to better understand it.
I have VS 2005 and VB 2008. But I understand that if I try to open the project the code will be converted to VB.NET and that's not what I would want before getting to know the project better.
From what I recall the Visual Studio 6.0 is available for MSDN Subscribers.
Hunt Ebay or Craigslist. Or call your regular software vendor, I'm sure they can still get it for this sort of reason.
Visual Basic 5 Control Creation Edition might be suitable to tide you over until you can get hold of a full version of VB6. There are limitations and it is 5 not 6, but depending on the scope and complexity of the application it might work for you as an interim measure.
Many textbooks on Visual Basic 6 frequently included a fairly usable version if VB (I can't recall the exact name offhand, perhaps VB 6 student edition?) that allowed the compiling of .exe files. VB 5 textbooks usually bundled VB 5 CCE, VB 4 books bundled VB 4 WM, neither of these are suitable replacements for a production VB 6 app IMHO, especially their lack of ability to create .exe files.
I will say, Visual Studio 2005 (VB 8) converted VB 6 apps quite well if that's an acceptable interim solution (which it may not be given the requirement for the large .NET 2.0 runtimes).
To get a feel of the code, you could try to compile parts of the application in MS Office / VBA.
Of course, this will only offer limited functionality, but may suffice for some testing.
Both Amazon and eBay currently have copies for sale (although they seem a tad expensive but this would be a pass-through cost to your customer so it's up to them whether they pay this).
You may want to check out the licence for VB.net; it may allow you to run previous versions of the software, such as VB6 (though you'd still have to source the actual media to install it, of course).
The MSDN "Visual Studio 2008 Professional with MSDN Professional" has previous version of Visual Studio tools but it comes in at USD1200 so, if you just want VB6, eBay is the better option.
Keep in mind that MSDN pack has all the Visual Studio languages and VS6 through to VS2008 so it's probably got everything you need.

Resources