How to create vc++ program which can be install - visual-c++

Thanks in advance...
I have a solution in vc++ and it is working fine. I need to create this as a program that can be installed. Also need to create a start menu folder and a desktop icon. What are the steps to create this?

Use an install builder. There's several (free) ones around on the web that you can search for.
Personally, I recommend InnoSetup by Jordan Russel. It's free, nice, easy to use, and very rich in features : (quoting from website)
Support for all versions of Windows in use today: 7, 2008 R2, Vista,
XP, 2008, 2003, 2000, Me, 98, 95, and NT 4.0. (No service packs are
required.) Extensive support for installation of 64-bit applications
on the 64-bit editions of Windows. Both the x64 and Itanium
architectures are supported. (On the Itanium architecture, Service
Pack 1 or later is required on Windows Server 2003 to install in
64-bit mode.)
Supports creation of a single EXE to install your
program for easy online distribution. Disk spanning is also supported.
Standard Windows 2000/XP-style wizard interface.
Customizable setup types, e.g. Full, Minimal, Custom.
Complete uninstall capabilities.
Installation of files: Includes integrated support for "deflate",
bzip2, and 7-Zip LZMA/LZMA2 file compression. The installer has the
ability to compare file version info, replace in-use files, use shared
file counting, register DLL/OCX's and type libraries, and install
fonts.
Creation of shortcuts anywhere, including in the Start Menu and
on the desktop.
Creation of registry and .INI entries. Running other
programs before, during or after install.
Support for multilingual
installs, including right-to-left language support.
Support for passworded and encrypted installs.
Support for digitally signed
installs and uninstalls.
Silent install and uninstall.
Unicode installs. (Windows 2000/XP or later)
Integrated preprocessor option
for advanced compile-time customization.
Integrated Pascal scripting
engine option for advanced run-time install and uninstall
customization.
Full source code is available (Borland Delphi 2.0-5.0
and 2009).

I would learn Wix if I were you. The current tutorial at http://wix.tramontana.co.hu/ will help you quickly implement the setup for your application. Also, this will be a good investment in knowledge and it will allow you to implement more complex setup applications in the future.

Related

How do programmers create a cross platform installer for both Windows and Linux?

I have searched high and low for installers to customize after creating my applications (small, medium, and much bigger) in size. Yes, portable apps great but most people just want to install and also have it just update when updates are available and install and restart the next time or at least warn the user to save the work before the Application can reopen.
Yes, I have looked at NSIS and other installers, but they are merely for windows and not for both windows and Linux. Some of these installer projects have been discontinued. Most people who use Linux don't like to always build from the source.
I was wondering how I can create a POSIX compliant installer that my software can install on both Windows and Linux. What are the steps involved? I assume most or all installers use C++ to do all of the grunt work. I am interested in creating my own to fully understand C++ and how it works. This why I really need to know how an installer is made. Any helpful advice is welcomed.
Thanks in advance.
"Mainstream": A shared packaging format seems elusive. However, there are a few multi-platform deployment tools available. Installsite.org has a list towards the bottom here. I guess the two most commonly used tools are (both are commercial):
Advanced Installer for Java / Advanced Installer Enterprise (Windows and Mac, no Linux)
Flexera InstallAnywhere (Windows, Mac, Linux)
From this answer:

Installshield LE and Express not detecting Office 2010 64bit

