tags:

views:

144

answers:

1

MyApp version 1.0 contained the file foo.dll. The version of this file was version 10.5.567. Now MyApp is version 2.0 and the version of foo.dll is 2.0.123. The version is LOWER than the old version. The vendor who wrote this dll decided to go backwards with the file version number. This is not a decision I can change.

How do I get WiX to always install this file?

The RemoveExistingProducts action is scheduled after the InstallFinalize action and also cannot be changed.

InstallShield had an 'always overwrite' flag but I don't think I can mimic this without changing the behavior of all files via a compiler switch. I do not want this. I just want to update THIS ONE file.

I have also tried

<RemoveFile Id="foo.dll" On="install" Name="foo.dll" />

But this did not work either. I end up getting 'Error 2753 The file foo.dll is not marked for installation' later.

+1  A: 

This isn't easy because it is against the standard behaviour of MSI-packages. When compiling, you have to set supress-file-options with -sf in light.exe. Then there are no file-informations from your files read. You can set DefaultVersion this version will be used. I have also used RemoveFile in a solution, but i can say that it works. I have add it in same componente where i add the file.

   <Component>
        <File DiskId="1" Id="fooDLL" Name="foo.dll" Vital="yes" 
         DefaultVersion="$(var.MAJORVERSION).$(var.MINORVERSION).$(var.BUILDVERSION)" 
         DefaultLanguage="0"></File>
        <RemoveFile Id='RemoveOldDLL' On='install' Name='foo.dll'/>
   </Componente>

This is not a clean way, but to remove an old version it works for me.

martin

related questions