Harvest(Heat) Wix - archive resources in the msi - c++

Is it possible to archive resources in msi file instead of creating .cab . What is the pros and cons of these two method

Embed Cabs: If you are referring to eliminating the external cab during MSI compilation for WiX visual studio projects, then you can achieve this by setting the EmbedCab attribute of the MediaTemplate element to "yes":
<MediaTemplate EmbedCab="yes" />
Here is an attempted "minimal changes" sample for how to build a basic MSI after creating a WiX project in Visual Studio. Suggest scrolling down to the actual WiX markup for the inline comments.
Why use External Cabs?: I rarely use external cabs if I can help it, but there are some advantages in some cases centering around build-speed and more reliable downloading (according to Arnson, see second link below). There may be further benefits. For example downloading a smaller cab for MSI repair operations if installation source is on a remote server - related to downloading. Cab files can make security software and anti-virus go spastic though.
How To: Optimize build speed
WiX and cabinetry
This question has been answered before BTW - in similar incarnations. See below.
Some Links:
Wix: single MSI instead of msi + cab
For the record: The embed cab behavior changed in WiX 3.8
What is the difference between Media and MediaTemplate in WIX?

Related

Create .msi installer with Qt installer framework

I've been looking into the Qt installer framework but when you create a setup using this tool it is a regular setup though I was wondering whether it would be possible to create an msi setup to be able to install a Qt program network wide.
I've looked at the installer framework docs but was unable to find anything about this so far.
Qt installer framework doesn't provide creating of MSI installer. For MSIs you should use WiX for example.
You have got a proper answer, maybe I'll add some further links for you. Before I do that I can verify that WiX can be used to make MSI installers for any type of Windows application.
There are also a few other tools available to make MSI files that you might want to look at depending on your needs - both open source (free) and commercial. Though WiX is very flexible and great when you have it set up, commercial tools can help you get an MSI created much quicker. Have a read below of the different tools and their pros and cons.
Below are a few links for you - I am a "linking monster" :-). If you pardon what looks like shameless self-promotion, it is really a guess as to what you could find useful to get your MSI file created:
What installation product to use? InstallShield, WiX, Wise, Advanced Installer, etc (various MSI tools with description of pros and cons)
Windows Installer and the creation of WiX (a little unofficial story of WiX's creation)
WiX "quick start" suggestions (getting started with WiX - not my favorite answer - it is a bit messy - but somehow it seems to be helpful for people)
How do I avoid common design flaws in my WiX / MSI deployment solution? (messy, but may be worth a skim to avoid some problems)
And a few more peripheral links thrown in:
Syntax for guids in WIX? (simplifying WiX source files)
How can I compare the content of two (or more) MSI files? (tools you can use to inspect the compiled MSI files - and some tips for comparing different versions and decompiling MSI files)
Change my component GUID in wix? (understanding the critical component GUID concept in Windows Installer / MSI)

MSI Build uninstall- Installed directory not removing

I created the MSI build package for our application. After this installation, we triggered another dependent driver software in the separate process in a committed event of Installer class like below,
Process.Start (" Path of driver software ")
We are facing an issue, installed directory ( It's empty ) folder is not removing while un-installing the same. Actually like installation, we triggered the un-installation of dependent driver software in the separate process by overriding the Uninstall method of installer class.
Anyone, please help me to overcome this issue? How could I remove the installed directory?
I can't change the installation procedure, since we are aware that we can't process another installation/un-installation when another one is going.
You are running a non-MSI driver install EXE from within your MSI? Correct? Or maybe it is an MSI wrapped in an EXE?
Do you have Installshield Premier? Could you use a suite project and install the EXE via the bootstrapper before (or after) the MSI install? I have honestly never used this feature, but running setups in sequence is what it is for. Embedded custom actions in MSI files kicking off EXE files are notoriously unreliable. This is - in my opinion - especially true if you are running with managed code as well (which I think you are).
In the long run managed code may yield safer custom action code (security-wise based on CAS), but for now it seems to cause unwanted runtime dependencies - especially for very large-scale distribution (global distribution) targeting diverse Windows versions (Vista, 7, 8, 10).
I am told it takes a while to get used to Installshield's suite feature, but maybe it is better for you? You can run EXE files, MSI files, patches and zips in sequence. Some fiddling to define uninstall and upgrade behavior I guess and lots of testing. I am pretty sure corporate application packagers would be happy to see a suite rather than an MSI with lots of strange stuff embedded in it.
UPDATE: Once you have compiled a suite setup.exe file it can be extracted as described here: Regarding silent installation using Setup.exe generated using Installshield 2013 (.issuite) project file
Alternatively you could try to extract the setup.exe files for the driver setup and install the drivers as regular MSI components and run DPinst.exe to install / uninstall the drivers (tool from DIFx). Also quite clunky - especially when you need to include uninstall.
Your driver setup likely uses DPInst.exe already. I would check if you can extract an MSI from the EXE and use it instead of the EXE to include in the suite project. Some hints for how to deal with setup.exe files (extraction, runtime paramenters etc...): Extract MSI from EXE.
WiX has the Driver element in one of its extensions to deal with driver installs. I have never had the chance to test it.

What is the best way to install VC++ redistributables via a group policy?

This ought to be simple, but seems to be anything but.
I wish to create an installer that can be used by those using group policies to install products. I do not know then if this must be an MSI, or an EXE. Can an EXE install be installed via a group policy? I chatted with another Wix novice who seemed to think it was a bad idea to have an install that was a plain MSI file.
My product uses the Visual C++ 2010 redistributables. I do not wish to use merge modules. Both this and this link give some of the disadvantages of using them. I object to 1) installing things that the user has not consented to, and 2) not having a control panel uninstall item with a version number that users can inspect and see if they have the latest version of. Thus, I am not interested in responses consisting of people lecturing me on why I ought to use merge modules. If what I am asking for is truly IMPOSSIBLE without merge modules, then please explain why.
I do not know if it is necessary to use a bootstrapper to kick off an EXE install. I gather that it is, but it seems bizarre for me, for an MSI with such involved tables and descriptions, not to be able to kick of a mere EXE, ON THE CONDITION that the redistributable is not installed already.
If it is necessary to use a bootstrapper, I would like to know if anyone can find a complete example, with both bootstrapper and Wix code, for an example of a product install; ideally, together with the command lines necessary to compile them, for such a common case as installing a VC++ 2010 (or possibly 2012) program, together with its redistributable - with the latter being installed as the EXE.
I have found this to be straight-forward and easy to do in Inno Setup Pascal - except for the Group Policy part. I have found anything but COMPLETE examples and/or straightforward explanations to accomplish this using a Microsoft installer. No matter what Microsoft says, I would consider such an installer to be best practices. My code is not managed, and I would like to support XP. Thus, a bootstrapper that requires some .net to already be installed would only add another unsolved layer of complexity to the problem. One that statically links to a .net library might not be too bad, if it did not create very much overhead. My MSI install seems to work pretty well. I did not realize that installing a vcredist_x86.exe would be a problem with such an elusive solution. I do not have Visual Studio. I am using the Qt framework, and have Visual Studio installed only to compile my application. If you have a bootstrapper solution, please specify which bootstrapper you are using. Ideally, the same idea could be extended to more than one prerequisite, and the same coding pattern could be used. If there were a way to use a merge module or additional MSI so that the redistributable would have its own control panel entry, that could be acceptable.
Brownie points for suggesting a mailing list, forum or well-populated chat channel to talk about Wix that does not require one to receive a lot of unnecessary mailing list traffic.
Group Policies by default don't allow EXEs to be installed. I did read about some admins that repackage EXEs into MSIs to deploy them via GPO but that is rather hacky. There is also the possibility to script the deployment - GPOs support script execution, machine or user level.
You can't embed an MSI within another MSI either because only one installation can execute at any time (Windows Installer design).
I don't know how you will be providing your product to your customers but vcredist_x86.exe (I am trying this with the v100 version) uncompresses into the root folder and generates an msi and a cab (vc_red.msi and vc_red.cab) among other files. If you provide these to your customers they can add them to the same GPO used to deploy your product.

