Modify INSTALLDIR using custom action?

10 messages Options
Embed this post
Permalink
Harry Lee

Modify INSTALLDIR using custom action?

Reply Threaded More More options
Print post
Permalink
Hi,

My merge module receives an INSTALLDIR value passed in by a parent project
(which I have no control over), and the requirement is that I have to
install my files to a directory under "the parent" of  INSTALLDIR (a sibling
of INSTALLDIR).

My initial thought was to get the value of [INSTALLDIR], locate its parent,
then create my dir structure from there. This sounds very simple but quite
hard to achieve.

Any helpful idea is greatly appreciated.

Thanks.
------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Craig Miller-6

Re: Modify INSTALLDIR using custom action?

Reply Threaded More More options
Print post
Permalink
Try "[INSTALLDIR]..\siblingdir\"



> -----Original Message-----
> From: Hoang Le [mailto:[hidden email]]
> Sent: Thursday, October 22, 2009 3:02 PM
> To: General discussion for Windows Installer XML toolset.
> Subject: [WiX-users] Modify INSTALLDIR using custom action?
>
> Hi,
>
> My merge module receives an INSTALLDIR value passed in by a parent project
> (which I have no control over), and the requirement is that I have to
> install my files to a directory under "the parent" of  INSTALLDIR (a
sibling
> of INSTALLDIR).
>
> My initial thought was to get the value of [INSTALLDIR], locate its
parent,
> then create my dir structure from there. This sounds very simple but quite
> hard to achieve.
>
> Any helpful idea is greatly appreciated.
>
> Thanks.
>
----------------------------------------------------------------------------
--
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Harry Lee

Re: Modify INSTALLDIR using custom action?

Reply Threaded More More options
Print post
Permalink
Thanks Craig, I've tried this before and the compiler doesn't seem to like
the ".."

My code somehow like this

<Directory Id="TARGETDIR" Name="SourceDir">
          <Directory Id ="INSTALLDIR">
              <Directory Id="MYDIR" Name="[INSTALLDIR]..\MyInstallDir" />
          </Directory>
</Directory>

Here is the error:

----------- error CNDL0027: The Directory/@Name attribute's value,
'[INSTALLDIR]..\MyInstallDir', is not a valid long name because it contains
illegal characters.  Legal long names contain no more than 260 characters
and must contain at least one non-period
character.  Any character except for the follow may be used: \ ? | > < : / *
". ----------------------------


On Thu, Oct 22, 2009 at 3:08 PM, Craig Miller <[hidden email]
> wrote:

> Try "[INSTALLDIR]..\siblingdir\"
>
>
>
> > -----Original Message-----
> > From: Hoang Le [mailto:[hidden email]]
> > Sent: Thursday, October 22, 2009 3:02 PM
> > To: General discussion for Windows Installer XML toolset.
> > Subject: [WiX-users] Modify INSTALLDIR using custom action?
> >
> > Hi,
> >
> > My merge module receives an INSTALLDIR value passed in by a parent
> project
> > (which I have no control over), and the requirement is that I have to
> > install my files to a directory under "the parent" of  INSTALLDIR (a
> sibling
> > of INSTALLDIR).
> >
> > My initial thought was to get the value of [INSTALLDIR], locate its
> parent,
> > then create my dir structure from there. This sounds very simple but
> quite
> > hard to achieve.
> >
> > Any helpful idea is greatly appreciated.
> >
> > Thanks.
> >
>
> ----------------------------------------------------------------------------
> --
> > 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
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
> ------------------------------------------------------------------------------
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Alexander Shevchuk (Volt)

Re: Modify INSTALLDIR using custom action?

Reply Threaded More More options
Print post
Permalink
You need to use CA Type 35 scheduled after CostFinalize to set MYDIR to whatever you want.

Alex



-----Original Message-----
From: Hoang Le [mailto:[hidden email]]
Sent: Thursday, October 22, 2009 3:44 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Modify INSTALLDIR using custom action?

Thanks Craig, I've tried this before and the compiler doesn't seem to like
the ".."

My code somehow like this

<Directory Id="TARGETDIR" Name="SourceDir">
          <Directory Id ="INSTALLDIR">
              <Directory Id="MYDIR" Name="[INSTALLDIR]..\MyInstallDir" />
          </Directory>
