WiX 3.10으로 설치 프로그램을 만들고 있습니다. 내 원래 작업은 대상 시스템에 Postgres 파일을 복사하고, 클러스터를 초기화하고, 서비스를 등록하고, 설치시 데이터베이스를 복원하고, 역방향 중지 서비스에서 시스템에서 제거하고 클러스터 데이터를 지우는 것입니다. 나는 두 개의 박쥐 파일을 썼고, 그들을 실행하기 위해 커스텀 액션을 추가했고, 여러 장소에서 묘사 된 것과 같은 몇몇 조건을 추가했다. CDATA, Installed, INSTALLED 및 기타 변형을 사용하거나 사용하지 않으려 고 시도했지만 항상 두 작업을 모두 실행합니다.설치 또는 제거시에만 사용자 지정 작업 실행
다음은 지금 실험중인 wix 파일입니다.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Hatred_6" Language="1033" Version="1.0.0.0" Manufacturer="Satan" UpgradeCode="d9602b10-8428-4031-8c82-99288b21377f">
<Package InstallerVersion="405" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<CustomAction Id="AAction" Directory="INSTALLFOLDER" Execute="deferred" Impersonate="no" Return="check"
ExeCommand="cmd.exe /c "a.bat"">NOT Installed</CustomAction>
<CustomAction Id="BAction" Directory="INSTALLFOLDER" Execute="deferred" Impersonate="no" Return="check"
ExeCommand="cmd.exe /c "b.bat"">Installed</CustomAction>
<InstallExecuteSequence>
<Custom Action="BAction" After="InstallFiles" />
<Custom Action="AAction" After="InstallFiles" />
</InstallExecuteSequence>
<Feature Id="ProductFeature" Title="Hatred_6" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="Hatred_6" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="CalcComponent" Guid="515C0606-FD73-4B5D-ACF4-481123092A3E">
<File Id="CalcFile" KeyPath="yes" Source="calc.exe" />
</Component>
<Component Id="AComponent" Guid="515e3aa0-e5a0-4cd1-aaa5-ebf25a679a24">
<File Id="AFile" KeyPath="yes" Source="a.bat" />
</Component>
<Component Id="BComponent" Guid="85f7627e-fc39-4f78-a870-221d2d08375d">
<File Id="BFile" KeyPath="yes" Source="b.bat" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
박쥐 파일은 실제로 실행하는 경우 그래서 내가 볼 수 b.txt DIR> a.txt이와 DIR>을 포함한다. 다소 실망 스럽습니다. 오해입니까?
사용자 작업이 실행되는지 확인하기 위해'dir> a.txt'보다는 자세한 로그를 사용하는 것이 좋습니다. –
어쨌든 부작용을 일으키기 위해서는 박쥐 파일이 모두 필요합니다. 작업의 조건을 평가하는 방법을 설명 할 수있는 자세한 로그에는 아무것도 찾을 수 없습니다. – Encarmine