저는 처음으로 WiX 프로젝트를 진행하고 있으며 제대로 작동하려면 일부 레지스트리 항목을 가져 오는 데 어려움을 겪고 있습니다.WiX 조건부 레지스트리 항목
내 요구 사항은 소프트웨어를 데스크톱 컴퓨터에 설치할지 또는 항공기에 설치할지 선택하는 옵션을 설정하는 것입니다. 실제로 자동으로 감지 할 방법이 없으므로 일부 라디오 버튼이있는 UI 화면을 추가로 만들었습니다.
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="AircraftDesktopDlg_Custom"
Width="370"
Height="270"
Title="!(loc.InstallDirDlg_Title)">
<Control Type="RadioButtonGroup"
Property="InstallType_Prop"
Id="InstallType"
Width="200"
Height="42"
X="20"
Y="110">
<RadioButtonGroup Property="InstallType_Prop">
<RadioButton Text="Aircraft"
Height="17"
Value="0"
Width="50"
X="0"
Y="0" />
<RadioButton Text="Desktop"
Height="17"
Value="1"
Width="200"
X="0"
Y="20" />
</RadioButtonGroup>
</Control>
</Dialog>
</UI>
</Fragment>
</Wix>
코드 목록 1 (이 별도의 파일에) - 그럼 라디오 버튼
, 이상 내 주요 Product.wxs 파일에, 나는 다음 있습니다.
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product>
<Property Id="InstallType_Prop"
Value="0"/>
.
.
.
<DirectoryRef Id="TARGETDIR">
<Component Id="AircraftRegistryEntries"
Guid="E251C37B-2A4F-46D4-8E9F-24C66FB107E9">
<Condition>InstallType_Prop = 0</Condition>
<RegistryKey Root="HKLM"
Key="Software\Company\Product\v1.0"
Action="createAndRemoveOnUninstall">
<RegistryValue Type="integer"
Name="OfflineMode"
Value="0"/>
<RegistryValue Type="integer"
Name="Simulator"
Value="0"/>
</RegistryKey>
</Component>
<Component Id="DesktopRegistryEntries"
Guid="CACDBBB6-BCAA-4B71-92BE-C762325580A3">
<Condition>InstallType_Prop = 1</Condition>
<RegistryKey Root="HKLM"
Key="Software\Company\Product\v1.0"
Action="createAndRemoveOnUninstall">
<RegistryValue Type="integer"
Name="OfflineMode"
Value="1"/>
<RegistryValue Type="integer"
Name="Simulator"
Value="0"/>
</RegistryKey>
</Component>
</DirectoryRef>
.
.
.
<Feature Id='Complete'
Level='1'>
<ComponentRef Id='AircraftRegistryEntries'/>
<ComponentRef Id='DesktopRegistryEntries'/>
</Feature>
</Product>
</Wix>
코드 목록 2 - 재산 및 레지스트리 항목
그래서당신이 볼 수 있듯이, 라디오 버튼을 InstallType_Prop 연결되어 있습니다.
어떤 라디오 단추를 선택했는지에 따라 적절한 레지스트리 항목을 설치하려고합니다. 레지스트리 구성 요소에 이러한 조건을 삽입했지만 아무 것도하지 않는 것 같습니다.
필자도 이런 식으로하지 않아도됩니다. 데스크톱을 선택하면 OfflineMode를 1로 설정하고 항공기를 선택하면 0으로 설정하면됩니다.
저는 지금 당황하고 있습니다. 해결책은 사용자 지정 동작이나 조건이 평가되는 순서에 달려 있다고 생각하지만 완전히 확신 할 수는 없습니다.
도움을 주시면 감사하겠습니다.