</Directory>

Here is the error:

----------- error CNDL0027: The Directory/@Name attribute's value,
'[INSTALLDIR]..\MyInstallDir', is not a valid long name because it contains
illegal characters.  Legal long names contain no more than 260 characters
and must contain at least one non-period
character.  Any character except for the follow may be used: \ ? | > < : / *
". ----------------------------


On Thu, Oct 22, 2009 at 3:08 PM, Craig Miller <[hidden email]
> wrote:

> Try "[INSTALLDIR]..\siblingdir\"
>
>
>
> > -----Original Message-----
> > From: Hoang Le [mailto:[hidden email]]
> > Sent: Thursday, October 22, 2009 3:02 PM
> > To: General discussion for Windows Installer XML toolset.
> > Subject: [WiX-users] Modify INSTALLDIR using custom action?
> >
> > Hi,
> >
> > My merge module receives an INSTALLDIR value passed in by a parent
> project
> > (which I have no control over), and the requirement is that I have to
> > install my files to a directory under "the parent" of  INSTALLDIR (a
> sibling
> > of INSTALLDIR).
> >
> > My initial thought was to get the value of [INSTALLDIR], locate its
> parent,
> > then create my dir structure from there. This sounds very simple but
> quite
> > hard to achieve.
> >
> > Any helpful idea is greatly appreciated.
> >
> > Thanks.
> >
>
> ----------------------------------------------------------------------------
> --
> > 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
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
> ------------------------------------------------------------------------------
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Harry Lee

Re: Modify INSTALLDIR using custom action?

Reply Threaded More More options
Print post
Permalink
Thanks Alex, I learnt from your blog that CA Type 35 scheduled after
CostFinalize can be used to set MYDIR.

However, the issue is that [INSTALLDIR] passed in by the parent project
could be anywhere (user input), so I don't know it in advance. So it comes
back to the question how I can walk up to the parent directory and create my
directory structure from there.

Here what I have:

--------------------------------------------Place holder for MYDIR
-------------------------------------------------------------------
<Directory Id="TARGETDIR" Name="SourceDir">
         <Directory Id="INSTALLDIR"  />
         <Directory Id="MYDIR" Name="." />
</Directory>

and the CA is:

----------------------------------------------Custom Action
-----------------------------------------------------------------
<CustomAction Id="SetMyDirPath"
                    Directory="MYDIR"
                    Value="[INSTALLDIR]\..\My folder" />

 <InstallExecuteSequence>
        <Custom Action="SetMyDirPath" After="CostFinalize">Not
Installed</Custom>
</InstallExecuteSequence>
---------------------------------------------------------------------------------------------------------------

The compiler would complain about the ".." again, something like: Error
1324. The folder path '..' contains an invalid character.



On Thu, Oct 22, 2009 at 3:57 PM, Alexander Shevchuk (Volt) <
[hidden email]> wrote:

> You need to use CA Type 35 scheduled after CostFinalize to set MYDIR to
> whatever you want.
>
> Alex
>
>
>
> -----Original Message-----
> From: Hoang Le [mailto:[hidden email]]
> Sent: Thursday, October 22, 2009 3:44 PM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Modify INSTALLDIR using custom action?
>
> Thanks Craig, I've tried this before and the compiler doesn't seem to like
> the ".."
>
> My code somehow like this
>
> <Directory Id="TARGETDIR" Name="SourceDir">
>          <Directory Id ="INSTALLDIR">
>              <Directory Id="MYDIR" Name="[INSTALLDIR]..\MyInstallDir" />
>          </Directory>
> </Directory>
>
> Here is the error:
>
> ----------- error CNDL0027: The Directory/@Name attribute's value,
> '[INSTALLDIR]..\MyInstallDir', is not a valid long name because it contains
> illegal characters.  Legal long names contain no more than 260 characters
> and must contain at least one non-period
> character.  Any character except for the follow may be used: \ ? | > < : /
> *
> ". ----------------------------
>
>
> On Thu, Oct 22, 2009 at 3:08 PM, Craig Miller <
> [hidden email]
> > wrote:
>
> > Try "[INSTALLDIR]..\siblingdir\"
> >
> >
> >
> > > -----Original Message-----
> > > From: Hoang Le [mailto:[hidden email]]
> > > Sent: Thursday, October 22, 2009 3:02 PM
> > > To: General discussion for Windows Installer XML toolset.
> > > Subject: [WiX-users] Modify INSTALLDIR using custom action?
> > >
> > > Hi,
> > >
> > > My merge module receives an INSTALLDIR value passed in by a parent
> > project
> > > (which I have no control over), and the requirement is that I have to
> > > install my files to a directory under "the parent" of  INSTALLDIR (a
> > sibling
> > > of INSTALLDIR).
> > >
> > > My initial thought was to get the value of [INSTALLDIR], locate its
> > parent,
> > > then create my dir structure from there. This sounds very simple but
> > quite
> > > hard to achieve.
> > >
> > > Any helpful idea is greatly appreciated.
> > >
> > > Thanks.
> > >
> >
> >
> ----------------------------------------------------------------------------
> > --
> > > 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
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > 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
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
>
> ------------------------------------------------------------------------------
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
> ------------------------------------------------------------------------------
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Blair-2

