我提供了这样的路径作为属性值: [INSTALLFOLDER]Program Scripts\Script1.rss
其中 INSTALLFOLDER
C:\Program Files (x86)\ABCCompany\DEFProductInstaller\
但它以某种方式被解释为:
的 C:\Windows\SysWOW64\C:\Program Files (x86)\ABCCompany\DEFProductInstaller\Program Scripts\Script1.rss
这是属性和关联的CustomAction
<Property Id="CreateDataSources"
Value=""rs.exe" -i "[INSTALLFOLDER]Program Scripts\Script1.rss""/>
<CustomAction Id="CreateDataSources" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/>
这是日志:
Property(S): SystemFolder = C:\Windows\SysWOW64\
...
MSI (s) (8C:44) [14:41:41:202]: Executing op: CustomActionSchedule(Action=CreateDataSources,ActionType=3073,Source=BinaryData,Target=CAQuietExec,CustomActionData="rs.exe" -i "[INSTALLFOLDER]Program Scripts\Script1.rss" -s http://localhost/ReportServer -v DataSourcePath="" -v DBServer="." -v InitialCatalog="MyDB" -v UserId="" -v Password="" -v IntegratedSecurity="True")
MSI (s) (8C:78) [14:41:41:211]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIFB.tmp, Entrypoint: CAQuietExec
MSI (s) (8C:90) [14:41:41:211]: Generating random cookie.
MSI (s) (8C:90) [14:41:41:213]: Created Custom Action Server with PID 16716 (0x414C).
MSI (s) (8C:C4) [14:41:41:237]: Running as a service.
MSI (s) (8C:C4) [14:41:41:238]: Hello, I'm your 32bit Impersonated custom action server.
CAQuietExec: Could not find a part of the path 'C:\Windows\SysWOW64\C:\Program Files (x86)\ABCCompany\DEFProductInstaller\Program Scripts\Script1.rss'.
CAQuietExec: Error 0x80070001: Command line returned an error.
CAQuietExec: Error 0x80070001: CAQuietExec Failed
知道我做错了什么?
更新将<Property>
值更改为绝对路径可解决此问题。
<Property Id="CreateDataSources"
Value='"rs.exe" -i "C:\Program Files (x86)\ABCCompany\DEFProductInstaller\Program Scripts\Script1.rss"/>
但我需要它与INSTALLFOLDER
答案 0 :(得分:0)
日志没有像我预期的那样失败失败(也许最近有一次WiX更改)但根据我的经验,对rs.exe的调用不仅要包含在引号中,而且还必须是绝对路径。 "[SystemFolder]rs.exe"
答案 1 :(得分:0)
您需要提供要运行的.exe的完整路径。 CreateProcess不使用系统路径:http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx