I have a wix installation below.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="SomeApplication" Language="1033" Version="1.0.0.0" Manufacturer="Company" UpgradeCode="4810b5e4-21d8-4a45-b289-eafb10dddc0a">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<Media Id="1" Cabinet="Cab1.cab" EmbedCab="yes" />
<Feature Id="ProductFeature" Title="EvokoInstaller" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
<UIRef Id="WixUI_InstallDir" />
<WixVariable Id="WixUILicenseRtf" Value="LICENSE.rtf" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<InstallExecuteSequence>
<Custom Action="ExtractService" Before="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>
<CustomAction Id="ExtractService" Directory="INSTALLFOLDER" Execute="deferred" ExeCommand="7z e some_service.tar.gz && 7z x some_service.tar" Return="check"/>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="SomeInstaller"/>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="packages">
<File Source="some_service.tar.gz" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
Now it copies the some_service.tar.gz file to the installation directory. I would like to extract the file after copying it. I would like it to be done automatically by Wix.
The command 7z e some_service.tar.gz && 7z x some_service.tardoes this exactly when I do it manually, and the command line runs as aministrator.
How can I execute it from Wix and delete the compressed files after extracting it.
EDIT1:
After the comment by @ArkadySitnitsky, I added the suggested code, and now I can not copy the some_service.tar.gz file to the installation location.
Please check the image:

EDIT2:
Here is the log from the event log after installation with an error.
: SomeProduct - 1722. Windows > Installer. , , . . ExtractService, : C:\Program Files (x86)\SomeInstaller \, : 7z e some_service.tar.gz
EDIT3:
: ExeCommand="7z e some_service.tar.gz pause" . .tar.gz .
EDIT4:
, :
<CustomAction Id="ExtractService3"
Directory="INSTALLFOLDER"
Impersonate='no'
Execute="deferred"
ExeCommand="rm liso_service.tar.gz"
Return="check"/>
<CustomAction Id="ExtractService4"
Directory="INSTALLFOLDER"
Impersonate='no'
Execute="deferred"
ExeCommand="rm liso_service.tar"
Return="check"/>
<Custom Action="ExtractService3" After="ExtractService2">NOT Deleted</Custom>
<Custom Action="ExtractService4" After="ExtractService2">NOT Deleted</Custom>
. .
EDIT5:
<Custom Action="ExtractService3" After="ExtractService2"></Custom>
<Custom Action="ExtractService4" After="ExtractService2"></Custom>
EDIT6:
rm , , :
cygintl-2.dll
, - OpenSHH. OpenSHH , . rm . , del (). , .
EDIT7:
ExeCommand="del /f /q some_service.tar.gz" . some_service.tar, , some_service.tar.gz . del /f /q some_service.tar,
.
EDIT8:
.tar tar.gz. . :
<CustomAction Id="ExtractService"
Directory="INSTALLFOLDER"
Impersonate='no'
Execute="deferred"
ExeCommand="7z e -y some_service.tar.gz"
Return="check"/>
<CustomAction Id="ExtractService2"
Directory="INSTALLFOLDER"
Impersonate='no'
Execute="deferred"
ExeCommand="7z x -y some_service.tar"
Return="check"/>
<CustomAction Id="ExtractService3"
Directory="INSTALLFOLDER"
Impersonate='no'
Execute="deferred"
ExeCommand="del /f /q some_service.tar.gz"
Return="check"/>
<CustomAction Id="ExtractService4"
Directory="INSTALLFOLDER"
Impersonate='no'
Execute="deferred"
ExeCommand="del /f /q some_service.tar"
Return="check"/>
<InstallExecuteSequence>
<Custom Action="ExtractService" Before="InstallFinalize">NOT Installed</Custom>
<Custom Action="ExtractService2" After="ExtractService">NOT Installed</Custom>
<Custom Action="ExtractService3" After="ExtractService2" ></Custom>
<Custom Action="ExtractService4" After="ExtractService2" ></Custom>
</InstallExecuteSequence>