[wix-users] custom destination directory

Walter Dexter wfdexter at gmail.com
Tue May 31 07:57:58 PDT 2016


Are you asking specifically how to say "put it in
C:\Arbitrary\Custom\Directory\Path" or do you want it as a subdirectory of
a "well known" directory?

If the first, it's tricky, because that's not the "right" way to do things.
You're supposed to let the system layout specify where things go.

The systems I create MSIs for are all in-house and all identical. But I
have 14,0000 identical systems of one type, and 2,000 of another type.We
put things in arbitrary and peculiar places sometimes, so I had to figure
this out.

In any case, if that's what you really want to do, here's how I do it.

<CustomAction Id="CA_SetCDrive" Directory="C_DRIVE" Value="c:\" />

<InstallExecuteSequence>
<Custom Action="CA_SetCDrive" After="CostFinalize" />
</InstallExecuteSequence>

        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="C_DRIVE" Name="CDrive">
                <Directory Id="DIR_ARBITRARY" Name="Arbitrary">
                    <Directory Id="DIR_CUSTOM" Name="Custom">
                        <Directory Id="DIR_DIRECTORY" Name="Directory">
                            <Directory Id="DIR_PATH" Name="Path" />
</Directory>
                    </Directory>
</Directory>
   </Directory>
        </Directory>


Then you can use "DIR_PATH" as a directory Id in all the usual ways. I
might have messed up the matching of </Directory> but I'm sure you can work
it out.


On Fri, May 27, 2016 at 9:52 AM, Hoover, Jacob <Jacob.Hoover at greenheck.com>
wrote:

> Id != id
>
> -----Original Message-----
> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf
> Of Lewie Fitz
> Sent: Friday, May 27, 2016 9:52 AM
> To: wix-users at lists.wixtoolset.org
> Subject: [wix-users] custom destination directory
>
> Hello,
>
> I would like my installer to default to a custom destination directory
> such as C:\Users\Public\AppName and let the user select a different
> directory if required. I see how to install to the programs directory (and
> other system dirs), but I can't find any info on setting up a custom
> directory. I tried creating a SetProperty entry, but I get error
> CNDL0010 : The SetProperty/@Id attribute was not found; it is required.
> This is what I am doing:
>
>
>          <SetProperty id="PublicDir" Value="C:\Users\Public"/>
>          <Directory Id="TARGETDIR" Name="SourceDir">
>              <Directory Id="PublicDir">
>                  <Directory Id="APPLICATIONROOTDIRECTORY" Name="AppName"/>
>              </Directory>
>          </Directory>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>


More information about the wix-users mailing list