2017-04-17 50 views
0

我有我的WiX的脚本自定义操作复制安装日志:在维克斯CustomAction访问变量的execCommand

<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> 

的问题是APPLICATIONFOLDER环境变量。无论我如何尝试使用它都不起作用。我试过单个&“,双&”,没有&“等等。没有什么帮助。

如果我硬编码这样的目标:

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

它工作正常。

但是,我需要将安装日志复制到用户计算机上的某个已知位置。

我看着WiX CustomAction ExeCommand failing?Not able to send Wix SourceDir path with spaces to custom action ExeCommand但它没有帮助解决这个问题。

回答