Microsoft's vexing dumping of vdproj install projects in VS 2012 leads one to try Installshield LE which is sort of built into VS2012. Sadly, it creates installers that do not work in any way shape or form with 64 bit.
So for instance clicking the Office 2010 installed checkbox only makes a prerequisite for 32 bit Office. It fails to detect 64 bit.
After a lot of chickenless head exploration of Installshield the bottom line is:
1) You need the Professional or Premiere version in order to deal with 64 bit.
2) You need to edit their provided condition to make a compound one that ORs all the guids of Office that you are interested in together as it only checks for one of the many out of the box. This details the structure of the GUIDS: http://support.microsoft.com/kb/2186281?wa=wsignin1.0. I found it helpful to install various versions in a VM and then using regedit to see what the GUID ends up being.
This post is so that someone can actually discover this with a Google search, instead of it being hidden behind a paywall / private support site.
Update October '13 AlBear
There is a beta version of installshield LE for VS2012/13
To build x64 installation packages check on the help files
Look for "64 Bit" .
The way InstallShiel LE recognizes x64 target is by either defining the [INSTALLDIR] property as one of the 64 bit Folder or by defining at least one of the setup components as 64 Bit.
This works as I built an Excel 2013 Add that loads at startup and works fine.
For the Prerequisite for VSTO to work: You need to change file size and hash a it looks like the recommendations from Microsoft article "Deploying Office solutions vsto 2013" are outdated and the XML code recommended has the wrong file size and hash. Not too difficult to fix. However I think that Microsoft is unfortunately going through a period of crisis and this failure to provide reasonable support is uncharted territory .......
Cheers
InstallShield and WiX is like Visual Studio using VB.NET and SharpDevelop using C#. Just as those tools both create EXE's and DLL's using IL code but different language providers,
InstallShield and WiX both create Windows Installer databases using different languages. Just as a VB EXE can consume a C# DLL, an InstallShield MSI can consume a WiX Merge Modules. This gives you the best of both worlds.
The thing to understand is a VSTO AddIn installer isn't a 64bit MSI, it's a 32bit MSI that deploys an AnyCPU DLL with registry entries for either 32bit or 64bit Office. It's the bitness of Office, ultimately, that determines the bitness of your AddIn.
I have a template that I've used for a dozen customers. It uses InstallShield Limited Edition and it's Preq Bootstrapper to lay down all the dependencies and consumes a merge module authored is WiX and IsWiX (CodePlex). Otherwise ISLE is just a container for the UI and it's one feature.
The merge module takes care of all the dependency detection, gating logic, laying down files, installing certificates, setting registry values and so on.
Some more details can be found at:
VSTO 4 ( 2010 ) Lessons Learned
Office 2010 Bitness Pain
Apparently the small print referenced here should have been one clue: Does InstallShield Limited Edition Support 64 bit Installer?
The current Office prerequisite in Installshield is also misleadingly worded. It should really be "Office 2010 Home & Professional 32 bit".
Perhaps they intend to upgrade it over time to be comprehensive or perhaps everyone has to go through the same hassle to fix it for a few cases they care about. The support guy claimed there are too many GUIDS for all the combinations of versions, bitness, releases etc.
Home & Student, Home & Professional, Professional, Office 2010 Professional Plus License
32bit, 64bit, Languages mangled in there, Service Packs, etc. Depending on the set you care about the number of GUIDS is rather large.

Building on Windows XP, when development is on VS2012?

We're planning moving from Visual Studio 2005 to Visual Studio 2012 (Visual-C++-11).
(We would very much like to skip 2010 if we can help it, since the newer version is already there and offers a better C++ experience.)
But we've hit a little roadblock:
Our build servers still run Windows 2003r2 (all inside dedicated virtual machines), and due to messy tool support/issues, we're in no position to upgrade the build servers to a newer OS.
Developers mostly have switched to Windows7 by now, so moving the remaining Windows XP developer boxes shouldn't pose a problem.
Since VS2012 only runs on Win7 we are wondering whether we can leverage it's tools (C++ compiler, C#) and still do a full equivalent build on the W2k3 build server - after all, we don't really need a VS GUI there, just build C++ and C# projects from VS2012.
What are our options?
Will the SDK (7.1? 8?) compilers + msbuild command line get me anywhere?
In Project Property Pages, there an option "Platform Toolset" that allow you to choose compatibility of your project. So, you can work in VS2012, but built it with "VS2008 compiler"
Here is what we do:
Use CMake
CMake allows you to create build systems for your operating system. Thus we are able to use the same code within VS2005, VS2010 and Eclipse, XCode etc.
You could do something similar: Install VS2005 on your old machines and let CMake create the projects for you from the sources. On your newer machines you can use CMake to generate VS2012 Solutions (I don't know if they have 2012 support yet, because we don't use 2012 yet too).
A big pro here is: If you plan to migrate to any other IDE or even Linux you just can re-run CMake and get your source code within these environment easily compilable.
A big con: You have to start reading about CMake and create CMakeLists.txt for all your projects (might be a lot of work depending on the amount of projects, amount of source code files within each project, specific compiler options, linker options etc.)
Our build servers still run Windows 2003r2 (all inside dedicated
virtual machines), and due to messy tool support/issues, we're in no
position to upgrade the build servers to a newer OS.
Well. Not much came out of this question. We recently re-evaluated this issue, and I see two options (I haven't tried any yet):
Just do a full VS installation on a supported OS (Win7), zip up the whole VS+WinSDK directories (as well as the neccesary runtme DLLs that live somewhere under %WINDR%), and try if you can get that thing working on an XP based OS. Might work. Not a great idea if you ask me.
Split up the build process to distribute the build across several OS, so that we can work with tools that are only supported on one of them. -- This actually sounds more complicated than it'll be. We already run our build spread over several Jenkins jobs, so I should be able to get that to work. (And all build nodes are already VMs anyway, so adding more VMs isn't that much of an issue.)

