I solved it! 

I don't know if this is the most efficient or preferred way, but here's what I 
did:

I created a component that is in the main feature that is always installed. It 
creates a registry key that contains the INSTALLLOCATION value. Such as:

<Component Id='SetInstallLocation' Guid='[YOUR-GUID-GOES-HERE'>
  <RegistryValue Id='SetInstallLocation' Root='HKLM' Key='SOFTWARE\My 
Company\My Product\[ProductCode]' 
      Name='InstallLocation' Action='write' Type='string' 
Value='[INSTALLLOCATION]' KeyPath='yes' />
</Component>

Then, I created a property that reads that registry key into INSTALLLOCATION, 
like so:

<Property Id="INSTALLLOCATION">
   <RegistrySearch Id='GetInstallLocation' Type='raw'
        Root='HKLM' Key='SOFTWARE\My Company\My Product\[ProductCode]' 
Name='InstallLocation' />
</Property>

INSTALLLOCATION gets set to the default value if the registry value doesn't 
exist, and gets set to the right value if it does.

Thanks for your help!



> -----Original Message-----
> From: Younie, Bradford
> Sent: Wednesday, September 29, 2010 8:38 AM
> To: 'General discussion for Windows Installer XML toolset.'
> Subject: Re: [WiX-users] Directory in Maintenance mode is not
> directoryinstalled to
> 
> That didn't work. I'll keep plugging away, but if anyone can see a
> possible cause of the problem, please let me know.
> 
> > -----Original Message-----
> > From: Pally Sandher [mailto:pally.sand...@iesve.com]
> > Sent: Wednesday, September 29, 2010 6:08 AM
> > To: General discussion for Windows Installer XML toolset.
> > Subject: Re: [WiX-users] Directory in Maintenance mode is not
> > directoryinstalled to
> >
> > Try removing the ConfigurableDirectory attribute from all but your
> top
> > level feature. I think that could be confusing Windows Installer
> about
> > where to put the sub-features. Could be wrong though but it's worth a
> > try.
> >
> > Palbinder Sandher
> > Software Deployment & IT Administrator
> > T: +44 (0) 141 945 8500
> > F: +44 (0) 141 945 8501
> >
> > http://www.iesve.com
> > **Design, Simulate + Innovate with the <Virtual Environment>**
> > Integrated Environmental Solutions Limited. Registered in Scotland
> No.
> > SC151456
> > Registered Office - Helix Building, West Of Scotland Science Park,
> > Glasgow G20 0SP
> > Email Disclaimer
> >
> > -----Original Message-----
> > From: Younie, Bradford [mailto:bradford.you...@chasepaymentech.com]
> > Sent: 28 September 2010 20:20
> > To: wix-users@lists.sourceforge.net
> > Subject: [WiX-users] Directory in Maintenance mode is not
> > directoryinstalled to
> >
> > I'm using the WIXUI_INSTALLDIR functionality in my installer. When I
> > install, it lets me change the install directory from the default
> path
> > that I set to INSTALLLOCATION and it installs to that new directory
> > perfectly fine. However, when I enter maintenance mode (by hitting
> > Change in Add/Remove Programs or re-running the installer), and I try
> > to
> > add a feature that I hadn't yet installed, it will always install it
> to
> > the default path, which is not where I installed the product to.
> >
> > Is there anything special I need to do to make that happen?
> >
> > Here's the code snippet of my installer:
> >
> > <?xml version='1.0'?>
> > <!--
> >     Copyright (c) Chase Paymentech Solutions, LLC. All rights
> reserved.
> > -->
> > <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";
> > xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension";>
> >   <?include Common\Config.wxi?>
> >   <?include Common\PackageData.wxi?>
> >   <Product Id='*' Name='Chase Paymentech Spectrum SDK
> > $(var.ProductVersion) for .Net $(var.NetVersion)' Language='1033'
> >              Version='$(var.ProductVersion)' Manufacturer='Chase
> > Paymentech' UpgradeCode='$(var.UpgradeCode)'>
> >     <Package Description='Spectrum SDK for .Net $(var.NetVersion)'
> > Comments='Installation of the Spectrum SDK for .Net
> $(var.NetVersion)'
> >              InstallerVersion='300' Compressed='yes' Platform='x86'
> />
> >
> >     <!-- To use the canned install sequence, but with a custom dialog
> > -->
> >     <Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION"/>
> >     <UIRef Id="MyWixUI_InstallDir" />
> >
> >     <Property Id="DOTNETVER" Value="Net$(var.NetVersionShort)" />
> >     <Property Id="FRAMEWORKROOT">
> >       <RegistrySearch Id="FrameworkRootDir" Root="HKLM"
> > Key="SOFTWARE\Microsoft\.NETFramework" Type="directory"
> > Name="InstallRoot" />
> >     </Property>
> >
> >     <PropertyRef Id="NETFRAMEWORK$(var.NetVersionShort)"/>
> >     <Condition Message="The .NET Framework $(var.NetVersion) must be
> > installed">
> >       Installed OR NETFRAMEWORK$(var.NetVersionShort)
> >     </Condition>
> >
> >     <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />
> >
> >     <Directory Id='TARGETDIR' Name='SourceDir'>
> >       <Directory Id='ProgramFilesFolder' Name='PFiles'>
> >         <Directory Id='MyCompany' Name='My Company'>
> >           <Directory Id='INSTALLLOCATION' Name='MyProduct'>
> >
> >               ...
> >
> >           </Directory>
> >         </Directory>
> >       </Directory>
> >     </Directory>
> >
> >     <Feature Id='Complete' Title='My Product' Description='The
> complete
> > package.' TypicalDefault='install' Display='expand' Level='1'
> >           ConfigurableDirectory='INSTALLLOCATION'>
> >       <Feature Id='Core' Absent='disallow' Title='Core Software'
> > Description='Core Runtime Components.' Level='1'>
> >        ...
> >       </Feature>
> >
> >       <Feature Id='Samples' Title='Sample Applications'
> > Description='Sample Applications.'
> > ConfigurableDirectory="INSTALLLOCATION" Level='3'>
> >        ...
> >       </Feature>
> >      </Feature>
> >    </Product>
> >   </Wix>
> >
> > Here is my InstallDir file
> >
> >
> > <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
> >   <Fragment>
> >     <UI Id="MyWixUI_InstallDir">
> >       <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
> >       <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12"
> />
> >       <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9"
> > Bold="yes" />
> >
> >       <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
> >       <Property Id="WixUI_Mode" Value="InstallDir" />
> >
> >       <DialogRef Id="BrowseDlg" />
> >       <DialogRef Id="DiskCostDlg" />
> >       <DialogRef Id="ErrorDlg" />
> >       <DialogRef Id="FatalError" />
> >       <DialogRef Id="FilesInUse" />
> >       <DialogRef Id="MsiRMFilesInUse" />
> >       <DialogRef Id="PrepareDlg" />
> >       <DialogRef Id="ProgressDlg" />
> >       <DialogRef Id="ResumeDlg" />
> >       <DialogRef Id="UserExit" />
> >
> >       <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction"
> > Value="WixUIValidatePath" Order="3">1</Publish>
> >       <Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog"
> > Value="InvalidDirDlg"
> > Order="4"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
> >
> >       <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog"
> > Value="Return" Order="999">1</Publish>
> >
> >       <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog"
> > Value="InstallDirDlg" Order="1">1</Publish>
> >
> >       <Publish Dialog="LicenseAgreementDlg" Control="Back"
> > Event="NewDialog" Value="WelcomeDlg">1</Publish>
> >       <Publish Dialog="LicenseAgreementDlg" Control="Next"
> > Event="NewDialog" Value="InstallDirDlg">LicenseAccepted =
> "1"</Publish>
> >
> >       <Publish Dialog="InstallDirDlg" Control="Back"
> Event="NewDialog"
> > Value="WelcomeDlg">1</Publish>
> >
> >       <Publish Dialog="InstallDirDlg" Control="Next" Order="1"
> > Event="DoAction" Value="FileExists">1</Publish>
> >       <Publish Dialog="InstallDirDlg" Control="Next" Order="2"
> > Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]">1</Publish>
> >       <Publish Dialog="InstallDirDlg" Control="Next" Order="3"
> > Event="DoAction" Value="WixUIValidatePath">NOT
> > WIXUI_DONTVALIDATEPATH</Publish>
> >       <Publish Dialog="InstallDirDlg" Control="Next" Order="4"
> > Event="SpawnDialog" Value="InvalidDirDlg"><![CDATA[NOT
> > WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
> >       <Publish Dialog="InstallDirDlg" Control="Next" Order="5"
> > Event="NewDialog" Value="MySetupTypeDlg">FILE_EXISTS="0" AND
> > (WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1")</Publish>
> >       <Publish Dialog="InstallDirDlg" Control="ChangeFolder"
> > Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]"
> > Order="1">1</Publish>
> >       <Publish Dialog="InstallDirDlg" Control="ChangeFolder"
> > Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
> >
> >       <Publish Dialog="MySetupTypeDlg" Control="Back"
> Event="NewDialog"
> > Value="InstallDirDlg">1</Publish>
> >       <Publish Dialog="MySetupTypeDlg" Control="Next"
> Event="NewDialog"
> > Value="VerifyReadyDlg">1</Publish>
> >
> >       <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog"
> > Value="MySetupTypeDlg">NOT Installed</Publish>
> >       <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog"
> > Value="MaintenanceTypeDlg">Installed</Publish>
> >       <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog"
> > Value="VerifyReadyDlg">1</Publish>
> >
> >       <Publish Dialog="VerifyReadyDlg" Control="Back"
> Event="NewDialog"
> > Value="MySetupTypeDlg" Order="1">NOT Installed</Publish>
> >       <Publish Dialog="VerifyReadyDlg" Control="Back"
> Event="NewDialog"
> > Value="MaintenanceTypeDlg" Order="2">Installed</Publish>
> >
> >       <Publish Dialog="MaintenanceWelcomeDlg" Control="Next"
> Order="1"
> > Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
> >
> >       <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton"
> > Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
> >       <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton"
> > Event="NewDialog" Value="CustomizeDlg">1</Publish>
> >       <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton"
> > Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
> >       <Publish Dialog="MaintenanceTypeDlg" Control="Back"
> > Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
> >
> >       <!--<Property Id="ARPNOMODIFY" Value="1" />-->
> >
> >       <Property Id="BannerBitmap">bannrbmp</Property>
> >       <Property Id="InstallerIcon">insticon</Property>
> >       <Property Id="CompleteSetupIcon">completi</Property>
> >       <Property Id="DialogBitmap">dlgbmp</Property>
> >
> >       <Binary Id="insticon" SourceFile="..\wix\Binary\Typical.ico" />
> >       <Binary Id="completi" SourceFile="..\wix\Binary\Complete.ico"
> />
> >
> >     </UI>
> >
> >     <UIRef Id="WixUI_Common" />
> >   </Fragment>
> > </Wix>
> >
> >
> >
> > Is there anything special I need to do to make that happen.
> >
> >
> > ---
> > Brad Younie | System Design and Development | Chase Paymentech
> > 4 Northeastern Blvd., Salem, NH 03079 | T:603.896.8291 | F:
> > 603.896.8135
> >
> bradford.you...@chasepaymentech.com<mailto:bradford.you...@chasepayment
> > e
> > ch.com>
> >
> > JPMorgan Chase & Co.
> >
> >
> > ----------
> > Learn more about Chase Paymentech Solutions,LLC payment processing
> > services at www.chasepaymentech.com.
> >
> > THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any
> attachments
> > are proprietary and confidential information intended only for the
> use
> > of the recipient(s) named above.  If you are not the intended
> > recipient,
> > you may not print, distribute, or copy this message or any
> attachments.
> > If you have received this communication in error, please notify the
> > sender by return e-mail and delete this message and any attachments
> > from
> > your computer.
> >
> >
> >
> > ---------------------------------------------------------------------
> --
> > -
> > ------
> > Start uncovering the many advantages of virtual appliances and start
> > using them to simplify application deployment and accelerate your
> shift
> > to cloud computing.
> > http://p.sf.net/sfu/novell-sfdev2dev
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> >
> >
> > ---------------------------------------------------------------------
> --
> > -------
> > Start uncovering the many advantages of virtual appliances
> > and start using them to simplify application deployment and
> > accelerate your shift to cloud computing.
> > http://p.sf.net/sfu/novell-sfdev2dev
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> ----------
> Learn more about Chase Paymentech Solutions,LLC payment processing
> services at www.chasepaymentech.com.
> 
> THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments
> are proprietary and confidential information intended only for the use
> of the recipient(s) named above.  If you are not the intended
> recipient, you may not print, distribute, or copy this message or any
> attachments.  If you have received this communication in error, please
> notify the sender by return e-mail and delete this message and any
> attachments from your computer.
> 
> 
> 
> 
> 
> -----------------------------------------------------------------------
> -------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
----------
Learn more about Chase Paymentech Solutions,LLC payment processing services at 
www.chasepaymentech.com.

THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are 
proprietary and confidential information intended only for the use of the 
recipient(s) named above.  If you are not the intended recipient, you may not 
print, distribute, or copy this message or any attachments.  If you have 
received this communication in error, please notify the sender by return e-mail 
and delete this message and any attachments from your computer.





------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to