It's tricky. There's a product out there that belongs to a very big corporation 
(not Microsoft), that has severe complications when you tell it that it should 
be putting logs into a path with parenthesis. Because we need those logs, we 
needed to put our software into a path without parenthesis. On a 64-bit machine 
you have (x86) for 32-bit applications, so we break. We had to solve this.

You can't just say C:\ because not all machines have C:\. You cannot take 
[SystemDrive] because those are often small system disks. So we take 
[ProgramFiles] and figure out its parent path with a CA from 
http://msiext.codeplex.com (SystemTools::Win32_GetParentDirectory). 

    <CustomAction Id="SetRootFolder" Return="check" Execute="firstSequence" 
Property="ROOTFOLDER" Value="[ProgramFilesFolder]" />
    <CustomAction Id="SetRootFolderParent" Property="WIN32_DIRECTORY" 
Value="[ROOTFOLDER]" Execute="firstSequence" />
    <CustomAction Id="ResolveRootFolderParent" BinaryKey="SystemTools" 
DllEntry="Win32_GetParentDirectory" Return="check" Execute="firstSequence" />
    <CustomAction Id="SetRootFolderFromParent" Property="ROOTFOLDER" 
Value="[WIN32_PARENT_DIRECTORY]" Execute="firstSequence" />

    <!-- set the install location from the previously recorded location in 
registry for upgrade -->
    <CustomAction Id="SetInstallLocationFromInstalledProductLocation" 
Return="check" Execute="firstSequence" Property="INSTALLLOCATION" 
Value="[INSTALLEDPRODUCTLOCATION]" />

    <InstallExecuteSequence>
      <!-- set the root folder to the parent of [ProgramFilesFolder] -->
      <Custom Action="SetRootFolder" After="LaunchConditions">NOT ROOTFOLDER 
AND NOT INSTALLEDPRODUCTLOCATION</Custom>
      <Custom Action="SetRootFolderParent" After="SetRootFolder">NOT 
INSTALLEDPRODUCTLOCATION</Custom>
      <Custom Action="ResolveRootFolderParent" After="SetRootFolderParent">NOT 
INSTALLEDPRODUCTLOCATION</Custom>
      <Custom Action="SetRootFolderFromParent" 
After="ResolveRootFolderParent">WIN32_PARENT_DIRECTORY AND NOT 
INSTALLEDPRODUCTLOCATION</Custom>
      <!-- set the installation location from a previously installed version -->
      <Custom Action="SetInstallLocationFromInstalledProductLocation" 
After="SetMaintenance">INSTALLEDPRODUCTLOCATION</Custom>
    </InstallExecuteSequence>

If your program files is D:\Program Files (x86), we get D:\, etc.

Hope this helps,

Cheers
dB.

dB. @ dblock.org 
Moscow|Geneva|Seattle|New York



-----Original Message-----
From: Anu Dev [mailto:queryl...@yahoo.com] 
Sent: Monday, November 02, 2009 9:49 AM
To: WIX
Subject: [WiX-users] How to change the installation to point to C:\

Hi
 
How to change the installation to point to C drive, rather than to programfiles 
or any other directory
 
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
 
Is there any easy way to do it.
 
Regards
Anweshi


      
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to