23

After reading the page on SetProperty and looking at as many examples as I could find here and elsewhere, I'm still not able to get my SetProperty to work with After or Before set to one of my custom action IDs. The documentation seems very simple and straight forward on the subject (hah!), but I'm getting "Found an ActionRow with a non-existent After action: MyWonderfulCA" instead of happiness (which really is what I'm after : ) Here's a representation of what my code looks like:

    <CustomAction Id="MyWonderfulCA" BinaryKey="MyWonderful.dll" DllEntry="MyWonderfulCA" Execute="immediate" />

    <InstallExecuteSequence>
        <Custom Action="MyWonderfulCA" After="LaunchConditions" />
    </InstallExecuteSequence>

    <Property Id="SOMEPROPERTY" />
    <SetProperty Id="SOMEPROPERTY" After="MyWonderfulCA" Value="[SOMEOTHERPROPERTY]the\yellow\brick\road">WEAREHUNKYDORY</SetProperty>

So anyway, save me SOF wix pros, you're my only hope...

idclaar
  • 688
  • 2
  • 7
  • 17

1 Answers1

61

I'm not sure, but the following thing looks suspicious.

The <SetProperty> (link) element has Sequence attribute, which is optional. If you don't specify it (like in the sample you posted), it gets the value of both, which means the custom action of type 51 (which is what SetProperty translates to) is scheduled into both InstallUISequence and InstallExecuteSequence.

However, as far as I can see, you only schedule MyWonderfulCA into the InstallExecuteSequence. Hence, it makes me think that when WiX tries to schedule SetProperty into the InstallUISequence, it can't find the custom action specified in After attribute and fails.

Check this out by either specifying the Sequence='execute' explicitly, or by scheduling your wonderful CA into both sequence. If it is the case, then just choose the most appropriate way out of these two.

Alex Klaus
  • 8,168
  • 8
  • 71
  • 87
Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
  • 1
    BINGO!! That did it. You rock Yan, thanks so much for pointing out the Sequence attr : ) – idclaar Jun 19 '13 at 20:46
  • 7
    Wow, and that is not at ALL obvious from the examples even here http://wixtoolset.org/documentation/manual/v3/customactions/qtexec.html Spent a lot of time wondering what the hell am i doing wrong. Cheers! – berkus Mar 15 '16 at 14:48
  • The lack of the Sequence attribute was causing this error on my end: Unresolved reference to symbol 'WixAction:InstallUISequence/InstallFinalize'. You've made my day! – Fabricio Aug 09 '17 at 20:28
  • 4
    @berkus I think WiX documentation should receive a proud achievement of a `one brown star award` for how much time we have wasted trying to understand how tf it works. – c00000fd Jul 26 '20 at 06:52
  • @c00000fd thankfully I've stopped using Windows systems completely, wix included! – berkus Aug 15 '20 at 18:52
  • 1
    Just want to share that even in Jan '21, this is still the right answer. I had the same error being reported for a Before action. Same problem, same solution. – Aaron G Jan 27 '21 at 01:13
  • @AaronG A known issue is like an old friend ;-) – Yan Sklyarenko Jan 27 '21 at 06:31