views:

25

answers:

2

Okay! I have finally more closely identified the problem I'm having. In my installer, I was attempting to get a settings file to REMAIN INTACT on a major upgrade. I finally got this to work with the suggestion to set

<InstallExecuteSequence>
    <RemoveExistingProducts After="InstallFinalize" />
</InstallExecuteSequence>

This is successful in forcing this component to leave the original, not replacing it if it exists:

<Component Id="Settings" Guid="A3513208-4F12-4496-B609-197812B4A953" NeverOverwrite="yes">
    <File Id="settingsXml" KeyPath="yes" ShortName="SETTINGS.XML" Name="Settings.xml" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\Settings\settings.xml" Vital="yes" />           
</Component>

HOWEVER! This is a problem! I have another component listed here:

<Component Id="Database" Guid="1D8756EF-FD6C-49BC-8400-299492E8C65D" KeyPath="yes">
    <File Id="pathwaysMdf" Name="Pathways.mdf" DiskId="1" Source="\\fileserver\Shared\Databases\Pathways\SystemDBs\Pathways.mdf" Vital="yes"/>
<File Id="pathwaysLdf" Name="Pathways_log.ldf" DiskId="1" Source="\\fileserver\Shared\Databases\Pathways\SystemDBs\Pathways.ldf" Vital="yes"/>
</Component>

And this component MUST BE REPLACED on a major upgrade. I can only accomplish this so far by setting

<RemoveExistingProducts After="InstallInitialize" />

THIS BREAKS THE FIRST FUNCTIONALITY I NEED WITH THE SETTINGS FILE.

HOW CAN I DO BOTH?!

A: 

The problem is that settings.xml shouldn't be installed in the first place, what you really want to do is install something like a 'defaultSettings.xml' and have user-editable settings in a separate location, copying the default to the user/system config in either a post-install configuration step or at first run. If the user modifies the file, and runs a "repair" then it's going to get overwritten anyway, this is the intended behavior of Windows Installer.

If you really want Windows Installer to "leave the file alone" then you're going to need an unmanaged component, i.e. a component with an empty GUID. Such as...

<Component Id="Settings" Guid="" NeverOverwrite="yes">
    <File Id="settingsXml" KeyPath="yes" ShortName="SETTINGS.XML" Name="Settings.xml" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\Settings\settings.xml" Vital="yes" />           
</Component>
sascha
Except I can't change this! I'm dealing with an OLD installer, from before I even started working here, which needs to be updated with the new version I've written!
Joshua
I've decided that the only option remaining is two custom actions... which I'm trying to get working!http://stackoverflow.com/questions/2953366/wix-custom-action-with-dtf-quite-confused
Joshua
A: 

Unless someone disagrees, I've decided that what I want to do is NOT possible. I am attempting an ugly hack using two custom actions!

http://stackoverflow.com/questions/2953366/wix-custom-action-with-dtf-quite-confused

Joshua