I need to create the MSI installer using WiX , and I need to set the MY_HOME environment before running the command action.
I have a component:
<Component Id="SEMYHOME" Guid="*my guid*"> <CreateFolder /> <Environment Id="MY_HOME" Action="set" Part="all" Name="MY_HOME" Permanent="no" System="yes" Value="[APPLICATIONPATH]myapp"/> </Component>
Then I have a custom action:
<CustomAction Id="InstallMyService" Directory="INSTALLDIR" ExeCommand='"[INSTALLDIR]myapp\install_service.bat" install' Execute="immediate" Return="ignore"/> <InstallExecuteSequence> <Custom Action="InstallMyService" After="InstallFinalize"/> </InstallExecuteSequence>
NOTE. This action requires the MY_HOME variable, which must be set before starting.
When installing this MSI, I received a log showing that before running the custom "InstallMyService" action, a command was set before the MY_HOME parameter, but the command to install my service was still not running. I found that the reason for calling the MY_HOME command has not yet been established.
After the installation was completed, MY_HOME was installed as expected, but the user action failed: (
How can I fix this problem?
source share