'WiX doesn't run bat file after installed it
I try to use a recipe of WiX Cookbook book to run batch file after copying it but somehow after the copy the installer deletes the folder and files and doesn't run the batch file. The batch file would register two reg files into the registry. I installed WixUtilExtension.dll, too.
<ComponentGroup Id="NewFilesGroup">
<Component Id="A.dll64.reg" Directory="MyCommonAppDataFolder" Guid="60BDBD5E-8219-4C21-94B4-DE5F5E230C8C">
<File Id="A.dll64.reg" KeyPath="yes" Source="A.dll64.reg" />
</Component>
<Component Id="B.dll32.reg" Directory="MyCommonAppDataFolder" Guid="8615ACC0-A07C-43C8-81A4-F91A8678009F">
<File Id="B.dll32.reg" KeyPath="yes" Source="B.dll32.reg" />
</Component>
<Component Id="CMP_regasm_installer.bat" Directory="MyCommonAppDataFolder" Guid="5C8DBF10-6ED8-4E07-99F0-73AC43E1ACF2">
<File Id="FILE_regasm_installer.bat" KeyPath="yes" Source="regasm_installer.bat" />
</Component>
</ComponentGroup>
<SetProperty Id="RunBatch"
Value=""[#FILE_regasm_installer.bat]""
Sequence="execute"
Before="RunBatch" />
<CustomAction Id="RunBatch"
BinaryKey="WixCA"
DllEntry="CAQuietExec"
Execute="deferred"
Return="check"
Impersonate="no" />
<InstallExecuteSequence>
<Custom Action="RunBatch" After="InstallFiles" />
</InstallExecuteSequence>
Solution 1:[1]
Batch files are text files, you cannot execute them directly. You need to use cmd.exe to interpret and execute the instructions in the batch file.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Rob Mensching |
