Redistributable failing in Vista - wix

I am using the following code in my Wix Installer.
<DirectoryRef Id="TARGETDIR">
<Merge Id="CRT" Language="0" SourceFile=".\resources\Microsoft_VC90_CRT_x86.msm" DiskId="1" />
<Merge Id="ATL" Language="0" SourceFile=".\resources\Microsoft_VC90_ATL_x86.msm" DiskId="1" />
<Merge Id="MFC" Language="0" SourceFile=".\resources\Microsoft_VC90_MFC_x86.msm" DiskId="1" />
<Merge Id="MFCLOC" Language="0" SourceFile=".\resources\Microsoft_VC90_MFCLOC_x86.msm" DiskId="1" />
<Merge Id="OpenMP" Language="0" SourceFile=".\resources\Microsoft_VC90_OpenMP_x86.msm" DiskId="1" />
<Merge Id="CRT Policy" Language="0" src=".\resources\policy_9_0_Microsoft_VC90_CRT_x86.msm" DiskId="1" />
<Merge Id="MFC Policy" Language="0" src=".\resources\policy_9_0_Microsoft_VC90_MFC_x86.msm" DiskId="1" />
</DirectoryRef>
<Feature Id="VCRedist" Title="Visual C++ 9.0 Runtime" AllowAdvertise="no" Display="hidden" Level="1">
<MergeRef Id="CRT" />
<MergeRef Id="CRT Policy"/>
<MergeRef Id="ATL" />
<MergeRef Id="MFC" />
<MergeRef Id="MFC Policy"/>
<MergeRef Id="MFCLOC" />
<MergeRef Id="OpenMP" />
</Feature>
I feel that the msi build with this code works in many XP systems but fails in Vista. The programs and the shortcuts are getting created properly in Vista like XP.
What should I do in Vista to install these redistributables ?? I do not want to create a setup.exe with bootstrapper. My requirement states everything to be in a single msi only.
Any code example would help me a lot.
Thanks in advance for any valuable help.
Regards,
tvks

I thought that c++ redist is one of the packages recommended to be installed using the pre-packaged msi from MS. also i'm pretty sure all of the merge modules you included in your installer need corresponding policy merge modules not only crt and mfc.
another thing to check if your msi is elevating properly in Vista (UAC prompt)

In my current project we install the VC90 redistributables in the same way that you are describing in your post. We use the same attributes/values etc. However, we do not include any policy-modules. It works both under XP and Vista.
The Wix tutorial states that:
There is generally no need to include the policy MSMs as part of the installation.
So, if you have not given it a try, create an installation without any policies and see if that works better.

Related

WiX and Merge Modules - to include, or not, the policy files?

