Krishna Nadiminti
2008-06-08 15:37:57 UTC
Hi Jason,
I've created a few custom actions in C# using your wonderful DTF framework.
So far, I found a couple of issues. One of them seems to be a showstopper -
for now.
1. I invoke my C# custom action when a PushButton raises the DoAction
control event. The action gets called correctly, (most of the time about 80%
of the time) and while it seems to do the right thing, I don't get any of
the messages I logged from inside my custom action using session.Log. My
other custom actions which are directly sequenced in the
InstallExecuteSequence do log messages out, and those messages appear
correctly.
2. This is the 80% part. I read a previous post from someone, who said a
similar thing, and your reply saying it was fixed. I'm currently using Wix
v.3.0.4207. But, in my case occasionally it just doesn't work. No error
messages are shown in the log - nothing. Just says my CA died and that's it.
Now, if I rebuild, and re-launch the setup, it generally works. I'm using VS
2008 and Votive by the way, to build stuff. My CA method has a try/catch
that surrounds all the code, to catch any exception, log it to the session
and return ActionResult.Failure.
3. Now, this may be helpful to developers in the future: how about packaging
the .pdb file of the .NET custom action dll along with the dll and
MS.Deployment.dll? This would give people slightly better info regarding the
line number etc where their .NET CA code fails.
4. Another one, related to 3, is the build process for the PackCustomAction
MSBuild target (in the MakeSFX)... My custom action that runs in immediate
mode, during the UI sequence and does not modify the system, shows a
Winforms dialog. I have to show a list of x509 certs to the user to select
one, and Wix UI is simply incapable of doing that. (I really dont want to
hack up the listView control and stuff in Wix/MSI's standard UI - it just
doesn't serve my purpose). Anyway, this Winforms thing actually works but I
had a couple of issues along the way : The MakeSfxCA step after my custom
action compilation complains about System.Windows.Forms not being in my
bin\Debug directory. If I set System.Windows.Forms.dll, and its dependencies
to be copied locally, in VS 2008, then MakeSFX does not complain - otherwise
- it blows up.
I looked into the code to see what it is doing - and understand where and
why it blows up: it tries to load the Assembly dependencies from the
bin\Debug directory (or whereever the .NET CA compiles to), and can't find
it! Now, I think there should be some code in there to avoid checking for
Exported types, and methods decorated with [CustomAction], IF the dependency
is a standard .NET Fx dll or perhaps you could check if the dll is GAC-ed.
Both of these first require to not assume that all the dependencies are in
the bin\Debug directory.
I hope that makes sense. Please let me know what you think.
Thanks,
Krishna.
I've created a few custom actions in C# using your wonderful DTF framework.
So far, I found a couple of issues. One of them seems to be a showstopper -
for now.
1. I invoke my C# custom action when a PushButton raises the DoAction
control event. The action gets called correctly, (most of the time about 80%
of the time) and while it seems to do the right thing, I don't get any of
the messages I logged from inside my custom action using session.Log. My
other custom actions which are directly sequenced in the
InstallExecuteSequence do log messages out, and those messages appear
correctly.
2. This is the 80% part. I read a previous post from someone, who said a
similar thing, and your reply saying it was fixed. I'm currently using Wix
v.3.0.4207. But, in my case occasionally it just doesn't work. No error
messages are shown in the log - nothing. Just says my CA died and that's it.
Now, if I rebuild, and re-launch the setup, it generally works. I'm using VS
2008 and Votive by the way, to build stuff. My CA method has a try/catch
that surrounds all the code, to catch any exception, log it to the session
and return ActionResult.Failure.
3. Now, this may be helpful to developers in the future: how about packaging
the .pdb file of the .NET custom action dll along with the dll and
MS.Deployment.dll? This would give people slightly better info regarding the
line number etc where their .NET CA code fails.
4. Another one, related to 3, is the build process for the PackCustomAction
MSBuild target (in the MakeSFX)... My custom action that runs in immediate
mode, during the UI sequence and does not modify the system, shows a
Winforms dialog. I have to show a list of x509 certs to the user to select
one, and Wix UI is simply incapable of doing that. (I really dont want to
hack up the listView control and stuff in Wix/MSI's standard UI - it just
doesn't serve my purpose). Anyway, this Winforms thing actually works but I
had a couple of issues along the way : The MakeSfxCA step after my custom
action compilation complains about System.Windows.Forms not being in my
bin\Debug directory. If I set System.Windows.Forms.dll, and its dependencies
to be copied locally, in VS 2008, then MakeSFX does not complain - otherwise
- it blows up.
I looked into the code to see what it is doing - and understand where and
why it blows up: it tries to load the Assembly dependencies from the
bin\Debug directory (or whereever the .NET CA compiles to), and can't find
it! Now, I think there should be some code in there to avoid checking for
Exported types, and methods decorated with [CustomAction], IF the dependency
is a standard .NET Fx dll or perhaps you could check if the dll is GAC-ed.
Both of these first require to not assume that all the dependencies are in
the bin\Debug directory.
I hope that makes sense. Please let me know what you think.
Thanks,
Krishna.
--
View this message in context: http://www.nabble.com/Problem-with-DTF-Custom-action-invoked-via-PushButton-Event-%3A-DoAction-tp17719937p17719937.html
Sent from the wix-users mailing list archive at Nabble.com.
View this message in context: http://www.nabble.com/Problem-with-DTF-Custom-action-invoked-via-PushButton-Event-%3A-DoAction-tp17719937p17719937.html
Sent from the wix-users mailing list archive at Nabble.com.