Reputation: 309
So, I wrote a code which uses some Microsoft Sql server dlls, these dlls depends on some C++ libraries. Initially the code was not working on the client's machine but when I installed C++ Redistributable Package it worked fine.
My question is how can I install these dependencies along with my code. I am using WIX to install the software.
Thanks, Ali
Upvotes: 4
Views: 4509
Reputation: 67148
Do this:
First get the merge modules of C++ redistributables (MSM files). Usually they are inside the Merge Modules folder (c:\ProgramFiles\Common Files\Merge Modules
) (for win x64 C:\Program Files (x86)\Common Files\Merge Modules). Their name is based on architecture (32/64 bit) and VC++ version.
In the <DirectoryRef>
tag for your target directory add a <Merge>
node with these attributes:
<DirectoryRef>
<Merge
Id="MSVCRedist" DiskId="1" Language="0"
SourceFile="Microsoft_VC90_CRT_x86.msm"/>
</DirectoryRef>
Add the <Feature>
:
<Feature
Id="VCRedist" AllowAdvertise="no" Display="hidden" Level="1"
Title="Visual C++ 9.0 Runtime"/>
Add the reference <MergeRef>
to the previous added <Merge>
section inside the <Feature>
definition:
<MergeRef Id="MSVCRedist"/>
The example has been extracted from here.
Upvotes: 6