how to create installer file

I am currectly finishing my project in C++ and i'm looking for a way to create my own C++ installer file
which will create the project dll's and exe files into a specific path
what is the easier way to learn how to do it?
There are several ways to build an installer. While you can of course always make one yourself, you should google for something like "create an installer". Some prebuilt solutions include "InstallShield", or the ".msi" file format, which you can create on your own using something like "Advanced Installer".
Of course, if you want your users to build your project from source, then you need a makefile and to make sure you bundle all the libraries. There are also kits like autotools to do that for you.
If you use VS 2010, Installshield LE would suffice as it is integrated into VS 2010.
If you have access to Installshield IDE, there is nothing better available for your packaging needs.
There are two ways of packaging:
a) The LEGACY way
b) The Windows Installer way, Basic MSI is the keyword here.
The LEGACY way involves creating your own scripts for:
a) Installing the files to their locations
b) Writing registry entries, if needed
c) Registering COM components, if needed
d) Creating shortcuts etc...
Tools that can be used for LEGACY approach are:
a) NSIS - very good and has a scripting language of its own.
b) Installshield - has a project type called Installscript Project. Installscript is the scripting language to be used.
The Windows Installer way is a bit hard comapred to the LEGACY way.
One has to learn the basics of MSI technology which can be daunting.
The package created has .msi as extension. This file is a database that the developer configures and the Windows Installer takes care of all other things. This is called TRANSACTIONAL installation procedure.
Even the UI presented during install is configured in the Database using tables like Dialog, Controls etc...
Tools that can be used for Windows Installer approach are:
a) Installshield - has a project type called Basic MSI
b) Wix - Opensource and xml based. You configure appropriately named xml files and various utilities in the Wix package will help you to create an MSI package.
First after completing your project click save. Second click on file tab,Add,New Project.
In new Project Click other Project types , Setup and Deployment and in that You can click InstallShield LE or Visual Studio Installer.
Hope this Helped you
I always recommend NSIS. You might also investigate HM Nis Edit - it's an IDE for NSIS that has a useful wizard feature. It will generate an installer script for you which you can further customize. The documentation is extensive.
can't believe no one mentioned install creator pro(there is also a free version with a branded message that displays after installing). Its feature set is pretty limited, though it has options for writing registry values and specifying custom paths to %AppData% or any other place you may want to install some files. it also has an optional wizard interface, and with each step you have the oppurtunity to preview each individual page.
the paid version offers the option for adding serial number/registration to your program. i've never tried it so i'm not sure how effective it may be. its also quite and expensive little program, but i would recommend it atleast to the beginner or someone who is more concerned with maintaining the codebase of their program and less concerned with how fancy and decorated their installer program is.
i know its been a long time since this was posted but for future reference this program is far easier for any beginner to creating installation packages for the first time

