VC++ custom action for Wix - visual-studio-2010

We are using CustomActions written in VC++ in our WIX msis. it is working fine in Windows7 machine. But when we tried to run the msi in Win 10 it is not working and failing because Microsoft Visual C++ 2010 Redistributable Package is not installed by default in Win 10 machine. So for making the MSI to work we should install Microsoft Visual C++ 2010 Redistributable Package. But the problem is that we can't install it along with the MSi because the custom actions are responsible for choosing the INSTALLDIR and this will happen before installing anything.So my question is
1.)Do we really need Visual C++ 2010 Redistributable for running VC++ custom actions.?
2.)How can i install it before choosing the INSTALLDIR?

Simply compile your DLL with static libraries. In this case your DLL has no additional dependencies.
In the project settings set General->Use of MFC to Use MFC in a static library.
Under C/C++ -> Code Generation choose the options Multithreaded or Multithreaded Debug /MT or /MTd.
You can use the Dependency Walker to check out if you need more DLLs that must be installed.

You should statically link CRT libraries into your custom actions dll instead.

Related

Visual C++ redistributable doesn't install libraries needed

So I have made an application with Visual C++ and SFML. I used Visual Studio 2015 as the IDE.
Now when I try to run the applications on computers without VS2015 Visual C++ installed, I get the errors that some libraries are missing.
Then I try to install the Visual C++ redistributable 2015 packet which should remove these missing libraries errors.
After that when I try to run the Application again the same errors append.
These are the libraries missing:
vcruntime140d.dll
ucrtbased.dll
mavcp140d.dll
Any help is appreciated!
These are the Debug versions of the C/C++ Runtime. They are not deployed by the VCREDIST as you are expected to ship the Release build of your application.
For testing, you can use side-by-side deployment of the Debug CRT or use the provided Debug MSM modules if you have an MSI based setup. You can't ship your application using Debug.
See MSDN

How to configure Glib on Microsoft Visual Studio 2010?

i'm trying to port to Windows a C project wrote to work on Linux. It's a simple project that depends CUDA and Glib librarys.
I believe the best way is to compile with Microsoft Visual Studio 2010, but i don't have idea how to link Glib to this project. CUDA code is going well, but every call to Glib methods generate a "unresolved external symbol" error.
i just solved my problem using this guide to configure GTK on Visual Studio 2008:
http://www.etechplanet.com/blog/visual-studio-2008-configuration-for-gtk2b-gui-development.aspx
The only change i done was about the Tools/Options/VC++ Directories because this was deprecated on VS2010. I added the paths directly to the project properties.

"program can't start because msvcp100.dll is missing" for Every single code

This error is taking toll of my training schedule.
Everytime I create any C++ application in my VS2010, It runs fine on my machine but if I run it on different machine, It starts with this error.
Error goes if I copy msvcp100.dll in System Folder then it shouts for some other DLL. It requires some 5-6 different DLLs.
Most irritating part is even if I write a simple Console based Addition program, It gives this error.
(I should not but)I would have agree if I design some fancy forms and all... But for simple Addition program????
Am I missing out somethings in Settings? or VS2010 to blame??
Somewhat related question: this But this problem seems different
By default, MSVC projects are set to link against the dynamic run time library which generates a dependency on the visual C++ run time redistributable. As you have already found out, this dependency is not guaranteed so your install utility has to install the visual c++ run time first.
You can avoid this by changing your project settings. Load the project properties and go to: "Configuration Properties"/"C/C++"/"Code Generation"
In the item labelled "Runtime Library", select "Multi Threaded (/MT)"
for the release version"Multi Threaded Debug (/MTd)" for the debug version.
You have to be careful while doing this that all the other libraries that your application links are also compiled against the static run time.
You need to have Visual C++ Libraries installed if you want to run your app.
Using the compiler options to change the runtime library worked for me ("Configuration Properties"/"C/C++"/"Code Generation". In the item labelled "Runtime Library", select "Multi Threaded (/MT)" for the release version and "Multi Threaded Debug (/MTd)" for the debug version). I did have to do both the debug and the release to get the release to work. Don't know why (it is possible that I did not do it correct the first time).
Note: I was using VC2010 Express version on Windows 7 to compile. I tested on an old XP machine.
Another note: MS information at http://msdn.microsoft.com/en-us/library/2kzt1wy3(v=vs.100).aspx
If you have installed a new copy of Windows on your computer or have reinstalled one then you will come across an error called "The program can’t start because MSVCP100.dll is missing from your computer. Try reinstalling the program to fix the problem." on your computer.
The basic reason behind this error is that the Visual C++ doesn’t get installed when you reinstall or install a fresh copy of Windows operating system. In order to check Visual C++ is installed on your PC or not, open Control Panel → All Programs and Features and then search for Visual C++ in the software list. If you don’t find the software installed there then you have to install it.
I would suggest, first of all, install the Visual C++ 2010 package and check if it has solved msvcp100.dll missing error or not. If the issue is not resolved by the Microsoft Visual C++ 2010 then install 2013 or 2015 versions of Microsoft Visual C++. Here is the list of download links of Microsoft Visual C++ for both x86 and x64 architectures:
Microsoft Visual C++ 2010 SP1 Redistributable Package (x64)
Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)
Visual C++ Redistributable Packages for Visual Studio 2013
Visual C++ Redistributable for Visual Studio 2015
→ The latest supported Visual C++ downloads
I hope, now you are able to fix “The program can’t start because MSVCP100.dll is missing error on your computer. To know more details, you can follow this guide.
Thanks

