During the installation I need to customize some configuration files which is basically to search and replace certain keywords given as Properties to the msi intaller. The custom action looks like this:
<CustomAction Id="SetApplicationProperties"
Directory="CONFIG.DIR"
ExeCommand="powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "cat application.properties.template | % { $_ -replace 'SERVERNAME','[SERVERNAME]' } > application.properties.customer" "
Execute="deferred"
Impersonate="no"
/>
However I only get an empty "application.properties.customer" file. no error/warning in installer logfile. I tried various combination of quoting the strings but w/o success. Reducing the command to:
ExeCommand='powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "cat application.properties.template > application.properties.test" '
works, so it seems to be a problem with the quoting of the "-replace..." statement.
Has anyone any sugestions how properly set the quotes for the installer?