WiX 3.0 with Visual Studio 2010 -- no user interface libs? - visual-studio-2010

I've used Wix before to build installers, and it's great!
I recently re-imaged my machine, and only installed Visual Studio 2010, because I've updated all my projects to that version.
When I download and install WiX 3.0, it complains that Votive will not be installed because I don't have visual studio 2005 or 2008 "or later" installed. That's OK, I don't use Votive anyway (and I don't quite understand what VS 2008 has to do with that, but whatever...)
When I try to link my Wix installer using light.exe, I get a link error, because it can't find the UI wixlibs. Searching various locations on my drive (common files, Wix install dir, etc), I cannot find any wixlib files.
Is the problem that I need to find a separate download for the WiX UI libraries? If so, where? I can't find any promising links on the Wix web site.
Or is the problem that the UI libraries are somehow linked to the Votive installation? If so, how can I install them on a system that only has Visual Studio 2010?

The answer turns out to be that UI has moved away from wixlib files and into the WixUIExtension.dll extension.
Thus, when calling light to link, I can pass -ext WixUIExtension, and all is good.
This solves my problem with "Unresolved reference to symbol 'WixUI:WixUI_Minimal' in section Product"
The exact steps are:
Project Properties -> Tool Settings -> Linker -> add "-ext WixUIExtension"

Alternatively, if you created a WiX Setup Project, right-click on it and add a reference to WixUIExtension.dll, which is found in C:\Program Files (x86)\WiX Toolset [version]\bin\.

Related

How do I use Qt in my Visual Studio 2015 projects?

We have large project that used .NET Framework for showing forms/windows. Recently I decided to deprecate CLR dependency and move to Qt.
While learning Qt, we've migrated from Visual studio 2013 to 2015 and then I noticed that there is no qt support for MSVC 14 version which vs2015 use.
Additionally, Qt vs addin was not working jn visual studio express/community edition we use. Is there any chance for me to use Qt and qt addin in our projects?
Searching web did not help, and it looks like no one use Qt with latest Visual Studio?
Building
You can use Qt in Visual Studio 2015 without any problems. As already stated in the comments, you have to build it from source but Qt is pretty straightforward to build. You can download the current (5.5) sources here and then follow this step by step example on building it.
I would also suggest reading more about the configure options, this might save you a lot of time. It might possibly save you some external dependencies as well if you skip components you do not need. My configuration for instance contains -skip qtwebkit -skip qtwebchannel so I do not need ruby or python.
I could totally omit step 3 from the link. Just be sure to open the Visual Studio Command Prompt (32/64 is important here) for configure and nmake.
Usage
For Visual Studio 2015, the Qt Add-In is not available anymore. But there is an Extension (Tools > Extensions & Updates) called Qt5Package or QtPackage which has the same functionality. After installing it, you have the Qt entry on your main toolbar where you have to specify a version and the path to the directory where you built it. This version will also be associated with the current project via the same menu.
If you load an existing project, you also have to convert it so the whole Qt functionality is used automatically. You can do this by opening the solution and right click on it; there should be an entry for the conversion to a QtAddin generated project.
I am using Qt 5.5 on Visual Studio 2015 with an old project and it is working without any issues.
As of now, you can just download Qt for Visual Studio 2015. Here.
Qt have finally added support for Visual Studio 2013 and 2015 although it's only in beta right now. See QTVSADDINBUG-404 for progress and read the blog post From Visual Studio Add-In To Qt VS Tools (Beta).
The Qt Windows could be added to the current project by copying all relating necessary files from the Qt stand-alone project to the current project. Specifically, the following steps must be conducted carefully.
Create an example project of Qt inside a Visual C++ project by using a Qt Plugin Program. The windows must be designed inside this project carefully before adding to the existing project.
Inside the existing project, add carefully the file heloqt.cpp, helloqt.h, ui_helloqt.h, qrc_helloqt.cpp, moc_helloqt.cpp in case of the Qt Project having the name of helloqt.
Add some configurations of Additional include directories and Additional library directories and Additional Dependencies into the existing project.
Compile and add some required *.dll files for running the program.
I have to do that because I want to use a graphic user interface in my big project, and this project is too big to be added into the Qt project inside the Visual C++ Studio.