I am including the VS 2005 merge modules into an MSI. The code is in place and the MSI builds.
<Fragment>
<DirectoryRef Id="TARGETDIR">
<!--
WiX docs say "There is generally no need to include the policy MSMs as part of the installation.", but, the former Installshield
project did include it, so, including here now. Remove it if it's actually not required.
http://wixtoolset.org/documentation/manual/v3/howtos/redistributables_and_install_checks/install_vcredist.html
-->
<Merge Id="VCRedist2005_32" SourceFile="$(var.RESOURCES)\MergeModules\VS2005\Microsoft_VC80_CRT_x86.msm" DiskId="1" Language="0"/>
<Merge Id="VCRedist2005_64" SourceFile="$(var.RESOURCES)\MergeModules\VS2005\Microsoft_VC80_CRT_x86_x64.msm" DiskId="1" Language="0"/>
<!--
<Merge Id="VCRedistPolicy2005_32" SourceFile="$(var.RESOURCES)\MergeModules\VS2005\policy_8_0_Microsoft_VC80_CRT_x86.msm" DiskId="1" Language="0"/>
<Merge Id="VCRedistPolicy2005_64" SourceFile="$(var.RESOURCES)\MergeModules\VS2005\policy_8_0_Microsoft_VC80_CRT_x86_x64.msm" DiskId="1" Language="0"/>
-->
</DirectoryRef>
</Fragment>
And in my Product.wxs:
<Feature ...>
<ComponentRef Id="Client_Registry" />
<?if $(var.Product) = xx ?>
<MergeRef Id="VCRedist2005_32"/>
<MergeRef Id="VCRedist2005_64"/>
<!--
<MergeRef Id="VCRedistPolicy2005_32"/>
<MergeRef Id="VCRedistPolicy2005_64"/>
-->
<?endif?>
</Feature>
I am concerned about two warnings though:
1>light.exe(0,0): warning LGHT1076: ICE25: Possible dependency failure as we do not find CRT.Policy.63E949F6_03BC_5C40_FF1F_C8B3B9A1E18E#0 v in ModuleSignature table
1>light.exe(0,0): warning LGHT1076: ICE25: Possible dependency failure as we do not find CRT.Policy.4F6D20F0_CCE5_1492_FF1F_C8B3B9A1E18E#0 v in ModuleSignature table
Two messages because I am including both the 32 and 64-bit merge modules.
I did not add the policy files because the wix page suggests not to. A MS blog page also backs that up. But, then there are pages such as this one, where the advice is TO include them.
So, I am unsure how to proceed. Should the policy files be included or not? And if not, why not?
I've always preferred to bootstrap the vcredist runtime instead. Keeps my MSI all nice and clean with no issues.

Wix - how to prevent installer from closing unrelated applications in repair mode when C++ redistributable is included as merge module?

I need to include Microsoft C++ 2013 redistributable in my installer project.
I tired using instructions from Wix documentation:
http://wixtoolset.org/documentation/manual/v3/howtos/redistributables_and_install_checks/install_vcredist.html
This is excerpt from .wxs my where I'm including Merge module package:
<Fragment>
<FeatureGroup Id="CompleteFeatures">
<Feature Id="Complete" Level="1" Title="$(var.PRODUCT)" AllowAdvertise="no" TypicalDefault="install">
<!-- app components here -->
</Feature>
<Feature Id="VCRedist" Title="C++ Redistributable Package for Visual Studio 2013" AllowAdvertise="no" Display="hidden" Level="1" Absent="disallow">
<MergeRef Id="VCRedist"/>
</Feature>
</FeatureGroup>
<DirectoryRef Id="APPLICATIONFOLDER">
<Merge Id="VCRedist" SourceFile="Microsoft_VC120_CRT_x86.msm" DiskId="1" Language="0"/>
</DirectoryRef>
Redistrbutable dlls are installed silently into system32 folder. However when using repair option, installer asks to close miscellaneous applications like visual studio(that is not acceptable):
http://i.stack.imgur.com/h5Ixd.png
Problem doesn't exist when c++ redistributable package is not included to installer.
During uninstall no applications are required to be closed. How can I fix repair option to not require closing unrelated applications?
The simplest answer is to not include the C++ merge modules but instead bootstrap the prereqs using burn. This creates the separation you are looking for. In my experience, the merge modules have too many problems to be considered useable. I'm pretty sure MSFT conceded this at some point also.
I ended up checking if msvcr120.dll is present in system directory and installing redistributable based on that condition.
<Property Id="VC2013_REDIST_INSTALLED">
<DirectorySearch Id="CheckFileDir" Path="[SystemFolder]" Depth="1">
<FileSearch Id="CheckFile" Name="msvcr120.dll" />
</DirectorySearch>
</Property>

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.

Generating an executable using wix

