[wix-users] How can I change install path at upgrade time.

Christopher Painter chrpai at iswix.com
Thu Jan 5 15:11:57 PST 2017


Are you doing a major upgrade or minor upgrade?


You have to do a major upgrade if you want to change path.  Directories are immutable in MSI land once a product is installed.  Major Upgrade gets around this because it's really an uninstall/reinstall.


Also you probably want the remember property pattern for major upgrades otherwise if version 1 is installed to a custom location  version 2 will still default to the standard location unless the user changes it again.


________________________________
From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of Brian Calhoun <calhounbmb at gmail.com>
Sent: Thursday, January 5, 2017 4:50 PM
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] How can I change install path at upgrade time.

All,

I am using WiX to create an MSI install.  Lets say that I have version
1.2.3 installed and I am upgrading to version 2.0.0.  I want version 1.2.3
removed and version 2.0.0 installed at a new path.  My current path related
elements appear as follows:

Version 1.2.3

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="$(var.PlatformProgramFilesFolder)">
        <Directory Id="OrgFolder" Name="Sample">
          <Directory Id="SolutionFolder" Name="CommonProducts">
            <Directory Id="INSTALLFOLDER" Name="SampleComponent" />
          </Directory>
        </Directory>
      </Directory>
    </Directory>
  </Fragment>

Version 2.0.0

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="$(var.PlatformProgramFilesFolder)">
        <Directory Id="OrgFolder" Name="Sample">
          <Directory Id="SolutionFolder" Name="CommonProducts">
            <Directory Id="INSTALLFOLDER" Name="UpdatedSampleComponent" />
          </Directory>
        </Directory>
      </Directory>
    </Directory>
  </Fragment>


I expect that the files at C:\Program
Files\Sample\CommonProducts\SampleComponent would be removed and new files
placed at C:\Program Files\Sample\CommonProducts\UpdatedSampleComponent but
it always seems to use C:\Program
Files\Sample\CommonProducts\SampleComponent.

What am I missing?

Thanks for any help you can provide.

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

WiX Support | WiX Experts and Resources from FireGiant<http://www.firegiant.com/>
www.firegiant.com
WiX Support | Installation, Development, Deployment | WiX Experts and Resources from FireGiant






More information about the wix-users mailing list