I have an application compiled in VS 2015 and requiring VC ++ Redistributable to work properly. Prior to this last build, we used an older version of VS and simply used the merge module to process the corresponding redistribution files. However, I noticed that when using the latest merge modules for 2015 (Microsoft_VC140_CRT_x64.msm) my application still does not work out of the box. I did a few digging , and it seems that some things have changed with the latest merge modules. It seems that now Microsoft recommends installing the vcredist_x64.exe package directly instead of using merge modules.
So, I'm trying to create a custom action for this. I follow a similar tutorial here , although I adapt it for the VC Redistributable executable. The first thing I need to do is install where the .exe file will be installed after installation:
<Directory Id='APPLICATIONROOTDIRECTORY' Name='MyApp'> <Directory Id="VCREDISTDIR" Name="VCRedist"> </Directory> </Directory>
Then I need to add my files to the component group, which will be installed as part of a hidden function (since I want it to be automatically installed).
<ComponentGroup Id="VCRedist" Directory="VCREDISTDIR"> <Component Id="vcredist_x64.exe" Guid="-INSERT-GUID-HERE-" Win64="yes"> <File Id="VCREDISEXE" Name="vcredist_x64.exe" KeyPath="yes" Source="$(var.VCRedistSourceDir)" Checksum="yes"></File> </Component> </ComponentGroup>
A...
<Feature Id="VCRedistributable" Title="Visual C++ Runtime" AllowAdvertise="no" Display="hidden" Level="1"> <ComponentGroupRef Id="VCRedist" /> </Feature>
At this point, the vcredist_x64.exe file should be copied to the destination computer. Now I need to create a custom action to run the executable after installation.
<CustomAction Id="InstallVCRedistributable" FileKey="VCREDISEXE" Execute="deferred" ExeCommand="/silent" Impersonate="no" Return="check"/> <InstallExecuteSequence> <Custom Action="InstallVCRedistributable" Before="InstallFinalize"> <![CDATA[NOT REMOVE]]> </Custom> </InstallExecuteSequence>
I also include a status message in my user interface so that I can see when the executable is executing.
<UI> <ProgressText Action="InstallVCRedistributable">Installing Visual C++ Redistributable for Visual Studio 2015</ProgressText> </UI>
Now, when I run my installer, it should run vcredist_x64.exe ... and it does it ... but then it hangs during the installation of this executable file. I get a pop-up message stating that the problem is with this Windows Installer package and that the program that is being executed as part of the installation has not been completed. Then it rolls back my main installation of the application and never installs. Can someone explain why this is happening and how to fix it? Thanks!