How to link against msvcrt.dll instead of msvcr100.dll in VC++ 10.0?

Is it possible to link against VC6's MSVCRT.DLL in VC++10.0?
By default it seems to be linking with MSVCR100.DLL, but I don't want to redistribute yet another DLL (MSVCRT.DLL is already available in every OS that I support).
==EDIT==
To clarify: my application is a pure C application that makes WinAPI calls. I do understand that doing C++ will require the C++ runtime, which is not bundled in Windows by default (and most probably has to match the compiler anyway). My question is about pure C usage, and only the CRT functions that exist in the earliest version of Windows that I'm targeting.
(you can find an executive summary, or TL;DR, at the bottom)
Important: This answer refers to official Microsoft toolchains only, not to something like the MinGW toolchain (GCC-based) which is also known to link against msvcrt.dll. But I doubt Microsoft would be inclined to support that toolchain anyway ;)
Short answer: no!
Don't even try using Visual C++ 2010 for the task.
There's an official and supported method: use a standalone WDK, if you need your application to link against msvcrt.dll!
You should never attempt to use a compiler toolchain that doesn't match the CRT headers and libs. Use the toolchains as Microsoft intended, not a patchwork you create. Don't mix and match. Use what's handed to you by Microsoft. But use that (and don't be afraid by the FUD).
The newest WDK which you can use to link against msvcrt.dll (7600.16385.1) uses cl.exe version 15.00.30729.207. This corresponds roughly to the compiler that comes with Visual C++ 2008! Later WDKs will link against the CRT of the Visual C++ version they require.
The msvcrt.dll you'll find on, say Windows XP or Windows 7 is not the original DLL which was included with Visual C++ 6.0 (even the most updated version of VC6).
This has also been correctly stated in other answers. No surprises there.
However, the msvcrt.dll which you will find on modern systems will, contrary to what other answers suggest, allow programs that linked against the original VC6 CRT to continue to work. Even today. It's a contract. And the promotion of msvcrt.dll to a system DLL further validated that contract.
A little historical background
The toolchains used by Microsoft internally were somewhat similar to what the WDKs prior to the Windows 8 WDK provided. I will exclusively write about these and use the term WDK (or standalone WDK) uniformly, even when prior to the Vista WDK they were called DDK.
The good folks from OSR, who seem to have access to the Windows source code or people who do, confirmed during one seminar I attended some years back that the WDK used to be a trimmed down version of the toolchain used internally to build Windows around the time (~2005). Similar hints can be found from MSFT's own Larry Osterman and early works of Alex Ionescu on tinykrnl, the co-author of recent editions of "Windows Internals". BCZ likely alludes to build -cZ, a commonly used invocation with the WDKs I am describing here.
The reason it is interesting in this context is: all standalone WDKs allow you to create executables that link against msvcrt.dll by default. For the standalone WDKs msvcrt.dll is the CRT, just like for Visual C++ 2010 that's msvcr100.dll.
One should also note that the toolchains were updated alongside the Visual Studio toolchains. For example in the 3790.1830 WDK cl.exe reports as roughly on par with Visual C++ 2003:
C:\WINDDK\3790.1830\bin\x86>cl /version
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.4035 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
And for the 6001.18002 WDK (latest to support Windows 2000!) as roughly on par with Visual C++ 2005:
C:\WINDDK\6001.18002\bin\x86\x86>cl/version
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.278 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
For the 7600.16385.1 WDK it's on par with Visual C++ 2008.
Standalone WDKs
The WDK versions starting with the one for XP and up until (and including) Windows 7 SP1 did not require Visual Studio. They came with their own toolchain.
Versions prior to Windows XP required Visual C++ to build anything. If I remember correctly VC6 for the Windows 2000 DDK.
Versions starting from the Windows 8 WDK require Visual C++ again and integrate more tightly than ever with it (including wizards and even extensions for debugging and some driver-specific tasks). That's also the reason why when you use the respective WDKs, they will link to the CRT of the respective toolchain.
During the time of the standalone WDKs it was not unheard of - and that's the very reason for DDKWizard and VisualDDK - that people tried using Visual Studio to wrap the WDK build process. Some even used the unsupported method that Microsoft recommended against and built their drivers with the Visual Studio toolchains. Those unsupported methods amount roughly to what you are trying. So don't.
Anyway, the build process using WDK's build.exe with sources and makefile and so on was cumbersome and limiting. For example to build from any source file outside the current directory or its parent directory, you'd have to write your own NMake rules. After all build.exe was a wrapper around an NMake-based build. Your local makefile.inc would get included by the global one provided by the WDK/DDK.
Why linking to msvcrt.dll is officially supported
As mentioned earlier, linking against msvcrt.dll is supported with the standalone WDKs.
This is perfectly fine to do as well. In fact the USE_MSVCRT=1 statement in the sources file has exactly that effect. See here. Quoting from the 7600.16385.1 WDK documentation:
USE_MSVCRT
Use the USE_MSVCRT macro to instruct the Build utility to use the
multithreaded runtime libraries in a DLL for your build.
Syntax
USE_MSVCRT = 1
[...]
Note You should never list Msvcrt.lib or Msvcrtd.lib in TARGETLIBS. However, you can list Ntdll.lib in TARGETLIBS.
Why would Microsoft even offer this path if it were not supported by them? Correct, they wouldn't!
As a matter of fact said WDKs (XP..7 SP1) have been using the system DLL msvcrt.dll as their CRT.
Caveats
There's mainly one caveat. The way SEH is implemented has changed over time with newer Visual C++ versions. Since the toolchains from the standalone WDK correspond closely to specific Visual C++ version, they inherit the respective SEH handling.
For example when you use the Windows 7 SP1 WDK to target Windows 7 and with USE_MSVCRT=1, it statically imports _except_handler4_common. That function was not available on Windows Server 2003, for example. So trying to run such an application on versions of Windows prior to the targeted version may fail. So in such a case you are venturing into "unsupported territory" and all disclaimers apply. However, you have the option of using the method outlined here, i.e. linking to msvcrt_win2000.obj, msvcrt_winxp.obj and msvcrt_win2003.obj (available in the Vista and 7 WDKs) to achieve the level of (binary) backward compatibility you desire.
Well, on the other hand, if you decide to set WINVER=0x0601 you should also not be surprised to find that the resulting executable imports functions from kernel32.dll (or other system DLLs) which are not available on, say, Windows XP. So why expect different semantics with regard to msvcrt.dll?
As another side-note: even checked builds (commonly considered to correspond to debug builds) also link against msvcrt.dll, not its debug version counterpart! Because "checked" refers to the fact that assertions are left in; it does not refer to particular configurations of the CRT, such as "release" or "debug". The assumption that the unavailability of a debug build for msvcrt.dll in the standalone WDKs means it's somehow not the C runtime of those WDKs is plain and simple a misunderstanding of what checked build means.
There is another minor caveat. If you use, say, the Windows 7 WDK, to achieve linking against msvcrt.dll, you're using a toolchain unaware of developments since Windows 7. This includes import libraries, but also headers. So don't expect it to support features that were unavailable at the time it was released.
System DLL: msvcrt.dll
msvcrt.dll was promoted to the status of a system DLL some years ago, which means it comes included with the system (and can be relied on, literally) unlike other Visual C++ CRTs, for which you need to install the respective redistributable packages. Which is also the gist of the blog post by Raymond Chen quoted in another answer.
Since the standalone WDKs (XP..7 SP1) default to linking to msvcrt.dll as their CRT, there's no objective argument against it. Of course opinions vary.
A "reply"
Unfortunately this answer which has changed a lot since I first commented on it, perpetuates FUD and tries to pull quotes from purportedly authoritative sources out of context. It also links to original (MSFT) sources which - upon close inspection - do not support the statements for whose support they were linked.
Microsoft's Raymond Chen blogged on this a few years ago. From his
blog Windows is not a Microsoft Visual C/C++ Run-Time delivery
channel:
one DLL compatible with all versions of Visual C++ was a maintenance nightmare ... At some point, the decision was made to just give up and
declare it an operating system DLL, to be used only by operating
system components.
Emphasis mine. Think again, are you really writing something that
ships with Windows? Is it THAT difficult to add a supported file to
your setup program or link the static version of CRT, instead of
depending on a system component that Microsoft gave up on compiler
compatibility more than a decade ago?
Okay, so February 2010 is more than a decade ago (time this answer was written: March 2016)? Because that's the release date of the 7600.16385.1 WDK, which officially supports linking against msvcrt.dll.
And the rest of Raymond's statements may match what Microsoft initially intended, but he even admits that they gave up on that and promoted it to a system DLL.
Also, it's quite dishonest to mix truly ancient history (Windows 9x) with recommendations in favor of using standalone WDKs, which don't even support Windows 9x. The historical background Raymond describes is pre-W2K and non-NT. The background I describe above refers to the NT lineage of Windows and I only know the standalone DDKs/WDKs (and newer) from practice, so I cannot tell how it was or was supposed to be prior to that.
All that said: his blog is not to be confused with official documentation from Microsoft, although a lot of gems can be found on his blog and I've been an avid reader for years.
And although that is more than a decade ago, the msvcrt.dll version information in Windows 2000 (SP4) says:
Description: Microsoft (R) C Runtime Library
Product: Microsoft (R) Visual C++
Prod version: 6.10.9844.0
File version: 6.10.9844.0
... contrary to Raymond's introductory statement.
Only with Windows XP did that change to:
Description: Windows NT CRT DLL
Product: Microsoft« Windows« Operating System
It is amazing how many people are still in denial of this decision.
It's fair to assume after some previous comments that this is squarely aimed at me.
Well, I am not in denial of decisions made with the release of the Windows 8 WDK. But that doesn't "unrelease" the standalone WDKs which officially supported linking to msvcrt.dll nor does it "undocument" what can be found in their respective official documentation.
Hey, it's cool with me if you're in the luxurious position to only have to support Windows 7 or 8 and newer, or something along those lines. However, I have to support earlier Windows versions as well and so I'll make full use of the official tools provided by Microsoft for these Windows versions. Be that Visual C++ 2005 with the appropriate SDK integrated or be that a standalone WDK.
Those people caused "a lot of grief for the Visual C++ product team"
This statement refers to the aforementioned blog post by Raymond Chen, but pulls Raymond's statements out of context, specifically out of temporal context. The grief was caused by people trying approximately what the asker wants to do - and worse: reaching into the guts/internals of msvcrt.dll. And that was pre-W2K. It was not (and would not be) caused by using an official toolchain like the standalone WDKs from Microsoft.
The msvcrt version in modern versions of Windows has never been mentioned in the corresponding versions of Windows SDK.
While modern should be qualified, the use of "Windows SDK" suggests that it refers to all Windows SDKs after they were renamed from "Platform SDK". And I am inclined to readily believe that. But the poster is ignoring the standalone Windows WDKs (and prior to that DDKs) which not only mention it, but also use msvcrt.dll as their CRT. They are official toolchains from Microsoft aimed at both kernel and user mode development.
Microsoft update the CRT DLL (for example, when releasing a Windows Media Player patch) using a current toolchain that may or may not be made public.
That's correct. msvcrt.dll keeps getting updated because it has been promoted to a system DLL. And that is the contract one can rely on when using the WDKs. They're not going to break applications built with their own toolchains, just because they're patching msvcrt.dll.
You can count on them are not using the ancient WDK compiler and libs to build the msvcrt DLL in Windows
I'd not even be sure of that, but an official toolchain from 2010 isn't exactly something I'd call ancient. Besides, since Microsoft dropped support for XP and 2003 meanwhile, they only need to support Vista and onwards. That's bound to be easier with the latest Visual C++ version which directly provide the compiler and tools for the WDKs starting with the Windows 8 one.
(why ancient? Because the WDK team does not like people use their compiler to link against msvcrt either, and removed the loophole in version 8.0 to stop those "clever" people).
Oh really, does Doron actually say that at the linked forum post? Well, no:
the win7 wdk build deployed successfully because you linked against
the windows CRT (msvcrt.dll). we don't want 3rd parties doing that
anymore, so we removed that capability in the win8 wdk. it still
works for backwards compat. while it may deploy successfully, there
may be whck logo checks that make sure you use the right CRT
(emphasis mine)
The statement is about a "political decision" (and an official one at that) by Microsoft to change their stance. The "anymore" in fact implies that this only changed with the Windows 8 WDK. The first modern WDK that integrates with Visual C++ again (since the Windows 2000 DDK). So since the WDK has been demoted from a standalone toolchain to an extension that integrates with a given Visual C++ version, the new requirements are no surprise at all.
It is, btw, also dishonest to argue based on the Windows 8 WDK and newer, when the suggestions regarding standalone WDKs, which use msvcrt.dll as their CRT, were prior to that policy change. It's also dishonest to mix the history that led to the promotion of msvcrt.dll to a system DLL with the era after it had been promoted.
Glossary
CRT == C/C++ runtime
3790.1830 == Windows Server 2003 Service Pack 1 (SP1)
Driver Development Kit (DDK)
6001.18002 == Windows Driver Kit SP1 for Windows Server 2008/Vista
7600.16385.1 == Windows Driver Kit version 7.1.0 (Supporting Windows 7, Windows Vista, Windows XP, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003)
TL;DR
Contrary to this answer it is perfectly fine to use Microsoft's own and unchanged toolchains, such as the standalone WDKs, which support linking against msvcrt.dll (XP..7 SP1) "natively". It's even documented in the documentation that comes with those toolchains (unless you decide to not install it or close your eyes :)).
You "only" have to make sure to target the correct Windows version when building (essentially the same as defining the correct WINVER). But the same can be said for other system DLLs (e.g. kernel32.dll, user32.dll ...).
However, using any Visual C++ since 2002 to link against msvcrt.dll is bound to create trouble. Don't mix and match. Simply use the CRT matching those particular Visual C++ versions.
It's not the VC6 runtime. It's a system copy of MSVCRT.DLL that's bundled with Windows rather than Visual Studio. Each new version of Windows gets a new version of MSVCRT.DLL, as you can see by checking the file sizes.
You can compile against the system copy of MSVCRT.DLL by using the Windows Driver Kit. Note that this DLL is for use "only by system-level components." What's a system-level component? Well, a driver. Or, for example, a text service:
http://blogs.msdn.com/b/tsfaware/archive/2008/01/17/visual-studio-2008-issues.aspx
If you're building a text service DLL ... I would recommend installing
the Vista (or XP) DDK and use the DDKWizard instead. The DDK comes
with its own C/C++ compiler that uses the C Runtime Library that ships
with the OS (and won't cause problems with other applications) ...
More information:
http://kobyk.wordpress.com/2007/07/20/dynamically-linking-with-msvcrtdll-using-visual-c-2005/
A question arises, what does Microsoft do? They deploy their
applications to a variety of Windows environments. A look at Windbg’s
dependencies showed it’s using MSVCRT.DLL rather than one of the newer
CRTs. Microsoft’s new Network Monitor 3.1 also uses MSVCRT.DLL.
Windows Desktop Search is also using the old, trusty CRT.
How can all these new applications be using the vintage CRT? They’re
not still using the antique, unsupported Visual C++ 6.0, are they?
Well, no. The answer is more complicated and can be found in the
Windows Driver Kit (WDK).
Update: The Windows 8 Driver Kit introduced a new MSBuild-based build system, which no longer links against the system copy of MSVCRT.DLL. However, binaries built with the Windows 7 Driver Kit still work on Windows 8 and Windows 10.
MSVCRT.DLL is still shipped with Windows 10 for backward compatibility, so it carries a File version of 7.0.#####. A component that is still being actively developed, such as user32.dll, carries a File version of 10.0.#####.
An average "Petzold-style" Win32 program only needs a few functions out of msvcrt.dll. In my case, I often need the float-point formatting routines, like _sntprintf(). And it's unlikely that the functionality of such functions ever changes. For this reason, I created an msvcrt-light.lib import library (download) as a replacement for the standard library which I include in the MSVC project.
For full-fledged C++ programs, msvcrt-light.lib may not be suitable at all. Use the DDK as stated above.
This requires CRT compatibility across major compiler releases, which Microsoft tried to accommodate (e.g. added a VC5 heap to the VC6SP2 runtime) but eventually gave up on and introduced msvcrxx.dll that are in use today. If you look at the CRT source, you will find lots of #ifndef _SYSCRT, that's the difference between Microsoft's msvcrt.dll and the one used by your compiler when generating code.
Microsoft's Raymond Chen blogged on this a few years ago.
From his blog Windows is not a Microsoft Visual C/C++ Run-Time delivery channel:
one DLL compatible with all versions of Visual C++ was a maintenance nightmare
...
At some point, the decision was made to just give up and declare it an
operating system DLL, to be used only by operating system components.
Emphasis mine. Think again is it THAT difficult to add a supported file to your setup program or link the static version of CRT, instead of depending on a system component that Microsoft gave up on compiler compatibility more than a decade ago?
It is amazing how many people are still in denial of this decision. Those people caused "a lot of grief for the Visual C++ product team", and if you keep pissing them off, I won't be surprised if they piss you off sometimes like what they did in Windows XP that crashed a lot of VC6 apps. A lot of people did not follow Windows 2000 application developer guidelines and put settings/game saves in the Program Files folder. We all know what a good ending it is when Windows Vista was released.
By the way the dll is not VC6's. Using an old dll in the system would fail the Microsoft’s Security Development Lifecycle automatically. (https://blogs.msdn.microsoft.com/oldnewthing/20100607-00/?p=13793/#10020962). You don't realistically expect Microsoft use VC6 to compile its modern product, do you?
The msvcrt version in modern versions of Windows has never been mentioned in the corresponding versions of Windows SDK. Whatever compiler version or CRT lib version you use, it most likely won't match the majority of DLL versions on your customer's machine. Microsoft update the CRT DLL (for example, when releasing a Windows Media Player patch) using a current toolchain that may or may not be made public. You can count on them are not using the ancient WDK compiler and libs to build the msvcrt DLL in Windows (why ancient? Because the WDK team does not like people use their compiler to link against msvcrt either, and removed the loophole in version 8.0 to stop those "clever" people).

Develop Windows applications with Linux tools

I like the Linux operating system and vim editor, but there are many companies that develop under Windows environment in Visual studio etc. There is a possibility that I will have to work for such a company in about a month.
I'd like to do my work on my Linux system and copy the files to them. I have experience with both developments and I found out that I don't want to work with MS products but I like programming and writing MS code is not such a pain.
Are you a similar developer? Could you give me some advice about your methodology to be most of the time on Linux platform, to create code and debug everything in vim on Linux and only when neccessary open Visual Studio with Windows forms and similar things and test the things that weren't possible to test in Linux environment?
I would see the work in creating small peaces of code on Linux, testing them and then move it to MS platform and integrate to the whole system. How do you debug and test your code? The development will be probably in C# or C++. I can't imagine Visual Basic.
Please write here your experience, style of work, if this has sence or there are too many troubles and I should rather give up.
So the question is: How to develop applications that run on Windows with Linux tools, without touching Visual Studio and browsing with Windows file manager etc.
thank you
Not sure, if this will help you or not but there is a Vim Emulation layer for Visual Studio 2010 called VsVim.
Check out : http://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329
If I were you I'd install MinGW or Cygwin on your windows machine and just use gvim/vim anyway (or maybe just use the Win32 vim).
VS is just a big editor. You'll be building with the microsoft compilers ( perhaps using msbuild or nmake ) but probably are going to have to accept that you can only debug windows things with VS ( unless you build for MinGW or Cygwin and use gcc and gdb)
You can use vim as a code editor, you can even stick on Linux when developing software for the .NET platform. The people behind the Mono make this happen. Mono is a software platform designed to allow developers to easily create cross platform applications. It is an open source implementation of Microsoft's .Net Framework based on the ECMA standards for C# and the Common Language Runtime.
You can stick to the editor of your liking and use the tools that come with Mono to compile your stuff. There is a IDE called Mono Develop, but compared to Visual Studio it is pretty basic... and compared to VIM it lacks simplicity.
C# projects are plain text files so it's easy enough to edit them over an SMB share in whatever editor you wish from anywhere the sysadmins let you.
Testing however will be difficult without going back to the windows machine, and while Mono implements the framework, it's still a different environment if you're targeting Windows.

Resources