DTF custom action problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

DTF custom action problem

Daniel Lee
This post has NOT been accepted by the mailing list yet.
Hello, I have a C# custom action that integrates DTF, however, it does not seem to execute.
My custom action is scheduled just after Cost Finalize and the MSI log indicates that the custom action was called. In the custom action I added a session.log call so that it would write the msi log and that event never seems to occur.

My custom action looks like the following:
public static ActionResult GetCredential(Session session)
    session.log("Hello World");
    var result = GetAppCredential();
    session["IS_SQLSERVER_USERNAME"] = result.SqlUserName;
    session["IS_SQLSERVER_PASSWORD"] = result.SqlPassword;
    return result.Status;

In unit testing the call GetAppCredential works correctly.

I execute the MakeSFxCA for this and it creates the correct output file.
I open the output file in depends and it shows my method call as I expect. Note that it also shows a number of other entry points as well that show up as <empty string>.

My dll has dependencies on other DLL methods, so I use Smart Assembly to embed the dependencies into a single dll, this is what is consumed by MakeSFxCA and produces the output file.

Once I even tried to just invoke a call to write to a log file using C# and avoid the session object completely, but that did not work either. From what I can see, it is not even stepping into the code when called.

Here is the MSI Log excerpt.
MSI (s) (34:A8) [07:41:16:943]: Doing action: GetACCredentials
Action ended 7:41:16: CostFinalize. Return value 1.
MSI (s) (34:A8) [07:41:16:943]: Skipping action because it is not part of a patch uninstall.
Action start 7:41:16: GetACCredentials.
MSI (s) (34:A8) [07:41:16:943]: Skipping action: DBFOLDER (condition is false)
MSI (s) (34:A8) [07:41:16:943]: Skipping action: SetShortcutInfo (condition is false)
MSI (s) (34:A8) [07:41:16:943]: Skipping action: CreateMedFxShortcut (condition is false)
MSI (s) (34:A8) [07:41:16:943]: Doing action: Kill_AmazingCharts_BroadCast
Action ended 7:41:16: GetACCredentials. Return value 0.

I am using this custom action dll in InstallShield 2015 Premium Suite/Advanced UI project that includes a MSI package for our main application.

Reply | Threaded
Open this post in threaded view

Re: DTF custom action problem

Daniel Lee
This post has NOT been accepted by the mailing list yet.
Ok, I found out my problem.
1. ID10T error ... After having tweaked my code, I neglected to run smart assembly again to embed all the required dependencies. :0
2. I needed to create a customaction.config file and modify my MakeSfxCA msbuild file to include the customaction.config file as a support file. This took a little bit to piece together as it is not immediately obvious of the entire process.