I am learning Wix and I want to generate a setup.exe file instead of a setup.msi.
Is that possible?
A setup EXE is usually referred to as a bootstrapper or chainer. WiX 3.5 will ship with an executable called burn.exe, unfortunately this is still under heavy development.
If you're just after a basic self-extracting EXE with no additional logic you can use the included setupbld.exe with WiX. However it's pretty limited and only includes the most basic functionality.
Alternatively, 7-zip includes basic functionality for creating a setup.exe from an existing MSI. You will need to install the SFXs for installers addon first.
If you're after additional logic, dependency checking, etc. there are loads of alternatives. Personally I use IRMakeBootstrap, but have heard very good things about dotNetInstaller on the wix-users mailing list.
dotNetInstaller
IRMakeBootstrap (Commercial product, licensed as part of MSI Factory)
Visual Studio Bootstrapper (Supports dependencies, not sure about self-extracting exe though)
step 1.Create window application
step 2. Add setp project
step 3. Add reference
1.WixNetFxExtension.dll
2.WixNetFxExtension.dll
3.WixNetFxExtension.dll
step 4. Add folowing code
<Component Id="ProductComponent">
<File Id="installation"
source="E:\MyWork\WindowsFormsApplication2\
WindowsFormsApplication2\bin\Debug/
WindowsFormsApplication2.exe"/>
<!-- TODO: Insert files, registry keys, and other
resources here. -->
</Component>
step 5. <Property Id="WIXUI_INSTALLDIR"
Value="INSTALLFOLDER" ></Property>
<UIRef Id="WixUI_InstallDir"/>
step 6.
<Directory Id="DesktopFolder" Name="Desktop"/>
<Directory Id="INSTALLFOLDER" Name="SetupProject1"
/>
step 7. <ComponentRef
Id="ApplicationShortcutDesktop"/>
step 8.<Fragment>
<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationShortcutDesktop"
Guid="cde1e030-eb64-49a5-b7b8-400b379c2d1a">
<Shortcut Id="ApplicationDesktopShortcut"
Name="SetupProject1" Description="SetupProject1"
Target=".
[INSTALLFOLDER]WindowsFormsApplication2.exe"
WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="RemoveDesktopFolder"
Directory="DesktopFolder" On="uninstall" />
<RegistryValue Root="HKCU"
Key="Software\SetupProject1" Name="installed"
Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
</Fragment>
step 9.build and install setup

Wix installer and disabled features

I'm using Wix3 beta with Feature Tree UI. I'm installing several assemblies as separate components into a custom subdirectory inside ProgramFiles, as well as into GAC. Additionally I would like to package DEBUG versions of the same assemblies as one component and let the user decide whether to install them or not. Now this feature with debug assemblies is disabled by default, but the debug assemblies are installed regardless.
Below the relevant snippet:
<DirectoryRef Id="INSTALLDIR">
<Directory Id="bin" Name="bin">
<Directory Id="Debug" Name="Debug">
<Component Id="DebugComponent" Guid="PUT-GUID-HERE">
<File Id="DebugAssemblyXXX" DiskId="1" Source="Debug\XXX.dll"></File>
</Component>
</Directory>
<Directory Id="Release" Name="Release">
<Component Id="ReleaseComponent" Guid="PUT-GUID-HERE">
<File Id="ReleaseAssemblyXXX" DiskId="1" Source="Release\XXX.dll"></File>
</Component>
</Directory>
</Directory>
</DirectoryRef>
<Feature Id="All" ConfigurableDirectory="INSTALLDIR" Title="Title" Level="1"
Display="expand" AllowAdvertise="no" Absent="disallow" Description="Desc">
<Feature Id="DebugAssemblies" Title="Debug Assemblies" Level="1000" Absent="allow"
AllowAdvertise="no" Description="Debug versions of assemblies.">
<ComponentRef Id="DebugComponent" />
</Feature>
<Feature Id="ReleaseFeature1" Title="Feature" Level="3"
AllowAdvertise="no" Description="Another description">
<ComponentRef Id="ReleaseComponent"/>
</Feature>
</Feature>
The weird thing is that if I run the msi file again and go to "Change" and disable the Debug feature, the Debug assemblies will be deleted, e.g. the logic works fine this time.
The default INSTALLLEVEL is 3.
Any suggestions?
In case somebody else gets stuck with this: apparently the top-level feature should not be named "All" as in my case - it might have some default meaning to Wix/Windows Installer. Upon renaming it to something else everything works as expected.