0

I have a custom action in my WiX script to copy installation log:

<CustomAction Id="CopyLogFile" Execute="immediate"
            ExeCommand="cmd /c copy [MsiLogFileLocation] &quot;\&quot;[APPLICATIONFOLDER]Install.log\&quot;&quot;"
            Directory="TARGETDIR"
            Impersonate="no"
            Return="asyncNoWait" />
    <InstallExecuteSequence>
      <Custom Action="CopyLogFile" OnExit="success" />
    </InstallExecuteSequence>

The problem is the APPLICATIONFOLDER environment variable. No matter how I try to use it it does not work. I tried single &quot, double &quot, no &quot, etc. Nothing helps.

If I hard-code the destination like this:

ExeCommand="cmd /c copy [MsiLogFileLocation] c:\temp\Install.log"

it works fine.

However, I need to copy the install log to some known location on the user's machine.

I looked at WiX CustomAction ExeCommand failing?, and Not able to send Wix SourceDir path with spaces to custom action ExeCommand but it does not help with this issue.

1 Answer 1

0

According to Windows Installer Formatted reference your commandline should be:

cmd /c copy [MsiLogFileLocation] &quot;\&quot;[%APPLICATIONFOLDER]Install.log\&quot;&quot;
                                               ^

You are missing the % prefix for environment variables.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.