Files not getting copied to install directory using WIX and WAX - wix

I have some additional unmanaged dll's that need to be copied to the install folder. I am using WAX as well as it is supposed to make Wix easier to use. I have added the following markup to Product.wxs:
<Component Id="DataModel1.csdl" Guid="f8fb154d-f0c9-40f5-9bcf-593ed9540bda" Directory="INSTALLFOLDER">
<File Id="DataModel1.csdl" Name="DataModel1.csdl" Source="$(var.FLIR_TargetDir)DataModel1.csdl" />
</Component>
<Component Id="DataModel1.ssdl" Guid="a13c3c3b-e6a6-40ea-b9d8-84fd093ca0d5" Directory="INSTALLFOLDER">
<File Id="DataModel1.ssdl" Name="DataModel1.ssdl" Source="$(var.FLIR_TargetDir)DataModel1.ssdl" />
</Component>
<Component Id="DataModel1.msl" Guid="e308d75b-1f0b-4234-843d-6b44af2e80a9" Directory="INSTALLFOLDER">
<File Id="DataModel1.msl" Name="DataModel1.msl" Source="$(var.FLIR_TargetDir)" />
</Component>
<Component Id="Devart.Data.dll" Guid="a95a3053-7d4a-4030-b8c9-9d860a81a221" Directory="INSTALLFOLDER">
<File Id="Devart.Data.dll" Name="Devart.Data.dll" Assembly=".net" KeyPath="yes" Source="C:\Program Files (x86)\Devart\dotConnect\SQLite\Devart.Data.dll" />
</Component>
<Component Id="Devart.Data.SQLite.dll" Guid="16d0ca3c-425d-49e9-a754-043b0b9e4ada" Directory="INSTALLFOLDER">
<File Id="Devart.Data.SQLite.dll" Name="Devart.Data.SQLite.dll" Assembly=".net" KeyPath="yes" Source="C:\Program Files (x86)\Devart\dotConnect\SQLite\Devart.Data.SQLite.dll" />
</Component>
The files shows up as an unmapped file in the unmapped files area of the UI:
When the install happens the files do not get installed into the installation folder. What am I doing wrong?

The Assembly=".NET" tell's MSI to install the files in the Global Assembly Cache. The parent directory element is ignored/overridden. See:
http://wixtoolset.org/documentation/manual/v3/xsd/wix/file.html
If your looking for a tool to make WiX easier to learn/use then I'd suggest my own open source project:
https://github.com/iswix-llc/iswix-tutorials

Related

Install component only during fresh install but not during upgrade

I have a component say web.config, in this component I have included a web.config file.
<Component Directory="FeatureA" Guid="{692AA53D-4DFB-4FA0-A6FD-D30905383D1D}" Id="web.config" Permanent="yes">
<File KeyPath="yes" Source="Content\web.config" />
</Component>
During upgrades, I dont want to install this component. So, I have added a condition
<Component Directory="FeatureA" Guid="{692AA53D-4DFB-4FA0-A6FD-D30905383D1D}" Id="web.config" Permanent="yes">
<Condition>[WixBundleInstalled]=0</Condition>
<File KeyPath="yes" Source="Content\web.config" />
</Component>
The above condition not working during upgrades. Component is installing during upgrades. What should I add inside condition, so that the component should not install during upgrades?

DIFxApp fails to copy catalog file specified in "CatalogFile.NTx86" in INF

I want to make installer for driver.
I use Wix and DifxApp extension, but the driver is installed without certification.
It is failed to copy catalog file according to setupapi.log.
How to write WXS to install with certification?
Driver package is specified in WXS as below.
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
<Component Id="MyDrver" Guid="MY-GUID">
<Difxapp:Driver
AddRemovePrograms="no"
DeleteFiles="yes"
ForceInstall="yes"
Legacy="no"
PlugAndPlayPrompt="no"
Sequence="1"/>
<File Id="MyDrver_INF" Name="MyDrver.inf" Source="Driver\MyDrver.inf" Vital="yes" KeyPath="yes" DiskId="1" Checksum="yes" />
<File Id="MyDrver_CAT" Name="MyDrver.cat" Source="Driver\MyDriver_amd64.cat" Vital="yes" KeyPath="no" DiskId="1" Checksum="yes" />
<File Id="MyDrver_SYS" Name="MyDrver.sys" Source="Driver\MyDrver.sys" Vital="yes" KeyPath="no" DiskId="1" Checksum="yes" />
</Component>
</DirectoryRef>
Catalog file is specified in INF as below.
CatalogFile.NTx86 = MyDriver_x86.cat
CatalogFile.NTIA64 = MyDriver_ia64.cat
CatalogFile.NTAMD64 = MyDriver_amd64.cat
The Name="MyDrver.cat" in the MyDrver_CAT File actually renames the file that you are installing to MyDrver.cat. Omitting the "Name" attribute will automatically name the file the same as the file defined in the Source attribute (MyDriver_amd64.cat).
I assume your driver is failing to install because the inf file defines the CAT file with a specific name that does not exist in your installation since you rename that file to something else.