What does "Wrap the file in another setup package through Visual Studio or other Windows Installer aware setup editor" mean?

I am working in Visual Studio 2012 and I was missing the "Microsoft.Office.Interop.Excel" assembly. After downloading the missing exe from http://www.microsoft.com/en-us/download/details.aspx?id=3508,
the instructions are as follows:
"Wrap the O2010pia.msi file in another setup package through Visual Studio or other Windows Installer aware setup editor"
I ran the exe, but the missing assembly is still missing from Visual Studio.
I am quite new to development and after googling for a while, I am no closer to understanding what this means. I would greatly appreciate some insight.
You did not read it correctly. The page says "Use one of the following installation methods". The one you are asking about is what you do when you create an installer for your program so the PIA also gets installed on your client's machine. You are not there yet.
You should not be doing this anymore, PIAs are outdated since VS2010. Replaced by the "Embed interop types" feature, aka "NoPIA". Project, Add Reference, click COM, select the "Microsoft Excel xx.x Object Library" entry where xx.x is the version number of Office you've got installed on your machine. This automatically adds the Microsoft.Office.Core and Microsoft.Office.Interop.Excel references to your project. With their Embed Interop Types property set to True so you don't have to install anything on the client's machine.
If you don't see this entry then you will need to install Office on your machine. Required to add the reference and to debug and test your code.

Include c++ as pre-req, but says "A new version already exists"

I'm using the Visual Studio Setup project. If I go to the properties of the Setup project, it lets me choose which pre-reqs are required, at which point I choose the C++ Redistributable.
On some systems, this works fine - but recently my users are reporting that the install failed because "A newer version of Microsoft Visual C++ 2010 Redistributable has been detected on the machine."
What's the proper way to do this? Is Visual Studio's detection fouled up somehow and unable to detect C++?
Yuck, this is ugly. I was wondering what would happen after Microsoft gave up on the side-by-side install of the runtime DLLs for VS2010. Seems clear, the interwebs are full of this installer error. The biggest victim seems to be Microsoft itself with Streets and Maps failing to install.
I'm not aware of any security patches for it so I have to guess that you haven't updated to SP1 yet. And your customers use a product of a vendor that did. This is a battle that you're always going to lose some day. Do consider taking advantage of the app-local deployment for the DLLs, copying them in the same directory as your main EXE. Simply copy them from the vc/redist directory before putting the setup package together, no need to tick the prerequisite. You'll need:
msvcr100.dll and msvcp100.dll for the regular CRT
atl100.dll if you use ATL
mfc100.dll, mfc100u.dll, mfcm100.dll, mfc100u.dll if you use MFC (u = Unicode, m = managed)
mfc100xxx.dll where xxx is the 3 letter language code if you use MFC on a non-English machine
vcomp100.dll if you use OpenMP in your code.
Only disadvantage is that they won't get updated if there's a security patch. That could be an advantage too, depending on what color glasses you wear. If you're uncomfortable about it then keeping the machine that creates the setup package updated, including enabling Windows Update, is an important requirement.
The default Visual C++ 2010 Redistributable uses a Product Code for detection. So Visual C++ 2010 SP1 Redistributable is not detected as installed. This is why the package tries to install it and fails.
A good solution is to create your own custom prerequisite which uses a better detection criteria. Here is an article which may help you:
http://blogs.msdn.com/b/astebner/archive/2010/05/05/10008146.aspx
Visual Studio setup projects do not support custom prerequisite creation. However, it can be done by manually generating the required manifests.
You can find the manifests structure here: http://msdn.microsoft.com/en-us/library/ms229223(VS.80).aspx
These manifests can be generated automatically with the Bootstrapper Manifest Generator tool.
After generating the package manifests, you can add all these files (including the package) in a separate folder in the Visual Studio prerequisites folder, for example:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\
This way Visual Studio will show the prerequisite in your setup project properties page.

Visual C++ 2010 Runtime Libraries prerequisite keeps popping up on a VS 2010 created installer