Are Runtime libraries included in Visual Studio 2008 Pro by default?

Can anyone tell me how to check in visual studio if it has the following libraries included?
The first question I have is are any of these included in the VS by default by installing VS 2008.
These are the libraries:
VC++ Runtime libraries
VC++ Static MT CRT libraries
VC++ Dynamic CRT libraries
ATL MFC Shared Libraries unicode
Can you please suggest me what I need to do, if they are not included in the VC++? Can you provide me with their download links please?
This doesn't look like a linker error; it looks like a compiler error. So, yes, your colleague is right: it might have something to do with #include files, in particular with an #include file that your cpp source failed to #include.
Look for and the include the file atlcom.h and see what the compiler says then.
Microsoft Visual C++ 2008 Redistributable Package (x86)
Be sure to get all updates (windows update or e.g. InstallShield update components etc).
Notably, there has been an important update to ATL Server components which I think (IIRC) is in
Microsoft Visual Studio 2008 Service Pack 1 Update (KB974479)
Update and check this one too
Visual Studio 2008 Service Pack 1 ATL Security Update

Building a library with Visual Studio that can be linked to a Qt project?

Right now I have some libraries that link easily to Visual Studio projects but I can't figure out how to link them with Qt. My idea is to write a VS project that wraps the functionality I need from the libraries, then compile that to a library which can be linked to Qt. From my understanding, VS and Qt use compilers that create incompatibile libraries. My questions are:
Can I modify VS or Qt in a way that I can compile a library in VS which can be linked to Qt?
Is there a simpler solution to this problem?
The specific library I'm using is Nitro-Nitf. For my Qt project I'm using Qt Creator and for Visual Studio I'm using VS 2008.
Yes, the Windows binaries provided by Qt are built using MinGW. If you build Qt from source using Visual Studio, then your libraries will be compatible.
Although I haven't tried it, Qt Creator 1.2 introduces support for MS compilers, so you should be able to continue to develop your Qt projects in Creator.
Qt is available as source code, you can build it with whatever toolchain you like. Visual Studio is an IDE (integrated development environment) that normally invokes the microsoft compiler (cl) and linker (ld), although you can configure a Visual Studio project file to do a makefile build, or IIRC, invoke any other program you like to do the build step (at my previous job, we built our Qt apps with cl and ld, and could debug with Visual Studio just fine, since about 2005).
Also, it appears this "NITRO" project is open source, so you can download the source instead of a pre-built binary, and build it using MinGW if you'd like to build Qt apps with MinGW, or if you are using pre-built Qt libraries that were built with MinGW.
To build Qt4.5 with visual studio
Download the source
./configure.exe -platform win32-msvc2008 or win32-msvc2010
nmake
There is even a free release of the visual studio plugin to make handling all the autogenerated code automatic in visual studio

Resources