Discussion:
[WiX-users] Accessing Source directory in Deferred Custom Action (ApDataFolder etc. is working, just not SourceDir)
d***@noser.com
2010-07-13 15:24:06 UTC
Permalink
Hi

I would like to access the "SourceDir" property in a deferred custom action. While i can access other directories via the CustomAction property (see example below). The SourceDir ActionData remains empty. I must be doing something wrong. I sure it's something silly, that only a wix newby can stumble over.

Any help appreciated.
Thanks

My sample code:


<InstallExecuteSequence>

<Custom Action="TestCA.SetProperty" After="InstallInitialize"/>

<Custom Action="TestCA" After="TestCA.SetProperty"/>

</InstallExecuteSequence>



<CustomAction Id="TestCA.SetProperty" Return="check"

Property="TestCA" Value="SourceDir=[SourceDir];INSTALLDIR=[INSTALLDIR];AppDataFolder=[AppDataFolder]">

</CustomAction>

<CustomAction Id="TestCA" BinaryKey="CustomActionDll" DllEntry="TestMethod" Impersonate="no" Execute="deferred" Return="check">

</CustomAction>





In the C# code:



[CustomAction]

public static ActionResult TestMethod(Session session)

{

session.Log("CustomAction TestMethod called!");

.



try{

// empty

string showMe = session.CustomActionData["SourceDir"];



// working, path

string showMe = session.CustomActionData["AppDataFolder"];
Blair
2010-07-13 16:34:56 UTC
Permalink
In a verbose installation log, what is the resulting value of the TestCA
property?

-----Original Message-----
From: ***@noser.com [mailto:***@noser.com]
Sent: Tuesday, July 13, 2010 8:24 AM
To: wix-***@lists.sourceforge.net
Subject: [WiX-users] Accessing Source directory in Deferred Custom Action
(ApDataFolder etc. is working, just not SourceDir)

Hi

I would like to access the "SourceDir" property in a deferred custom action.
While i can access other directories via the CustomAction property (see
example below). The SourceDir ActionData remains empty. I must be doing
something wrong. I sure it's something silly, that only a wix newby can
stumble over.

Any help appreciated.
Thanks

My sample code:


<InstallExecuteSequence>

<Custom Action="TestCA.SetProperty" After="InstallInitialize"/>

<Custom Action="TestCA" After="TestCA.SetProperty"/>

</InstallExecuteSequence>



<CustomAction Id="TestCA.SetProperty" Return="check"

Property="TestCA"
Value="SourceDir=[SourceDir];INSTALLDIR=[INSTALLDIR];AppDataFolder=[AppDataF
older]">

</CustomAction>

<CustomAction Id="TestCA" BinaryKey="CustomActionDll" DllEntry="TestMethod"
Impersonate="no" Execute="deferred" Return="check">

</CustomAction>





In the C# code:



[CustomAction]

public static ActionResult TestMethod(Session session)

{

session.Log("CustomAction TestMethod called!");

.



try{

// empty

string showMe = session.CustomActionData["SourceDir"];



// working, path

string showMe = session.CustomActionData["AppDataFolder"];
----------------------------------------------------------------------------
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
d***@noser.com
2010-07-14 06:48:27 UTC
Permalink
Hi

Thanks for your answer.
d***@noser.com
2010-07-14 08:11:39 UTC
Permalink
Hi

Since I haven't managed to assign the [SourceDir] value to a customAction Data Property, i tried to assign the data assign the value to a property and then assign that property to the a customAction. However, no success, the assigned property is empty. I am sure it is a simple syntax thing but i cant figure out the solution :-(

Here is what i did:
<Property Id="TestProp" Value="[SourceDir]" />
<SetProperty Id="TestProp" After="CostFinalize" Sequence="execute" Value="[SourceDir]" />

<InstallExecuteSequence>
<Custom Action="TestCA.SetProperty" After="InstallInitialize"/>
<Custom Action="TestCA" After="TestCA.SetProperty"/>
</InstallExecuteSequence>

<CustomAction Id="TestCA.SetProperty" Return="check"
Property="TestCA"
Value="TestingCAD=[TestProp];INSTALLDIR=[INSTALLDIR];AppDataFolder=[AppDataF
older]">
</CustomAction>
<CustomAction Id="TestCA" BinaryKey="CustomActionDll" DllEntry="TestMethod"
Impersonate="no" Execute="deferred" Return="check">
</CustomAction>

Still no success. :-(

I have found a workaround to set a property but thats something i want to avoid at any cost:

1. Define property "DUMMYPROPERTY"
2. Set property in C# custom action: session["DUMMYPROPERTY"] = "i get assigned, jabadabadu";
3. Assign property to custom action data (as above)

So I am 100% sure that the syntax i use for the SourceDir property is wrong. It must be something simple.
I am grateful for any help.

Thanks


________________________________________
Von: Blair [***@live.com]
Gesendet: Dienstag, 13. Juli 2010 18:34
An: 'General discussion for Windows Installer XML toolset.'
Betreff: Re: [WiX-users] Accessing Source directory in Deferred Custom Action (ApDataFolder etc. is working, just not SourceDir)

In a verbose installation log, what is the resulting value of the TestCA
property?

-----Original Message-----
From: ***@noser.com [mailto:***@noser.com]
Sent: Tuesday, July 13, 2010 8:24 AM
To: wix-***@lists.sourceforge.net
Subject: [WiX-users] Accessing Source directory in Deferred Custom Action
(ApDataFolder etc. is working, just not SourceDir)

Hi

I would like to access the "SourceDir" property in a deferred custom action.
While i can access other directories via the CustomAction property (see
example below). The SourceDir ActionData remains empty. I must be doing
something wrong. I sure it's something silly, that only a wix newby can
stumble over.

Any help appreciated.
Thanks

My sample code:


<InstallExecuteSequence>

<Custom Action="TestCA.SetProperty" After="InstallInitialize"/>

<Custom Action="TestCA" After="TestCA.SetProperty"/>

</InstallExecuteSequence>



<CustomAction Id="TestCA.SetProperty" Return="check"

Property="TestCA"
Value="SourceDir=[SourceDir];INSTALLDIR=[INSTALLDIR];AppDataFolder=[AppDataF
older]">

</CustomAction>

<CustomAction Id="TestCA" BinaryKey="CustomActionDll" DllEntry="TestMethod"
Impersonate="no" Execute="deferred" Return="check">

</CustomAction>





In the C# code:



[CustomAction]

public static ActionResult TestMethod(Session session)

{

session.Log("CustomAction TestMethod called!");

.



try{

// empty

string showMe = session.CustomActionData["SourceDir"];



// working, path

string showMe = session.CustomActionData["AppDataFolder"];
----------------------------------------------------------------------------
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
d***@noser.com
2010-07-14 08:53:52 UTC
Permalink
Hi

I still havent figured out how to solve my issue, but i have found a couple of other aspects. As it seems, the built in property: [SourceDir] is, depending at the time of exeuction, sometimes empty. In the execute sequence, if i use a immediate custom action, scheduled after InstallInitialize, the property "SourceDir" is empty (in C#: session["SourceDir"]) . The log also states that the property is deleted, however, recreated afterwards.

I start to believe that this is the reason why I have been struggling accessing the property in a deferred custom action. Is it not possible to access this property in the execute sequence? Or what would I have to do?

Greetings


(PS: by the way, the workaround in my prior mail does not work because the SourceDir property is not set. Sorry for precipitating)




________________________________________
Von: ***@noser.com [***@noser.com]
Gesendet: Mittwoch, 14. Juli 2010 10:11
An: wix-***@lists.sourceforge.net
Betreff: Re: [WiX-users] Accessing Source directory in Deferred Custom Action (ApDataFolder etc. is working, just not SourceDir)

Hi

Since I haven't managed to assign the [SourceDir] value to a customAction Data Property, i tried to assign the data assign the value to a property and then assign that property to the a customAction. However, no success, the assigned property is empty. I am sure it is a simple syntax thing but i cant figure out the solution :-(

Here is what i did:
<Property Id="TestProp" Value="[SourceDir]" />
<SetProperty Id="TestProp" After="CostFinalize" Sequence="execute" Value="[SourceDir]" />

<InstallExecuteSequence>
<Custom Action="TestCA.SetProperty" After="InstallInitialize"/>
<Custom Action="TestCA" After="TestCA.SetProperty"/>
</InstallExecuteSequence>

<CustomAction Id="TestCA.SetProperty" Return="check"
Property="TestCA"
Value="TestingCAD=[TestProp];INSTALLDIR=[INSTALLDIR];AppDataFolder=[AppDataF
older]">
</CustomAction>
<CustomAction Id="TestCA" BinaryKey="CustomActionDll" DllEntry="TestMethod"
Impersonate="no" Execute="deferred" Return="check">
</CustomAction>

Still no success. :-(

I have found a workaround to set a property but thats something i want to avoid at any cost:

1. Define property "DUMMYPROPERTY"
2. Set property in C# custom action: session["DUMMYPROPERTY"] = "i get assigned, jabadabadu";
3. Assign property to custom action data (as above)

So I am 100% sure that the syntax i use for the SourceDir property is wrong. It must be something simple.
I am grateful for any help.

Thanks


________________________________________
Von: Blair [***@live.com]
Gesendet: Dienstag, 13. Juli 2010 18:34
An: 'General discussion for Windows Installer XML toolset.'
Betreff: Re: [WiX-users] Accessing Source directory in Deferred Custom Action (ApDataFolder etc. is working, just not SourceDir)

In a verbose installation log, what is the resulting value of the TestCA
property?

-----Original Message-----
From: ***@noser.com [mailto:***@noser.com]
Sent: Tuesday, July 13, 2010 8:24 AM
To: wix-***@lists.sourceforge.net
Subject: [WiX-users] Accessing Source directory in Deferred Custom Action
(ApDataFolder etc. is working, just not SourceDir)

Hi

I would like to access the "SourceDir" property in a deferred custom action.
While i can access other directories via the CustomAction property (see
example below). The SourceDir ActionData remains empty. I must be doing
something wrong. I sure it's something silly, that only a wix newby can
stumble over.

Any help appreciated.
Thanks

My sample code:


<InstallExecuteSequence>

<Custom Action="TestCA.SetProperty" After="InstallInitialize"/>

<Custom Action="TestCA" After="TestCA.SetProperty"/>

</InstallExecuteSequence>



<CustomAction Id="TestCA.SetProperty" Return="check"

Property="TestCA"
Value="SourceDir=[SourceDir];INSTALLDIR=[INSTALLDIR];AppDataFolder=[AppDataF
older]">

</CustomAction>

<CustomAction Id="TestCA" BinaryKey="CustomActionDll" DllEntry="TestMethod"
Impersonate="no" Execute="deferred" Return="check">

</CustomAction>





In the C# code:



[CustomAction]

public static ActionResult TestMethod(Session session)

{

session.Log("CustomAction TestMethod called!");

.



try{

// empty

string showMe = session.CustomActionData["SourceDir"];



// working, path

string showMe = session.CustomActionData["AppDataFolder"];
----------------------------------------------------------------------------
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
Dan Vasilov
2010-07-14 09:21:04 UTC
Permalink
The SourceDir is set by ResolveSource. The actions using this property
should be scheduled after this action (see
http://msdn.microsoft.com/en-us/library/aa371857(VS.85).aspx).


-----Original Message-----
From: ***@noser.com [mailto:***@noser.com]
Sent: Wednesday, July 14, 2010 11:54 AM
To: wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] Accessing Source directory in Deferred Custom
Action (ApDataFolder etc. is working, just not SourceDir)

Hi

I still havent figured out how to solve my issue, but i have found a couple
of other aspects. As it seems, the built in property: [SourceDir] is,
depending at the time of exeuction, sometimes empty. In the execute
sequence, if i use a immediate custom action, scheduled after
InstallInitialize, the property "SourceDir" is empty (in C#:
session["SourceDir"]) . The log also states that the property is deleted,
however, recreated afterwards.

I start to believe that this is the reason why I have been struggling
accessing the property in a deferred custom action. Is it not possible to
access this property in the execute sequence? Or what would I have to do?

Greetings


(PS: by the way, the workaround in my prior mail does not work because the
SourceDir property is not set. Sorry for precipitating)




________________________________________
Von: ***@noser.com [***@noser.com]
Gesendet: Mittwoch, 14. Juli 2010 10:11
An: wix-***@lists.sourceforge.net
Betreff: Re: [WiX-users] Accessing Source directory in Deferred Custom
Action (ApDataFolder etc. is working, just not SourceDir)

Hi

Since I haven't managed to assign the [SourceDir] value to a customAction
Data Property, i tried to assign the data assign the value to a property and
then assign that property to the a customAction. However, no success, the
assigned property is empty. I am sure it is a simple syntax thing but i cant
figure out the solution :-(

Here is what i did:
<Property Id="TestProp" Value="[SourceDir]" />
<SetProperty Id="TestProp" After="CostFinalize" Sequence="execute"
Value="[SourceDir]" />

<InstallExecuteSequence>
<Custom Action="TestCA.SetProperty" After="InstallInitialize"/>
<Custom Action="TestCA" After="TestCA.SetProperty"/>
</InstallExecuteSequence>

<CustomAction Id="TestCA.SetProperty" Return="check"
Property="TestCA"
Value="TestingCAD=[TestProp];INSTALLDIR=[INSTALLDIR];AppDataFolder=[AppDataF
older]">
</CustomAction>
<CustomAction Id="TestCA" BinaryKey="CustomActionDll" DllEntry="TestMethod"
Impersonate="no" Execute="deferred" Return="check">
</CustomAction>

Still no success. :-(

I have found a workaround to set a property but thats something i want to
avoid at any cost:

1. Define property "DUMMYPROPERTY"
2. Set property in C# custom action: session["DUMMYPROPERTY"] = "i get
assigned, jabadabadu";
3. Assign property to custom action data (as above)

So I am 100% sure that the syntax i use for the SourceDir property is wrong.
It must be something simple.
I am grateful for any help.

Thanks


________________________________________
Von: Blair [***@live.com]
Gesendet: Dienstag, 13. Juli 2010 18:34
An: 'General discussion for Windows Installer XML toolset.'
Betreff: Re: [WiX-users] Accessing Source directory in Deferred Custom
Action (ApDataFolder etc. is working, just not SourceDir)

In a verbose installation log, what is the resulting value of the TestCA
property?

-----Original Message-----
From: ***@noser.com [mailto:***@noser.com]
Sent: Tuesday, July 13, 2010 8:24 AM
To: wix-***@lists.sourceforge.net
Subject: [WiX-users] Accessing Source directory in Deferred Custom Action
(ApDataFolder etc. is working, just not SourceDir)

Hi

I would like to access the "SourceDir" property in a deferred custom action.
While i can access other directories via the CustomAction property (see
example below). The SourceDir ActionData remains empty. I must be doing
something wrong. I sure it's something silly, that only a wix newby can
stumble over.

Any help appreciated.
Thanks

My sample code:


<InstallExecuteSequence>

<Custom Action="TestCA.SetProperty" After="InstallInitialize"/>

<Custom Action="TestCA" After="TestCA.SetProperty"/>

</InstallExecuteSequence>



<CustomAction Id="TestCA.SetProperty" Return="check"

Property="TestCA"
Value="SourceDir=[SourceDir];INSTALLDIR=[INSTALLDIR];AppDataFolder=[AppDataF
older]">

</CustomAction>

<CustomAction Id="TestCA" BinaryKey="CustomActionDll" DllEntry="TestMethod"
Impersonate="no" Execute="deferred" Return="check">

</CustomAction>





In the C# code:



[CustomAction]

public static ActionResult TestMethod(Session session)

{

session.Log("CustomAction TestMethod called!");

.



try{

// empty

string showMe = session.CustomActionData["SourceDir"];



// working, path

string showMe = session.CustomActionData["AppDataFolder"];
----------------------------------------------------------------------------
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


----------------------------------------------------------------------------
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
----------------------------------------------------------------------------
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
----------------------------------------------------------------------------
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
d***@noser.com
2010-07-14 09:23:55 UTC
Permalink
Hi and halleluja

I finally managed to access the SourceDir Property in the CustomAction data. The reason i could not access the SourceDir property earlier was simply that I scheduled the customAction to assign the properties to the CustomActiondata to early (It seems UI-sequence and execute sequence are different)

Here is what works:

<InstallExecuteSequence>
<Custom Action="TestCA.SetProperty" After="CreateFolders"/>
<Custom Action="CreateFolders" After="CopyChangingFilesAction.SetProperty"/>
</InstallExecuteSequence>
<CustomAction Id="TestCA.SetProperty" Return="check"
Property="TestCA" Value="SourceDir=[SourceDir];INSTALLDIR=[INSTALLDIR];CommonAppDataFolder=[CommonAppDataFolder]">
</CustomAction>
<CustomAction Id="TestCA" BinaryKey="CustomActionDll" DllEntry="TestMethod" Impersonate="no" Execute="deferred" Return="check">
</CustomAction>


Even though i like some aspectcs of msi (like the declarative approach), it seems to me that it is far more complicated than it could have been. Wix is a good start but - naturally - it cannot fully overcome the msi shortcomings. Or maybe I should have become something else in life

________________________________________
Von: ***@noser.com [***@noser.com]
Gesendet: Mittwoch, 14. Juli 2010 10:11
An: wix-***@lists.sourceforge.net
Betreff: Re: [WiX-users] Accessing Source directory in Deferred Custom Action (ApDataFolder etc. is working, just not SourceDir)

Hi

Since I haven't managed to assign the [SourceDir] value to a customAction Data Property, i tried to assign the data assign the value to a property and then assign that property to the a customAction. However, no success, the assigned property is empty. I am sure it is a simple syntax thing but i cant figure out the solution :-(

Here is what i did:
<Property Id="TestProp" Value="[SourceDir]" />
<SetProperty Id="TestProp" After="CostFinalize" Sequence="execute" Value="[SourceDir]" />

<InstallExecuteSequence>
<Custom Action="TestCA.SetProperty" After="InstallInitialize"/>
<Custom Action="TestCA" After="TestCA.SetProperty"/>
</InstallExecuteSequence>

<CustomAction Id="TestCA.SetProperty" Return="check"
Property="TestCA"
Value="TestingCAD=[TestProp];INSTALLDIR=[INSTALLDIR];AppDataFolder=[AppDataF
older]">
</CustomAction>
<CustomAction Id="TestCA" BinaryKey="CustomActionDll" DllEntry="TestMethod"
Impersonate="no" Execute="deferred" Return="check">
</CustomAction>

Still no success. :-(

I have found a workaround to set a property but thats something i want to avoid at any cost:

1. Define property "DUMMYPROPERTY"
2. Set property in C# custom action: session["DUMMYPROPERTY"] = "i get assigned, jabadabadu";
3. Assign property to custom action data (as above)

So I am 100% sure that the syntax i use for the SourceDir property is wrong. It must be something simple.
I am grateful for any help.

Thanks


________________________________________
Von: Blair [***@live.com]
Gesendet: Dienstag, 13. Juli 2010 18:34
An: 'General discussion for Windows Installer XML toolset.'
Betreff: Re: [WiX-users] Accessing Source directory in Deferred Custom Action (ApDataFolder etc. is working, just not SourceDir)

In a verbose installation log, what is the resulting value of the TestCA
property?

-----Original Message-----
From: ***@noser.com [mailto:***@noser.com]
Sent: Tuesday, July 13, 2010 8:24 AM
To: wix-***@lists.sourceforge.net
Subject: [WiX-users] Accessing Source directory in Deferred Custom Action
(ApDataFolder etc. is working, just not SourceDir)

Hi

I would like to access the "SourceDir" property in a deferred custom action.
While i can access other directories via the CustomAction property (see
example below). The SourceDir ActionData remains empty. I must be doing
something wrong. I sure it's something silly, that only a wix newby can
stumble over.

Any help appreciated.
Thanks

My sample code:


<InstallExecuteSequence>

<Custom Action="TestCA.SetProperty" After="InstallInitialize"/>

<Custom Action="TestCA" After="TestCA.SetProperty"/>

</InstallExecuteSequence>



<CustomAction Id="TestCA.SetProperty" Return="check"

Property="TestCA"
Value="SourceDir=[SourceDir];INSTALLDIR=[INSTALLDIR];AppDataFolder=[AppDataF
older]">

</CustomAction>

<CustomAction Id="TestCA" BinaryKey="CustomActionDll" DllEntry="TestMethod"
Impersonate="no" Execute="deferred" Return="check">

</CustomAction>





In the C# code:



[CustomAction]

public static ActionResult TestMethod(Session session)

{

session.Log("CustomAction TestMethod called!");

.



try{

// empty

string showMe = session.CustomActionData["SourceDir"];



// working, path

string showMe = session.CustomActionData["AppDataFolder"];
----------------------------------------------------------------------------
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
Wilson, Phil
2010-07-14 20:37:20 UTC
Permalink
You need to be careful here because it may not always work. You have impersonate="no" in your custom action so you're running with the local system account. If you get to a situation where somebody is installing your setup from a network share it's unlikely to work because the system account typically has no network access rights, and SourceDir is your MSI file's network location.


Phil Wilson


-----Original Message-----
From: ***@noser.com [mailto:***@noser.com]
Sent: Wednesday, July 14, 2010 2:24 AM
To: wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] Accessing Source directory in Deferred Custom Action (ApDataFolder etc. is working, just not SourceDir)

Hi and halleluja

I finally managed to access the SourceDir Property in the CustomAction data. The reason i could not access the SourceDir property earlier was simply that I scheduled the customAction to assign the properties to the CustomActiondata to early (It seems UI-sequence and execute sequence are different)

Here is what works:

<InstallExecuteSequence>
<Custom Action="TestCA.SetProperty" After="CreateFolders"/>
<Custom Action="CreateFolders" After="CopyChangingFilesAction.SetProperty"/>
</InstallExecuteSequence>
<CustomAction Id="TestCA.SetProperty" Return="check"
Property="TestCA" Value="SourceDir=[SourceDir];INSTALLDIR=[INSTALLDIR];CommonAppDataFolder=[CommonAppDataFolder]">
</CustomAction>
<CustomAction Id="TestCA" BinaryKey="CustomActionDll" DllEntry="TestMethod" Impersonate="no" Execute="deferred" Return="check">
</CustomAction>


Even though i like some aspectcs of msi (like the declarative approach), it seems to me that it is far more complicated than it could have been. Wix is a good start but - naturally - it cannot fully overcome the msi shortcomings. Or maybe I should have become something else in life

________________________________________
Von: ***@noser.com [***@noser.com]
Gesendet: Mittwoch, 14. Juli 2010 10:11
An: wix-***@lists.sourceforge.net
Betreff: Re: [WiX-users] Accessing Source directory in Deferred Custom Action (ApDataFolder etc. is working, just not SourceDir)

Hi

Since I haven't managed to assign the [SourceDir] value to a customAction Data Property, i tried to assign the data assign the value to a property and then assign that property to the a customAction. However, no success, the assigned property is empty. I am sure it is a simple syntax thing but i cant figure out the solution :-(

Here is what i did:
<Property Id="TestProp" Value="[SourceDir]" />
<SetProperty Id="TestProp" After="CostFinalize" Sequence="execute" Value="[SourceDir]" />

<InstallExecuteSequence>
<Custom Action="TestCA.SetProperty" After="InstallInitialize"/>
<Custom Action="TestCA" After="TestCA.SetProperty"/>
</InstallExecuteSequence>

<CustomAction Id="TestCA.SetProperty" Return="check"
Property="TestCA"
Value="TestingCAD=[TestProp];INSTALLDIR=[INSTALLDIR];AppDataFolder=[AppDataF
older]">
</CustomAction>
<CustomAction Id="TestCA" BinaryKey="CustomActionDll" DllEntry="TestMethod"
Impersonate="no" Execute="deferred" Return="check">
</CustomAction>

Still no success. :-(

I have found a workaround to set a property but thats something i want to avoid at any cost:

1. Define property "DUMMYPROPERTY"
2. Set property in C# custom action: session["DUMMYPROPERTY"] = "i get assigned, jabadabadu";
3. Assign property to custom action data (as above)

So I am 100% sure that the syntax i use for the SourceDir property is wrong. It must be something simple.
I am grateful for any help.

Thanks


________________________________________
Von: Blair [***@live.com]
Gesendet: Dienstag, 13. Juli 2010 18:34
An: 'General discussion for Windows Installer XML toolset.'
Betreff: Re: [WiX-users] Accessing Source directory in Deferred Custom Action (ApDataFolder etc. is working, just not SourceDir)

In a verbose installation log, what is the resulting value of the TestCA
property?

-----Original Message-----
From: ***@noser.com [mailto:***@noser.com]
Sent: Tuesday, July 13, 2010 8:24 AM
To: wix-***@lists.sourceforge.net
Subject: [WiX-users] Accessing Source directory in Deferred Custom Action
(ApDataFolder etc. is working, just not SourceDir)

Hi

I would like to access the "SourceDir" property in a deferred custom action.
While i can access other directories via the CustomAction property (see
example below). The SourceDir ActionData remains empty. I must be doing
something wrong. I sure it's something silly, that only a wix newby can
stumble over.

Any help appreciated.
Thanks

My sample code:


<InstallExecuteSequence>

<Custom Action="TestCA.SetProperty" After="InstallInitialize"/>

<Custom Action="TestCA" After="TestCA.SetProperty"/>

</InstallExecuteSequence>



<CustomAction Id="TestCA.SetProperty" Return="check"

Property="TestCA"
Value="SourceDir=[SourceDir];INSTALLDIR=[INSTALLDIR];AppDataFolder=[AppDataF
older]">

</CustomAction>

<CustomAction Id="TestCA" BinaryKey="CustomActionDll" DllEntry="TestMethod"
Impersonate="no" Execute="deferred" Return="check">

</CustomAction>





In the C# code:



[CustomAction]

public static ActionResult TestMethod(Session session)

{

session.Log("CustomAction TestMethod called!");

.



try{

// empty

string showMe = session.CustomActionData["SourceDir"];



// working, path

string showMe = session.CustomActionData["AppDataFolder"];
----------------------------------------------------------------------------
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


*** Confidentiality Notice: This e-mail, including any associated or attached files, is intended solely for the individual or entity to which it is addressed. This e-mail is confidential and may well also be legally privileged. If you have received it in error, you are on notice of its status. Please notify the sender immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person. This email comes from a division of the Invensys Group, owned by Invensys plc, which is a company registered in England and Wales with its registered office at Portland House, Bressenden Place, London, SW1E 5BF (Registered number 166023). For a list of European legal entities within the Invensys Group, please go to http://www.invensys.com/legal/default.asp?top_nav_id=77&nav_id=80&prev_id=77. You may contact Invensys plc on +44 (0)20 7821 3848 or e-mail ***@invensys.com. This e-mail and any attachments thereto may be subject to the terms of any agreements between Invensys (and/or its subsidiaries and affiliates) and the recipient (and/or its subsidiaries and affiliates).
[mailto:]
1970-01-01 00:00:00 UTC
Permalink
******************** TestCA.SetProperty ****************3
MSI (s) (54:54) [08:30:11:796]: Doing action: TestCA.SetProperty
MSI (s) (54:54) [08:30:11:796]: Note: 1: 2205 2: 3: ActionText=20
Action 08:30:11: TestCA.SetProperty.=20
Action start 08:30:11: TestCA.SetProperty.
MSI (s) (54:54) [08:30:11:796]: PROPERTY CHANGE: Adding TestCAproperty. Its=
value is 'SourceDir=3D;INSTALLDIR=3DC:\Programme\CalibrateEN\;AppDataFolde=
r=3DC:\Dokumente und Einstellungen\Administrator\Anwendungsdaten\'.
Action ended 08:30:11: TestCA.SetProperty. Return value 1.
MSI (s) (54:54) [08:30:11:811]: Doing action: TestCA
MSI (s) (54:54) [08:30:11:811]: Note: 1: 2205 2: 3: ActionText=20
Action 08:30:11: TestCA.=20
Action start 08:30:11: TestCA.
MSI (s) (54:54) [08:30:11:827]: Note: 1: 2205 2: 3: MsiPatchCertificate=20
MSI (s) (54:54) [08:30:11:827]: LUA patching is disabled: missing MsiPatchC=
ertificate table
MSI (s) (54:54) [08:30:11:827]: Resolving source.
MSI (s) (54:54) [08:30:11:842]: Resolving source to launched-from source.
MSI (s) (54:54) [08:30:11:842]: Setting launched-from source as last-used.
MSI (s) (54:54) [08:30:11:842]: PROPERTY CHANGE: Adding SourceDir property.=
Its value is 'C:\Dokumente und Einstellungen\Administrator\Desktop\'.
MSI (s) (54:54) [08:30:11:842]: PROPERTY CHANGE: Adding SOURCEDIR property.=
Its value is 'C:\Dokumente und Einstellungen\Administrator\Desktop\'.
MSI (s) (54:54) [08:30:11:842]: PROPERTY CHANGE: Adding SourcedirProduct pr=
operty. Its value is '{2500B11A-2907-4721-97D2-1AD7A639A3C3}'.
MSI (s) (54:54) [08:30:11:842]: SOURCEDIR =3D=3D> C:\Dokumente und Einstell=
ungen\Administrator\Desktop\
MSI (s) (54:54) [08:30:11:842]: SOURCEDIR product =3D=3D> {2500B11A-2907-47=
21-97D2-1AD7A639A3C3}
MSI (s) (54:54) [08:30:11:842]: Determining source type
MSI (s) (54:54) [08:30:11:842]: Source type from package 'Installer.msi': 2
MSI (s) (54:54) [08:30:11:842]: Source path resolution complete. Dumping Di=
rectory table...
MSI (s) (54:54) [08:30:11:842]: Dir (source): Key: TARGETDIR , Object: C:\D=
okumente und Einstellungen\Administrator\Desktop\ , LongSubPath: , ShortSu=
bPath:=20
MSI (s) (54:54) [08:30:11:858]: Dir (source): Key: WindowsFolder , Object: =
C:\Dokumente und Einstellungen\Administrator\Desktop\ , LongSubPath: , Sho=
rtSubPath:=20
MSI (s) (54:54) [08:30:11:858]: Dir (source): Key: DesktopFolder , Object: =
C:\Dokumente und Einstellungen\Administrator\Desktop\ , LongSubPath: , Sho=
rtSubPath:=20
MSI (s) (54:54) [08:30:11:858]: Dir (source): Key: AppDataFolder , Object: =
C:\Dokumente und Einstellungen\Administrator\Desktop\ , LongSubPath: , Sho=
rtSubPath:=20
MSI (s) (54:54) [08:30:11:858]: Dir (source): Key: ProgramMenuFolder , Obje=
ct: C:\Dokumente und Einstellungen\Administrator\Desktop\ , LongSubPath: ,=
ShortSubPath:=20
MSI (s) (54:54) [08:30:11:858]: Dir (source): Key: StartupFolder , Object: =
C:\Dokumente und Einstellungen\Administrator\Desktop\ , LongSubPath: , Sho=
rtSubPath:=20
MSI (s) (54:54) [08:30:11:858]: Dir (source): Key: ApplicationProgramsFolde=
r , Object: C:\Dokumente und Einstellungen\Administrator\Desktop\ , LongSub=
Path: Kistler Instruments AG (NOT LOCALIZED)\ , ShortSubPath: 9mauhji3\
MSI (s) (54:54) [08:30:11:858]: Dir (source): Key: ProgramFilesFolder , Obj=
ect: C:\Dokumente und Einstellungen\Administrator\Desktop\ , LongSubPath: =
, ShortSubPath:=20
MSI (s) (54:54) [08:30:11:858]: Dir (source): Key: INSTALLDIR , Object: C:\=
Dokumente und Einstellungen\Administrator\Desktop\ , LongSubPath: Calibrate=
EN\ , ShortSubPath: hqfkzea3\
MSI (s) (54:54) [08:30:11:858]: Dir (source): Key: PrintProcessDir , Object=
: C:\Dokumente und Einstellungen\Administrator\Desktop\ , LongSubPath: Cali=
brateEN\PrintProcess\ , ShortSubPath: hqfkzea3\ny2gcnro\
MSI (s) (54:54) [08:30:11:858]: Dir (source): Key: dir_Release_Kdi_1 , Obje=
ct: C:\Dokumente und Einstellungen\Administrator\Desktop\ , LongSubPath: Ca=
librateEN\Kdi\ , ShortSubPath: hqfkzea3\Kdi\
MSI (s) (54:54) [08:30:11:858]: Dir (source): Key: dir_Release_Plugin_2 , O=
bject: C:\Dokumente und Einstellungen\Administrator\Desktop\ , LongSubPath:=
CalibrateEN\Plugin\ , ShortSubPath: hqfkzea3\Plugin\
MSI (s) (54:54) [08:30:11:858]: Note: 1: 2205 2: 3: ActionText=20
MSI (s) (54:54) [08:30:11:874]: Note: 1: 2205 2: 3: ActionText=20
MSI (s) (54:54) [08:30:11:874]: Note: 1: 2205 2: 3: ActionText=20
Action 08:30:11: GenerateScript. Generating script operations for action:
GenerateScript: TestCA
Action ended 08:30:11: TestCA. Return value 1.
MSI (s) (54:54) [08:30:11:889]: Doing action: ProcessComponents
MSI (s) (54:54) [08:30:11:889]: Note: 1: 2205 2: 3: ActionText=20
Action 08:30:11: ProcessComponents. Updating component registration
Action start 08:30:11: ProcessComponents.
ProcessComponents:=20



******************** MORE (deferred) *****************************
MSI (s) (54:54) [08:30:12:327]: Executing op: ActionStart(Name=3DCopyChangi=
ngFilesAction,,)
Action 08:30:12: TestCA.=20
MSI (s) (54:54) [08:30:12:327]: Executing op: CustomActionSchedule(Action=
=3DTestCA,ActionType=3D3073,Source=3DBinaryData,Target=3DCopyChangingDirect=
ories,CustomActionData=3DSourceDir=3D;INSTALLDIR=3DC:\Programme\CalibrateEN=
\;AppDataFolder=3DC:\Dokumente und Einstellungen\Administrator\Anwendungsda=
ten\)
MSI (s) (54:54) [08:30:12:327]: Creating MSIHANDLE (5) of type 790536 for t=
hread 2900
MSI (s) (54:80) [08:30:12:342]: Invoking remote custom action. DLL: C:\WIND=
OWS\Installer\MSI67.tmp, Entrypoint: TestCA
MSI (s) (54:48) [08:30:12:342]: Generating random cookie.
MSI (s) (54:48) [08:30:12:358]: Created Custom Action Server with PID 2816 =
(0xB00).
MSI (s) (54:10) [08:30:12:405]: Running as a service.
MSI (s) (54:7C) [08:30:12:405]: Hello, I'm your 32bit Elevated custom actio=
n server.
MSI (s) (54!B4) [08:30:12:577]: Creating MSIHANDLE (6) of type 790531 for t=
hread 180
SFXCA: Extracting custom action to temporary directory: C:\WINDOWS\Installe=
r\MSI67.tmp-\
MSI (s) (54!B4) [08:30:12:577]: Closing MSIHANDLE (6) of type 790531 for th=
read 180
MSI (s) (54!B4) [08:30:12:592]: Creating MSIHANDLE (7) of type 790531 for t=
hread 180
SFXCA: Binding to CLR version v2.0.50727
MSI (s) (54!B4) [08:30:12:592]: Closing MSIHANDLE (7) of type 790531 for th=
read 180
MSI (s) (54!B4) [08:30:12:780]: Creating MSIHANDLE (8) of type 790531 for t=
hread 180
Calling custom action CustomAction!CustomAction.CustomActions.TestCA
MSI (s) (54!B4) [08:30:12:796]: Closing MSIHANDLE (8) of type 790531 for th=
read 180
MSI (s) (54!B4) [08:30:12:842]: Creating MSIHANDLE (9) of type 790531 for t=
hread 180
CustomAction TestCAcalled!
MSI (s) (54!B4) [08:30:12:842]: Closing MSIHANDLE (9) of type 790531 for th=
read 180
MSI (s) (54!B4) [08:30:17:092]: Creating MSIHANDLE (10) of type 790531 for =
thread 180
MSI (s) (54!B4) [08:30:17:092]: Closing MSIHANDLE (10) of type 790531 for t=
hread 180
MSI (s) (54!B4) [08:30:17:108]: Creating MSIHANDLE (11) of type 790531 for =
thread 180
MSI (s) (54!B4) [08:30:17:108]: Closing MSIHANDLE (11) of type 790531 for t=
hread 180
MSI (s) (54!B4) [08:30:17:108]: Creating MSIHANDLE (12) of type 790531 for =
thread 180
MSI (s) (54!B4) [08:30:17:108]: Closing MSIHANDLE (12) of type 790531 for t=
hread 180
MSI (s) (54!B4) [08:30:17:124]: Creating MSIHANDLE (13) of type 790531 for =
thread 180
MSI (s) (54!B4) [08:30:17:124]: Closing MSIHANDLE (13) of type 790531 for t=
hread 180
MSI (s) (54:80) [08:30:17:139]: Closing MSIHANDLE (5) of type 790536 for th=
read 2900
MSI (s) (54:54) [08:30:17:155]: Executing op: ActionStart(Name=3DProcessCom=
ponents,Description=3DUpdating component registration,)
Action 08:30:17: ProcessComponents. Updating component registration


________________________________________
Von: Blair [***@live.com]
Gesendet: Dienstag, 13. Juli 2010 18:34
An: 'General discussion for Windows Installer XML toolset.'
Betreff: Re: [WiX-users] Accessing Source directory in Deferred Custom Act=
ion (ApDataFolder etc. is working, just not SourceDir)

In a verbose installation log, what is the resulting value of the TestCA
property?

-----Original Message-----
From: ***@noser.com [mailto:***@noser.com]
Sent: Tuesday, July 13, 2010 8:24 AM
To: wix-***@lists.sourceforge.net
Subject: [WiX-users] Accessing Source directory in Deferred Custom Action
(ApDataFolder etc. is working, just not SourceDir)

Hi

I would like to access the "SourceDir" property in a deferred custom action=
.
While i can access other directories via the CustomAction property (see
example below). The SourceDir ActionData remains empty. I must be doing
something wrong. I sure it's something silly, that only a wix newby can
stumble over.

Any help appreciated.
Thanks

My sample code:


<InstallExecuteSequence>

<Custom Action=3D"TestCA.SetProperty" After=3D"InstallInitialize"/>

<Custom Action=3D"TestCA" After=3D"TestCA.SetProperty"/>

</InstallExecuteSequence>



<CustomAction Id=3D"TestCA.SetProperty" Return=3D"check"

Property=3D"TestCA"
Value=3D"SourceDir=3D[SourceDir];INSTALLDIR=3D[INSTALLDIR];AppDataFolder=3D=
[AppDataF
older]">

</CustomAction>

<CustomAction Id=3D"TestCA" BinaryKey=3D"CustomActionDll" DllEntry=3D"TestM=
ethod"
Impersonate=3D"no" Execute=3D"deferred" Return=3D"check">

</CustomAction>





In the C# code:



[CustomAction]

public static ActionResult TestMethod(Session session)

{

session.Log("CustomAction TestMethod called!");

.



try{

// empty

string showMe =3D session.CustomActionData["SourceDir"];



// working, path

string showMe =3D session.CustomActionData["AppDataFolder"];
---------------------------------------------------------------------------=
-
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


---------------------------------------------------------------------------=
---
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
Loading...