<?xml version="1.0" encoding="utf-8"?>
<?if $(sys.BUILDARCH) = arm64 ?>
<?define UpgradeCode = "2A989A66-36FE-4999-ACE2-3E79AE02D12A" ?>
<?else?>
<?define UpgradeCode = "981D0C70-179E-4EE8-8F1E-0EB6877EAE94" ?>
<?endif?>
<?ifndef IconFile ?>
<?define IconFile = "$(sys.SOURCEFILEDIR)..\..\design\icon\openlogi.ico" ?>
<?endif?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
<Package Name="OpenLogi"
Manufacturer="AprilNEA"
Version="$(var.Version)"
UpgradeCode="$(var.UpgradeCode)"
Language="1033"
Scope="perUser"
Compressed="yes">
<MajorUpgrade DowngradeErrorMessage="A newer version of OpenLogi is already installed." />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<StandardDirectory Id="LocalAppDataFolder">
<Directory Id="ProgramsFolder" Name="Programs">
<Directory Id="INSTALLFOLDER" Name="OpenLogi" />
</Directory>
</StandardDirectory>
<ComponentGroup Id="App" Directory="INSTALLFOLDER">
<Component Id="MainExecutable">
<File Id="OpenLogiExe" Name="OpenLogi.exe" Source="$(var.ExeFile)" KeyPath="yes" />
</Component>
<Component Id="AgentExecutable">
<File Id="OpenLogiAgentExe" Name="openlogi-agent.exe" Source="$(var.AgentExeFile)" KeyPath="yes" />
</Component>
</ComponentGroup>
<util:CloseApplication Id="CloseAgent"
Target="openlogi-agent.exe"
CloseMessage="no"
RebootPrompt="no"
Timeout="2"
TerminateProcess="0" />
<util:CloseApplication Id="CloseGui"
Target="OpenLogi.exe"
CloseMessage="yes"
RebootPrompt="no"
Timeout="5"
TerminateProcess="0" />
<StandardDirectory Id="ProgramMenuFolder">
<Component Id="StartMenuShortcut">
<Shortcut Id="OpenLogiShortcut"
Name="OpenLogi"
Target="[INSTALLFOLDER]OpenLogi.exe"
WorkingDirectory="INSTALLFOLDER" />
<RegistryValue Root="HKCU"
Key="Software\OpenLogi"
Name="Installed"
Type="integer"
Value="1"
KeyPath="yes" />
</Component>
</StandardDirectory>
<Feature Id="Main">
<ComponentGroupRef Id="App" />
<ComponentRef Id="StartMenuShortcut" />
</Feature>
<Icon Id="OpenLogiIco" SourceFile="$(var.IconFile)" />
<Property Id="ARPPRODUCTICON" Value="OpenLogiIco" />
<Property Id="ARPURLINFOABOUT" Value="https://openlogi.org" />
<Property Id="ARPHELPLINK" Value="https://github.com/AprilNEA/OpenLogi" />
</Package>
</Wix>