Re: Modify INSTALLDIR using custom action?

Reply Threaded More More options
Print post
Permalink
Normally the INSTALLDIR passed to a mergemodule is where the package author
wants the merge module's content to be. Your requirement seems to indicate
that you are not allowed to communicate to the package author what directory
they are supposed to supply to you when performing the merge.

If you truly cannot "fix" this via documentation then you will need some
sort of custom action that can take a property who's value represents a path
and return the parent directory (ending in a back-slash), which you will
declare as the parent of the directory where you really will install your
content.

-----Original Message-----
From: Hoang Le [mailto:[hidden email]]
Sent: Friday, October 23, 2009 12:11 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Modify INSTALLDIR using custom action?

Thanks Alex, I learnt from your blog that CA Type 35 scheduled after
CostFinalize can be used to set MYDIR.

However, the issue is that [INSTALLDIR] passed in by the parent project
could be anywhere (user input), so I don't know it in advance. So it comes
back to the question how I can walk up to the parent directory and create my
directory structure from there.

Here what I have:

--------------------------------------------Place holder for MYDIR
-------------------------------------------------------------------
<Directory Id="TARGETDIR" Name="SourceDir">
         <Directory Id="INSTALLDIR"  />
         <Directory Id="MYDIR" Name="." />
</Directory>

and the CA is:

----------------------------------------------Custom Action
-----------------------------------------------------------------
<CustomAction Id="SetMyDirPath"
                    Directory="MYDIR"
                    Value="[INSTALLDIR]\..\My folder" />

 <InstallExecuteSequence>
        <Custom Action="SetMyDirPath" After="CostFinalize">Not
Installed</Custom>
</InstallExecuteSequence>
----------------------------------------------------------------------------
-----------------------------------

The compiler would complain about the ".." again, something like: Error
1324. The folder path '..' contains an invalid character.



On Thu, Oct 22, 2009 at 3:57 PM, Alexander Shevchuk (Volt) <
[hidden email]> wrote:

> You need to use CA Type 35 scheduled after CostFinalize to set MYDIR to
> whatever you want.
>
> Alex
>
>
>
> -----Original Message-----
> From: Hoang Le [mailto:[hidden email]]
> Sent: Thursday, October 22, 2009 3:44 PM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Modify INSTALLDIR using custom action?
>
> Thanks Craig, I've tried this before and the compiler doesn't seem to like
> the ".."
>
> My code somehow like this
>
> <Directory Id="TARGETDIR" Name="SourceDir">
>          <Directory Id ="INSTALLDIR">
>              <Directory Id="MYDIR" Name="[INSTALLDIR]..\MyInstallDir" />
>          </Directory>
> </Directory>
>
> Here is the error:
>
> ----------- error CNDL0027: The Directory/@Name attribute's value,
> '[INSTALLDIR]..\MyInstallDir', is not a valid long name because it
contains

