You would need to save it somewhere and read it on upgrade, Rob has an example 
here 
http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern/

Neil

-----Original Message-----
From: fom Forstner Michael [mailto:f...@keba.com] 
Sent: 18 April 2014 13:00
To: General discussion about the WiX toolset.
Subject: [WiX-users] Preserving install directory on upgrade

Hi,

I recently detected a problem within my installer package (No UI).
I implemented it with major upgrade capability to easily install new versions.

What I have realized now is, that during major upgrade I loose my previousely 
set install directory:

This is my directory structure:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLDIR" Name="MyCompany">
          <Directory Id="DIR_App" Name="MyApp">
            <Directory Id="DIR_Base" Name="Base">
              <Directory Id="DIR_Bin" Name="bin"/>
              <Directory Id="DIR_Dll" Name="dll"/>
            </Directory>
          </Directory>
        </Directory>
      </Directory>
    </Directory>
</Fragment>
</Wix>

The initial installation is called with parameter: INSTALLDIR=C:\test This 
results as expected with my application being installed to c:\test.

If I make now a new version of my installation and call it with no parameter, 
the previosu version is deleted and the new version is intalled. But now the 
new version is installed to the default directory "C:\Program 
Files\MyCompany\.."

Is there some way to preserve the custom install directory, so that MSI 
remembers it? Or do I have to write the INSTALLDIR to the registry and get it 
from there during upgrade?

kinf regards,
Michael



------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the 
definitive new guide to graph databases and their applications. Written by 
three acclaimed leaders in the field, this first edition is now available. 
Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to