Steph Ragazzi
Steph Ragazzi

Reputation: 381

How to use a file in a custom action without installing it in the InstallUISequence phase?

I would like to run an executable file with a quiet execution custom action during the InstallUISequence phase.
This executable has a text file as a parameter. I don't want that text file to be installed and I can't put it on the directory/file part as it is intented to use during the UI sequence.
How can I do that?
Here is a sample code to explain what I want:

<CustomAction Id="RunIsql_cmd" Property="RunIsql" Value="&quot;[MYEXE]&quot; -U [PARAM1] -i **myFileFromThePackage.txt** Execute="immediate"/>
<CustomAction Id="RunIsql" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check" Impersonate="no"/>

How can I define myFileFromThePackage.txt ?
I've tried to define the file like this:

<Binary Id="DummyFileForInstallOnly" SourceFile="myFile.txt" />

But I can't associate the id to the CA..

Upvotes: 3

Views: 319

Answers (1)

Cosmin
Cosmin

Reputation: 21426

Adding it in Binary table is a good approach, but you also need to extract it during install in order to use it. This can be done through a custom action which uses the Windows Installer database API.

You will also need a custom action to delete the extracted file after it has been used.

Upvotes: 3

Related Questions