> illegal characters.  Legal long names contain no more than 260 characters
> and must contain at least one non-period
> character.  Any character except for the follow may be used: \ ? | > < : /
> *
> ". ----------------------------
>
>
> On Thu, Oct 22, 2009 at 3:08 PM, Craig Miller <
> [hidden email]
> > wrote:
>
> > Try "[INSTALLDIR]..\siblingdir\"
> >
> >
> >
> > > -----Original Message-----
> > > From: Hoang Le [mailto:[hidden email]]
> > > Sent: Thursday, October 22, 2009 3:02 PM
> > > To: General discussion for Windows Installer XML toolset.
> > > Subject: [WiX-users] Modify INSTALLDIR using custom action?
> > >
> > > Hi,
> > >
> > > My merge module receives an INSTALLDIR value passed in by a parent
> > project
> > > (which I have no control over), and the requirement is that I have to
> > > install my files to a directory under "the parent" of  INSTALLDIR (a
> > sibling
> > > of INSTALLDIR).
> > >
> > > My initial thought was to get the value of [INSTALLDIR], locate its
> > parent,
> > > then create my dir structure from there. This sounds very simple but
> > quite
> > > hard to achieve.
> > >
> > > Any helpful idea is greatly appreciated.
> > >
> > > Thanks.
> > >
> >
> >
>
----------------------------------------------------------------------------

> > --
> > > 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
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> >
> >
> >
>
----------------------------------------------------------------------------
--
> > 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
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
>
>
----------------------------------------------------------------------------
--

> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
>
----------------------------------------------------------------------------
--

> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
----------------------------------------------------------------------------
--
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Armin Linder-2

WiX Editor: Preset the "Use custom commandline for light.exe" setting

Reply Threaded More More options
Print post
Permalink
Hi all,

for my installers I du almost always need the -cultures switch.
Unfortunately the WiX Editor does not remeber this if closed. Does
anyone know wether it is possible to change the default command line
options for light.exe?

Thanks

Armin.

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Rob Mensching-7

Re: WiX Editor: Preset the "Use custom commandline for light.exe" setting

Reply Threaded More More options
Print post
Permalink
Which WiX Editor do you mean? If it's the Visual Studio plug-in (commonly
referred to as Votive) then please open a bug if this setting is not being
remembered.  If it's a different WiX Editor then you'd need to follow up
with the owner of the tool because I don't think it is part of the WiX
toolset.

On Tue, Oct 27, 2009 at 2:37 PM, Armin Linder <[hidden email]>wrote:

> Hi all,
>
> for my installers I du almost always need the -cultures switch.
> Unfortunately the WiX Editor does not remeber this if closed. Does
> anyone know wether it is possible to change the default command line
> options for light.exe?
>
> Thanks
>
> Armin.
>
>
> ------------------------------------------------------------------------------
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>


--
virtually, Rob Mensching - http://RobMensching.com LLC
------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Harry Lee

Re: Modify INSTALLDIR using custom action?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Blair-2
Thanks Blair, you're right, since I can't communicate with the package
author, I only have a choice to create a custom action that can modify
INSTALLDIR.

And I have the following:
----------------------------------------------------------------------------------------------------------------------------------------------------------
+++  My directory structure:

     <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="MYDIR" Name="My Directory"/>
      </Directory>

+++  My custom action:

  <CustomAction Id="SetMyMergeModulePath" Script="vbscript">
        <![CDATA[
          ' code to modify Session.Property("INSTALLDIR") to its parent
        ]]>
   </CustomAction>

+++
   <InstallExecuteSequence>
        <Custom Action="SetMyMergeModulePath" Before="CostInitialize" >NOT
Installed</Custom>
   </InstallExecuteSequence>

----------------------------------------------------------------------------------------------------------------------------------------------------------

And it works with INSTALLDIR suplied from the command line installation
[msiexec ......INSTALLDIR ="...." ], which is good.

However it doesn't work if I enter INSTALLDIR from the UI.

The log show that MYDIR value is set right after INSTALLDIR is entered the
the UI dialog, even after that my custom action does actually modify
INSTALLDIR, its change does not help any more because MYDIR is already set
with the old INSTALLDIR.


I tried to modify MYDIR using another custom action, but modifying using
VBScripts through Session.Property("MYDIR") actually adds another MYDIR
property not the MYDIR of my merge module. Using custom action 35 to set
MYDIR after changing the INSTALLDIR like:

 <CustomAction Id="SetMyDirPath"
              Directory="MYDIR"
              Value="[INSTALLDIR]\something " />

