Sorry about reposting this; I put it in the wrong forum initially...

My installer allows the user to specify the folder location for the initial
install.  But on an upgrade, I'd like to prevent them from changing that
location, so I don't allow them to specify the folder.

I think I understand how to get the folder name of the original location on
upgrade: My code uses "*" for product code, so a new one is generated with
each build.  I have a Custom Action in a DLL which will use
MsiGetComponentPath with the value of "OLDERVERSIONBEINGUPGRADED" to
determine the folder.  I think that this property contains the ProductCode
of the version being upgraded.  OLDERVERSIONBEINGUPGRADED is set by this
code:

<Upgrade Id="$(var.UpgradeCode)">
      <UpgradeVersion Minimum="$(var.ProductVersion)" OnlyDetect="yes"
             Property="NEWERVERSIONDETECTED" />
      <UpgradeVersion Minimum="0.0.0" Maximum="$(var.ProductVersion)"
             IncludeMinimum="yes" IncludeMaximum="no"
             Property="OLDERVERSIONBEINGUPGRADED" />
</Upgrade>

Right now, I am setting the INSTALLDIR to a hard-coded value, like this:

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="foo" Name="MyCompany Name">
          <Directory Id="INSTALLDIR" Name="My Product Name">
          </Directory>
        </Directory>
      </Directory>
            ... rest of installable components ...
    </Directory>

My question is, how do I set INSTALLDIR to the value returned by the call to
MsiGetComponentPath, and when should it be scheduled? 

Thanks
-- 
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/INSTALLDIR-and-Upgrades-reposted-in-correct-forum-tp5635805p5635805.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to