I have an executable that requires a preset of parameters being passed to it, hence the need for a batch file (.bat). All was working well until I figured that the folder path used in [WixBundleLastUsedSource] could contain a space.
Here is the EXE file packaged definition:
<ExePackage Id="myexepackage" Compressed="no" Permanent="yes" Cache="no"
After="previousfeature"
SourceFile="$(var.preprocessorvariable)\myexe.bat"
InstallCommand="[WixBundleLastUsedSource]myexe.exe [otherparam]" />
And here are some test I tried and the logs from them:
This one is the working variation:
Applying execute package: myexepackage, action: Install, path: C:\ProgramData\Package Cache\7AE3BA856B7D415569854BFE32DD3848112B7BFA\myexe.bat, arguments: '"C:\ProgramData\Package Cache\7AE3BA856B7D415569854BFE32DD3848112B7BFA\myexe.bat" C:\Users\user\Desktop\Install\myexe.exe otherparamvalue'
While the following two logs are from failures:
Applying execute package: myexepackage, action: Install, path: C:\ProgramData\Package Cache\7AE3BA856B7D415569854BFE32DD3848112B7BFA\myexe.bat, arguments: '"C:\ProgramData\Package Cache\7AE3BA856B7D415569854BFE32DD3848112B7BFA\myexe.bat" "C:\Users\user\Desktop\Install\myexe.exe" otherparamvalue'
Applying execute package: myexepackage, action: Install, path: C:\ProgramData\Package Cache\7AE3BA856B7D415569854BFE32DD3848112B7BFA\myexe.bat, arguments: '"C:\ProgramData\Package Cache\7AE3BA856B7D415569854BFE32DD3848112B7BFA\myexe.bat" "C:\Users\user\Desktop\Install new\myexe.exe" otherparamvalue'
Whenever I introduce quotes to the EXE file package with either "
or %quot;
like
<ExePackage Id="myexepackage" Compressed="no" Permanent="yes" Cache="no"
After="previousfeature"
SourceFile="$(var.preprocessorvariable)\myexe.bat"
InstallCommand=""[WixBundleLastUsedSource]myexe.exe"[otherparam]" />
it fails with:
e000: Error 0x80070001: Process returned error: 0x1
e000: Error 0x80070001: Failed to execute EXE package.
e000: Error 0x80070001: Failed to configure per-machine EXE package.
Is there a solution or workaround for this?
.exe&qout;[otherparam]
? – Tom Blodget