I'm trying to to write installer for 3rd-party application. The service should be installed and running with arguments. One of the argument it's home folder where the service was installed.
How I can read the folder where the application was installed and pass it to Wix Element: ServiceInstall as arguments.
<ServiceInstall Id="SInstall"
Type="ownProcess"
Name="myservice"
DisplayName="MyService"
EraseDescription="no"
Start="demand"
ErrorControl="normal"
Arguments="-folder '[INSTALLDIR]\config.txt'>
But [INSTALLDIR] is empty; I suppose it's should be done by using SetProperty and read it but cannot find any references how to do this.
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="ManufacturerFolder" Name="OEM_XXX">
<Directory Id="INSTALLFOLDER" Name="Product $(var.ProductVersion)">
<Directory Id="DirA" />
<Directory Id="DirB" Name="SubService">
<Directory Id="DirC" Name="ComponentA">
<Directory Id="ComponentB" Name="content" />
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<DirectoryRef Id="DirB">
<Component Id="Svc1" Guid="b033eb95-ce88-48ac-b40f-6913c5e4b978" Win64="yes">
<File Source="$(var.SourceDir)\service.exe" />
<ServiceInstall Id="SInstall"
Type="ownProcess"
Name="myservice"
DisplayName="MyService"
EraseDescription="no"
Start="demand"
ErrorControl="normal"
Arguments="-folder '???????\config.txt'>
<ServiceConfig DelayedAutoStart="no" OnInstall="yes" OnReinstall ="yes" />
</ServiceInstall>
<ServiceControl Id="SControl"
Stop="both"
Remove="uninstall"
Name="myservice"
Wait="no" />
</Component>
</DirectoryRef>
</Fragment>
Thanks.