I created an installer with Visual Studio 2010 Version 10.0.40.219.1 SP1 Rel. My application is built/compiled for x86 and requires VC++ runtime libraries. Thus, the setup project is configured with VC++ runtime libraries as a prerequisite.
Every time I run the installer I get the popup "The following components will be installed on your machine." "Visual C++ 2010 Runtime Libraries (x86)". The first time it gets installed asa expected. The second and subsequent times it asks me whether to repair or remove VC++ 2010.
This popup should only be displayed once, the first time it is discovered that VC++ redistributable is not installed.
Has anyone seen this? Anyone know how I can fix this?
Solution:
The answer I accepted gave me what I needed to resolve the issue. Here are the details on what I did to fix this, which was very simple in fact. I edited the file:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\vcredist_x86\product.xml
In this file you will find the following:
<InstallChecks>
<MsiProductCheck Property="VCRedistInstalled" Product="{6EE91C1A-A2E7-38CD-AEBB-3B900A4D8868}"/>
</InstallChecks>
The above contains the incorrect product code. Replace the above with the correct product code for the Visual C++ 2010 SP1 redistributable as follows:
<InstallChecks>
<MsiProductCheck Property="VCRedistInstalled" Product="{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}"/>
</InstallChecks>
The link here shows the correct product codes for the various VC++ 2010 Redistributables.
This happens because the prerequisite detection criteria is incorrect.
A solution is to create your own custom prerequisite with a correct criteria. Perhaps this article will help:
http://blogs.msdn.com/b/astebner/archive/2010/05/05/10008146.aspx
Visual Studio setup projects do not support this. But it can be done by manually generating the required manifests.
You can find the manifests structure here: http://msdn.microsoft.com/en-us/library/ms229223(VS.80).aspx
These manifests can be generated automatically with the Bootstrapper Manifest Generator tool.
After generating the package manifests, you can add all these files (including the package) in a separate folder in the Visual Studio prerequisites folder, for example:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\
You can then select the prerequisite in your setup project properties page.

Visual studio redistributable & side-by-side / DependentAssembly error

(I'm running Windows7 and using Visual Studio 2010.)
I'm using ClamAV in a .NET Azure project, and I'm running into side-by-side errors whenever I run clamd.exe, either through my code or by running clamd.exe on it's own.
In Visual Studio 2010 I am getting the error:
Win32Exception was unhandled The application has failed to start
because its side-by-side configuration is incorrect. Please see the
application event log or use the command-line sxstrace.exe tool for
more detail
And in Event Viewer I get:
Activation context generation failed for
"C:\Users\pconerly\code\AntiVirus_source\WorkerRole\clamav\clamd.exe".
Dependent Assembly
Microsoft.VC80.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.6195"
could not be found. Please use sxstrace.exe for detailed diagnosis.
When I searched for "8.0.50727.6195" it led me to the 2005 redist, so I downloaded it
http://www.microsoft.com/download/en/details.aspx?id=3387
After a restart I am still getting the side-by-side error. Additionally, I think that the redist installer is not completing it's install-- like it's seeing visual studio 2010 and saying "oh, that's good enough, no need for me to install". I haven't tried uninstalling 2010 and using 2005, because the rest of my Dev team is using VS 2010.
What's the deal? How can this be fixed? I'm ready to pull out my hair.
The link Timores posted is the update for Visual Studio. The actual redistributable package is this:
http://www.microsoft.com/en-us/download/details.aspx?id=26347
The version you mention is actually at found here
Microsoft Visual Studio 2005 Service Pack 1 MFC Security Update
Timores is right: the redist should be this one, which is related to this KB entry
As you can see there, msvcr80.dll has been updated to version 8.0.50727.6195.
It is the "security update" of the "SP1" of the 2005 C++ runtime..
Your exe probably requires (through an internal manifest) that specific version.
If it is not found on the system (there's a lot of places searched for) nor in the current folder (with a suitable manifest aside) it won't load the exe since it is not able to "activate the context", that is load the specific DLL required in the manifest.
I had similar issues when my system got updated (windows updates) and the newly compiled EXEs were not working with an old-versioned runtime placed on the same folder.
I had to update msvcr80.dll and its manifest (which I found deep in \windows\winsxs) to make everything work.
Context activation is a tricky matter, anyway :)
HTH

Resources