Wix toolset Multiple Instances Installation

Some months ago I posted this question about multiple installation, and I strictly followed the example suggested me.
It worked very fine, but I try to remove the default Instance.
When I type
msiexec /x MyInstaller.msi
my App is "logically" removed, but no folders and no files are deleted on my machine!
Here is the code:
<Directory Id="TARGETDIR" Name="SourceDir">
<Component Id="comp_67F76B3C_8D92_4DCF_8C51_42E51502C4A3" Guid="28C71156-F612-49ED-A4E9-0CB598AA84AB" MultiInstance="yes">
<CreateFolder/>
</Component>
<Component Id="comp_AA102B27_0657_498D_9CD5_683C4F33B5E2" Guid="0F601C97-CDFF-4614-A608-B42253240E2C">
<File Id="_C72F9A1F_AF4A_47A3_928C_238643ABA5D4" Name="CrashReportManager.exe" Source="..\workspace\Release\CrashReportManager.exe" KeyPath="yes" />
</Component>
<Component Id="comp_442142FD_D0B8_410C_8904_E73047757FAB" Guid="0A1AE820-0FF7-442C-8333-9FEFA2E3F33C">
<File Id="_CA463C5C_E397_40E6_9B7B_28CCA647D0CA" Name="BCGCBPRO2440d120.dll" Source="..\workspace\Debug\BCGCBPRO2440d120.dll" KeyPath="yes" />
</Component>
<Directory Id="dir_350BD3EA_2F6C_4AD4_A960_8AB2C40F4F36" Name="Docs">
<Component Id="DocFolderId" Guid="32DAE480-7C01-4BAA-B99D-9FE8D7D43369" MultiInstance="yes">
<CreateFolder />
</Component>
<Component Id="comp_FFFDE3FE_1205_4E74_82B1_E832501A096C" Guid="EECC223C-EBAD-43CA-9F3C-4A19FD9E7429">
<File Id="_D0FE1868_D0D7_4778_8BC6_D40FE2B21DB2" Name="ModuleList(1).txt" Source="..\ModuleList(1).txt" KeyPath="yes" />
</Component>
<Component Id="comp_07E32598_CA8D_46B6_A3D6_DA36FD308E1F" Guid="FCCC41AA-17BC-4ADA-925D-631A614C9F80">
<File Id="_894CFDFB_4514_4CAC_86C3_426CC6836B7C" Name="ModuleList(2).txt" Source="..\ModuleList(2).txt" KeyPath="yes" />
</Component>
<Component Id="comp_21465088_A65C_43D4_A038_93412404BA91" Guid="67D18D29-6466-4D36-A279-A9396A62019C">
<File Id="_C9362477_88D8_463C_B77D_7097255F5E13" Name="ModuleList.txt" Source="..\ModuleList.txt" KeyPath="yes" />
</Component>
<Component Id="comp_3C85BB37_5715_45E7_A135_C640D7348360" Guid="6DDB0F88-7346-4221-8FB1-106C5F707EE5">
<File Id="_BFE55263_BD18_427B_9F87_30403BB2540D" Name="ReadMe.txt" Source="..\ReadMe.txt" KeyPath="yes" />
</Component>
</Directory>
</Directory>
What's wrong?
You used KeyPath="yes" in all of your components. This means, that such a component is used as a checkpoint for the Windows installer, for example if you want to repair an installation. It means that it is a mandatory component required for the application to function.
Since you are using multiple instances, and you mentioned you installed more than just the default instance, the Windows installer does not remove key components until the last one of the instances is getting uninstalled (i.e. it keeps track of them internally with a reference counter).
Use MultiInstance="yes" for each and every component, and like Yan says, get rid of the <CreateFolder/> component

pyro (WiX) delta patches are too big (when compared to bdiff)