then it doesn't get [INSTALLDIR] (passed in empty)


I am so confused :)

Regards,

On Mon, Oct 26, 2009 at 7:56 PM, Blair <[hidden email]> wrote:

> Normally the INSTALLDIR passed to a mergemodule is where the package author
> wants the merge module's content to be. Your requirement seems to indicate
> that you are not allowed to communicate to the package author what
> directory
> they are supposed to supply to you when performing the merge.
>
> If you truly cannot "fix" this via documentation then you will need some
> sort of custom action that can take a property who's value represents a
> path
> and return the parent directory (ending in a back-slash), which you will
> declare as the parent of the directory where you really will install your
> content.
>
> -----Original Message-----
> From: Hoang Le [mailto:[hidden email]]
> Sent: Friday, October 23, 2009 12:11 PM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Modify INSTALLDIR using custom action?
>
> Thanks Alex, I learnt from your blog that CA Type 35 scheduled after
> CostFinalize can be used to set MYDIR.
>
> However, the issue is that [INSTALLDIR] passed in by the parent project
> could be anywhere (user input), so I don't know it in advance. So it comes
> back to the question how I can walk up to the parent directory and create
> my
> directory structure from there.
>
> Here what I have:
>
> --------------------------------------------Place holder for MYDIR
> -------------------------------------------------------------------
> <Directory Id="TARGETDIR" Name="SourceDir">
>         <Directory Id="INSTALLDIR"  />
>         <Directory Id="MYDIR" Name="." />
> </Directory>
>
> and the CA is:
>
> ----------------------------------------------Custom Action
> -----------------------------------------------------------------
> <CustomAction Id="SetMyDirPath"
>                    Directory="MYDIR"
>                    Value="[INSTALLDIR]\..\My folder" />
>
>  <InstallExecuteSequence>
>        <Custom Action="SetMyDirPath" After="CostFinalize">Not
> Installed</Custom>
> </InstallExecuteSequence>
>
> ----------------------------------------------------------------------------
> -----------------------------------
>
> The compiler would complain about the ".." again, something like: Error
> 1324. The folder path '..' contains an invalid character.
>
>
>
> On Thu, Oct 22, 2009 at 3:57 PM, Alexander Shevchuk (Volt) <
> [hidden email]> wrote:
>
> > You need to use CA Type 35 scheduled after CostFinalize to set MYDIR to
> > whatever you want.
> >
> > Alex
> >
> >
> >
> > -----Original Message-----
> > From: Hoang Le [mailto:[hidden email]]
> > Sent: Thursday, October 22, 2009 3:44 PM
> > To: General discussion for Windows Installer XML toolset.
> > Subject: Re: [WiX-users] Modify INSTALLDIR using custom action?
> >
> > Thanks Craig, I've tried this before and the compiler doesn't seem to
> like
> > the ".."
> >
> > My code somehow like this
> >
> > <Directory Id="TARGETDIR" Name="SourceDir">
> >          <Directory Id ="INSTALLDIR">
> >              <Directory Id="MYDIR" Name="[INSTALLDIR]..\MyInstallDir" />
> >          </Directory>
> > </Directory>
> >
> > Here is the error:
> >
> > ----------- error CNDL0027: The Directory/@Name attribute's value,
> > '[INSTALLDIR]..\MyInstallDir', is not a valid long name because it
> contains
> > illegal characters.  Legal long names contain no more than 260 characters
> > and must contain at least one non-period
> > character.  Any character except for the follow may be used: \ ? | > < :
> /
> > *
> > ". ----------------------------
> >
> >
> > On Thu, Oct 22, 2009 at 3:08 PM, Craig Miller <
> > [hidden email]
> > > wrote:
> >
> > > Try "[INSTALLDIR]..\siblingdir\"
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Hoang Le [mailto:[hidden email]]
> > > > Sent: Thursday, October 22, 2009 3:02 PM
> > > > To: General discussion for Windows Installer XML toolset.
> > > > Subject: [WiX-users] Modify INSTALLDIR using custom action?
> > > >
> > > > Hi,
> > > >
> > > > My merge module receives an INSTALLDIR value passed in by a parent
> > > project
> > > > (which I have no control over), and the requirement is that I have to
> > > > install my files to a directory under "the parent" of  INSTALLDIR (a
> > > sibling
> > > > of INSTALLDIR).
> > > >
> > > > My initial thought was to get the value of [INSTALLDIR], locate its
> > > parent,
> > > > then create my dir structure from there. This sounds very simple but
> > > quite
> > > > hard to achieve.
> > > >
> > > > Any helpful idea is greatly appreciated.
> > > >
> > > > Thanks.
> > > >
> > >
> > >
> >
>
> ----------------------------------------------------------------------------
> > > --
> > > > 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
> > > > [hidden email]
> > > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > >
> > >
> > >
> > >
> >
>
> ----------------------------------------------------------------------------
> --
> > > 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
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > >
> >
> >
>
> ----------------------------------------------------------------------------
> --
> > 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
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> >
> >
> >
>
> ----------------------------------------------------------------------------
> --
> > 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
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
>
> ----------------------------------------------------------------------------
> --
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
> ------------------------------------------------------------------------------
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Blair-2