While building a unit test project, VS 2010 cannot find the referenced assembly for testing

I'm developing a unit test project (let's say XXX.UnitTest) to test ViewModels in another project (XXX) in my solution. I can add the reference but when I build, an error states that it cannot find that same project (XXX)
Error 42 Could not load file or
assembly 'XXX, Version=1.0.2.66,
Culture=neutral, PublicKeyToken=null'
or one of its dependencies. The system
cannot find the file
specified. XXX.UnitTest
I did a clean rebuild of all projects in my solution.
I verified that the assembly with that version number (1.0.2.66) did exist in the path I was referencing.
I removed and re-added the reference both as a project and through the Browse tab.
I made sure that the version number was not specified in the csproj file.
I verified the referenced assembly with Dependency Walker.
I verified that both projects were targeting the x86 platform. (As suggested here Tips to help debug "Could not load file or assembly X or one of its dependencies")
Does anyone know what else can cause this problem?
Last week I had this same problem. It turns out my solution and projects were on a network resource. If I moved the solution to the local drive, the problem went away.
This problem happened regardless if I used a mapped drive or an UNC path.
This problem happened even with a Code Access Security Policy of "Full Trust" for the URL.
I believe the problem occurs on Windows XP computers and not Windows 7 computers, but have not tested or verified.
I believe it has something to do with the Share permissions.
If I try to use "offline folders" for the network resource, I get "access is denied".
-.
Setting NTFS permissions has no effect.
Adding user to administrators group has no effect.
I did not test to see if problem exists on removable local drives.
Work Around
Move solution and projects to a local hard drive.
Comment
I think this is a bug in Visual Studio 2010.
I came across this post while searching for the answer. Here is the solution. In the config file of QTAgent32.exe and devenv.exe in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE, add the following element to the section:
<runtime>
<loadFromRemoteSources enabled="true" />
</runtime>
This can be added to machine config file (C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config\ machine.config) for all VS2010 tools. Be sure to run notepad as administrator to allow machine.config to save.
See this link for details: http://msdn.microsoft.com/en-us/library/dd409252%28VS.100%29.aspx
I have the same problem. I'm running VS 2010 on Windows Server 2003; both running within a VM on a Mac. My VS project is in the mac home folder (~/) which is mapped as Z:\ from the Windows side. At build time, VS studio generates an error saying it can't find the UnitTests.dll or one of its dependencies. I get the same error with a small test project. If I move the project to the Windows C:\ drive, the dll reference resolves and unit tests work. I tried to add the reference Blanthor mentions, but couldn't get it to work.