I added the -delta switch when building patches with pyro (WiX) recently which seems to improve sizes somewhat. However when comparing diff sizes to those of our old bdiff-based patcher some files still come out much larger than expected. I delved into the source and it seems to be using mspatchc.dll
It appears to be one file in particular that's causing problems: The original and new versions of the file are both around the 100MB mark. Using bdiff generates a diff of 15KB, but pyro -delta uses 18MB!!
Why is this? Is it a bug in WiX? Is there a way i can improve (reduce the size of) the diffs generated by pyro?
candle patch.wxs
light patch.wixobj
melt ..\old\project.msi -out old.wixpdb -pdb old\project.wixpdb -x old_bin
melt ..\new\project.msi -out new.wixpdb -pdb new\project.wixpdb -x new_bin
torch -p -xi old.wixpdb new.wixpdb -out diff.wixmst
pyro -delta patch.wixmsp -out patch.msp -t proj1 diff.wixmst
I don't know if this should be an answer really, this is just an educated guess.
I'm guessing bdiff creates diff files of only the differences of files and has special logic to apply those diffs to the installed files. Alternatively, pyro -delta includes whole file if they are different.
You could test this by including a gigantic text file and then using bdiff after changing one word to get a tiny diff and then using pyro -delta will probably get you a diff basically the size of the text file.
This is more of a work-around, but by using more fragments this issue can be mitigated (at least until you need to patch the file in question). For example:
<Fragment>
<DirectoryRef Id="MyApp" DiskId="1">
<Component Id="MyApp.exe" Guid="*">
<File Id="MyApp.exe" KeyPath="yes" Source="$(var.OutputDir)\MyApp.exe" />
</Component>
<Component Id="Library.dll" Guid="*">
<File Id="Library.dll" KeyPath="yes" Source="$(var.OutputDir)\Library.dll"/>
</Component>
<Component Id="HugeLibrary.dll" Guid="*">
<File Id="HugeLibrary.dll" KeyPath="yes" Source="$(var.OutputDir)\HugeLibrary.dll" />
</Component>
</DirectoryRef>
</Fragment>
If HugeLibrary.dll always creates big deltas, we can move it to it's own fragment which means that it will only be in the patch if it's explicitly coded in:
<Fragment>
<DirectoryRef Id="MyApp" DiskId="1">
<Component Id="MyApp.exe" Guid="*">
<File Id="MyApp.exe" KeyPath="yes" Source="$(var.OutputDir)\MyApp.exe" />
</Component>
<Component Id="Library.dll" Guid="*">
<File Id="Library.dll" KeyPath="yes" Source="$(var.OutputDir)\Library.dll"/>
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="MyApp" DiskId="1">
<Component Id="HugeLibrary.dll" Guid="*">
<File Id="HugeLibrary.dll" KeyPath="yes" Source="$(var.OutputDir)\HugeLibrary.dll" />
</Component>
</DirectoryRef>
</Fragment>
All files will still be in the installer, and the component group(s) will remain the same.
<Fragment>
<ComponentGroup Id ="myapp">
<ComponentRef Id="MyApp.exe"/>
<ComponentRef Id="Library.dll"/>
<ComponentRef Id="HugeLibrary.dll"/>
</ComponentGroup>
</Fragment>

Detect 64bit system from 32bit WIX installer

I have a 32bit WIX installer that installs a .NET based windows service. I need to use one external .dll that comes in 32bit and 64bit versions. Is there any way a 32bit installer can detect it's running on a 64bit machine? I want to then conditionally install the 32 or 64 bit .dll.
Extending Morten's answer, I did this in Wix 3.6
<Component Directory="INSTALLLOCATION">
<File Id="msvcp100.dll_x64" Source="$(var.x64)\msvcp100.dll" KeyPath="yes" />
<Condition><![CDATA[VersionNT64]]></Condition>
</Component>
<Component Directory="INSTALLLOCATION">
<File Id="msvcp100.dll_x86" Source="$(var.x86)\msvcp100.dll" KeyPath="yes" />
<Condition><![CDATA[Not VersionNT64]]></Condition>
</Component>
Try this:
<Component Id="Component1" Guid="*">
<![CDATA[Not VersionNT64]]>
<File Id="File1" Name="1.dll" Source="c:\dlls\1.dll"/>
</Component>
<Component Id="Component2" Guid="*">
<![CDATA[VersionNT64]]>
<File Id="File2" Name="2.dll" Source="c:\dlls\2.dll"/>
</Component>
Create a property with ProcessorArchitecture and get the value of this from registry. Based on this property create a CONDITIONAL FEATURE.