Re: Modify INSTALLDIR using custom action?

Reply Threaded More More options
Print post
Permalink
The directory paths are evaluated in both InstallExecuteSequence as well as
InstallUISequence. You should schedule your SetMyMergeModulePath CA in both
sequences as well.

-----Original Message-----
From: Hoang Le [mailto:[hidden email]]
Sent: Friday, October 30, 2009 3:35 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Modify INSTALLDIR using custom action?

Thanks Blair, you're right, since I can't communicate with the package
author, I only have a choice to create a custom action that can modify
INSTALLDIR.

And I have the following:
----------------------------------------------------------------------------
----------------------------------------------------------------------------
--
+++  My directory structure:

     <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="MYDIR" Name="My Directory"/>
      </Directory>

+++  My custom action:

  <CustomAction Id="SetMyMergeModulePath" Script="vbscript">
        <![CDATA[
          ' code to modify Session.Property("INSTALLDIR") to its parent
        ]]>
   </CustomAction>

+++
   <InstallExecuteSequence>
        <Custom Action="SetMyMergeModulePath" Before="CostInitialize" >NOT
Installed</Custom>
   </InstallExecuteSequence>

----------------------------------------------------------------------------
----------------------------------------------------------------------------
--

And it works with INSTALLDIR suplied from the command line installation
[msiexec ......INSTALLDIR ="...." ], which is good.

However it doesn't work if I enter INSTALLDIR from the UI.

The log show that MYDIR value is set right after INSTALLDIR is entered the
the UI dialog, even after that my custom action does actually modify
INSTALLDIR, its change does not help any more because MYDIR is already set
with the old INSTALLDIR.


I tried to modify MYDIR using another custom action, but modifying using
VBScripts through Session.Property("MYDIR") actually adds another MYDIR
property not the MYDIR of my merge module. Using custom action 35 to set
MYDIR after changing the INSTALLDIR like:

 <CustomAction Id="SetMyDirPath"
              Directory="MYDIR"
              Value="[INSTALLDIR]\something " />

then it doesn't get [INSTALLDIR] (passed in empty)


I am so confused :)

Regards,

On Mon, Oct 26, 2009 at 7:56 PM, Blair <[hidden email]> wrote:

> Normally the INSTALLDIR passed to a mergemodule is where the package
author

