4

I should need to run a C++ wix custom action before file installation starts. Is it possible? My code is

    <InstallUISequence>
    <Custom Action ="_EE10247D_B1B7_42F9_8BC9_A973E5755689" Before ="InstallFiles"></Custom>
    </InstallUISequence>
    <CustomAction Id="_EE10247D_B1B7_42F9_8BC9_A973E5755689" Execute="deferred" Impersonate="no" FileKey="FileDllId" adx:VSName="GuidAutoGen" DllEntry="GuidAutoGen" />

but the error message is "error LGHT0094: Unresolved reference to symbol 'WixAction:InstallUISequence/InstallFiles' in section 'Product:{C095BA7A-0E1E-4679-AAC0-3C17C82BC5EA}"

What's wrong?

Costanzo Ferraro
  • 169
  • 2
  • 12

2 Answers2

5

Linker tells you absolutely true. "InstallUISequence" has no step "InstallFiles". This step presented in another sequence, "InstallExecuteSequence". This sequence executes after InstallUISequence. In your case, you should write instead of your code:

<InstallExecuteSequence>
   <Custom Action ="_EE10247D_B1B7_42F9_8BC9_A973E5755689" Before ="InstallFiles"></Custom>
</InstallExecuteSequence>
Anton Sutarmin
  • 807
  • 8
  • 15
1

Well yes, you just sequence it before the InstallFiles action, in deferred mode. You might need to expand your question if you need more detail.

PhilDW
  • 20,260
  • 1
  • 18
  • 28
  • I expanded my question with your suggestion, but it doesn't compile. Where do I get wrong – Costanzo Ferraro Dec 18 '15 at 14:49
  • Without knowing your goal, it's hard to say, but in general if you just want to run code before files are installed then you'd make it deferred and in the InstallExecuteSequence. Wht would you need it in the UI sequence? Deferred means execute sequence. – PhilDW Dec 19 '15 at 20:02