Hello,
I have a window installer XML (WIX) installer. I run the bellow commands.
- when I use hard coded value of My document in the second part of the command - it works (see Command#1 below).
- when I use the [PersonalFolder] value in the second part of the command - it doesn't works (see Command#2 below).
<!--Command#1 - Work using hard coded value -->
<SetProperty Id="UpdateCsprojSamples2012"
Value=""powershell" Get-ChildItem -Path '[PersonalFolder]Visual Studio 2012\Projects\Micro Focus RDE Samples\' -Recurse -include *.csproj | "ForEach-Object {((gc $_.FullName) -replace 'VS_MYDOCUMENTS', 'C:\Users\donnam\Documents\Visual Studio 2012') | Out-File $_.FullName -Encoding UTF8}""
Before="UpdateCsprojSamples2012" Sequence="execute" >NOT REMOVE="ALL"</SetProperty>
<CustomAction Id="UpdateCsprojSamples2012" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Impersonate="no"/>
<!-- Command#2 - Doesn't work using [PersonalFolder] -->
<SetProperty Id="UpdateCsprojSamples2012"
Value=""powershell" Get-ChildItem -Path '[PersonalFolder]Visual Studio 2012\Projects\Micro Focus RDE Samples\' -Recurse -include *.csproj | ForEach-Object {((gc $_.FullName) -replace 'VS_MYDOCUMENTS', '[PersonalFolder]') | Out-File $_.FullName -Encoding UTF8}"
Before="UpdateCsprojSamples2012" Sequence="execute" >NOT REMOVE="ALL"</SetProperty>
<CustomAction Id="UpdateCsprojSamples2012" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Impersonate="no"/>
Error I get from the second code section is:
WixQuietExec: "powershell" Get-ChildItem -Path 'C:\Users\donnam\Documents\Visual Studio 2012\Projects\Micro Focus RDE Samples\' -Recurse -include *.csproj | ForEach-Object ((gc $_.FullName) -replace 'VS_MYDOCUMENTS', 'C:\Users\donnam\Documents\') | Out-File $_.FullName -Encoding UTF8
WixQuietExec: Get-Content : Cannot bind argument to parameter 'Path' because it is null.
WixQuietExec: At line:1 char:151
WixQuietExec: + ... -Recurse -include *.csproj | ForEach-Object ((gc $_.FullName) -repla ...
WixQuietExec: + ~~~~~~~~~~~
WixQuietExec: + CategoryInfo : InvalidData: (:) , ParameterBindingValidationException
WixQuietExec: + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.GetContentC
WixQuietExec: ommand
WixQuietExec:
WixQuietExec: Error 0x80070001: Command line returned an error.
why the second command fails?
I hope someone can help!