> wants the merge module's content to be. Your requirement seems to indicate
> that you are not allowed to communicate to the package author what
> directory
> they are supposed to supply to you when performing the merge.
>
> If you truly cannot "fix" this via documentation then you will need some
> sort of custom action that can take a property who's value represents a
> path
> and return the parent directory (ending in a back-slash), which you will
> declare as the parent of the directory where you really will install your
> content.
>
> -----Original Message-----
> From: Hoang Le [mailto:[hidden email]]
> Sent: Friday, October 23, 2009 12:11 PM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Modify INSTALLDIR using custom action?
>
> Thanks Alex, I learnt from your blog that CA Type 35 scheduled after
> CostFinalize can be used to set MYDIR.
>
> However, the issue is that [INSTALLDIR] passed in by the parent project
> could be anywhere (user input), so I don't know it in advance. So it comes
> back to the question how I can walk up to the parent directory and create
> my
> directory structure from there.
>
> Here what I have:
>
> --------------------------------------------Place holder for MYDIR
> -------------------------------------------------------------------
> <Directory Id="TARGETDIR" Name="SourceDir">
>         <Directory Id="INSTALLDIR"  />
>         <Directory Id="MYDIR" Name="." />
> </Directory>
>
> and the CA is:
>
> ----------------------------------------------Custom Action
> -----------------------------------------------------------------
> <CustomAction Id="SetMyDirPath"
>                    Directory="MYDIR"
>                    Value="[INSTALLDIR]\..\My folder" />
>
>  <InstallExecuteSequence>
>        <Custom Action="SetMyDirPath" After="CostFinalize">Not
> Installed</Custom>
> </InstallExecuteSequence>
>
>
----------------------------------------------------------------------------

> -----------------------------------
>
> The compiler would complain about the ".." again, something like: Error
> 1324. The folder path '..' contains an invalid character.
>
>
>
> On Thu, Oct 22, 2009 at 3:57 PM, Alexander Shevchuk (Volt) <
> [hidden email]> wrote:
>
> > You need to use CA Type 35 scheduled after CostFinalize to set MYDIR to
> > whatever you want.
> >
> > Alex
> >
> >
> >
> > -----Original Message-----
> > From: Hoang Le [mailto:[hidden email]]
> > Sent: Thursday, October 22, 2009 3:44 PM
> > To: General discussion for Windows Installer XML toolset.
> > Subject: Re: [WiX-users] Modify INSTALLDIR using custom action?
> >
> > Thanks Craig, I've tried this before and the compiler doesn't seem to
> like
> > the ".."
> >
> > My code somehow like this
> >
> > <Directory Id="TARGETDIR" Name="SourceDir">
> >          <Directory Id ="INSTALLDIR">
> >              <Directory Id="MYDIR" Name="[INSTALLDIR]..\MyInstallDir" />
> >          </Directory>
> > </Directory>
> >
> > Here is the error:
> >
> > ----------- error CNDL0027: The Directory/@Name attribute's value,
> > '[INSTALLDIR]..\MyInstallDir', is not a valid long name because it
> contains
> > illegal characters.  Legal long names contain no more than 260
characters

> > and must contain at least one non-period
> > character.  Any character except for the follow may be used: \ ? | > < :
> /
> > *
> > ". ----------------------------
> >
> >
> > On Thu, Oct 22, 2009 at 3:08 PM, Craig Miller <
> > [hidden email]
> > > wrote:
> >
> > > Try "[INSTALLDIR]..\siblingdir\"
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Hoang Le [mailto:[hidden email]]
> > > > Sent: Thursday, October 22, 2009 3:02 PM
> > > > To: General discussion for Windows Installer XML toolset.
> > > > Subject: [WiX-users] Modify INSTALLDIR using custom action?
> > > >
> > > > Hi,
> > > >
> > > > My merge module receives an INSTALLDIR value passed in by a parent
> > > project
> > > > (which I have no control over), and the requirement is that I have
to

> > > > install my files to a directory under "the parent" of  INSTALLDIR (a
> > > sibling
> > > > of INSTALLDIR).
> > > >
> > > > My initial thought was to get the value of [INSTALLDIR], locate its
> > > parent,
> > > > then create my dir structure from there. This sounds very simple but
> > > quite
> > > > hard to achieve.
> > > >
> > > > Any helpful idea is greatly appreciated.
> > > >
> > > > Thanks.
> > > >
> > >
> > >
> >
>
>
----------------------------------------------------------------------------
> > > --
> > > > 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
> > > > [hidden email]
> > > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > >
> > >
> > >
> > >
> >
>
>
----------------------------------------------------------------------------

> --
> > > 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
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > >
> >
> >
>
>
----------------------------------------------------------------------------
> --
> > 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
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> >
> >
> >
>
>
----------------------------------------------------------------------------
> --
> > 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
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
>
>
----------------------------------------------------------------------------

> --
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
>
----------------------------------------------------------------------------
--

> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
----------------------------------------------------------------------------
--
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users