2017-04-17 32 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但它沒有幫助解決這個問題。

回答