kalker/kalk_cli/wix/main.wxs

64 lines
3.2 KiB
Plaintext
Raw Normal View History

<?xml version="1.0" encoding="windows-1252"?>
<!--
Please do not remove these pre-processor If-Else blocks. These are used with
the `cargo wix` subcommand to automatically determine the installation
destination for 32-bit versus 64-bit installers. Removal of these lines will
cause installation errors.
-->
<?if $(var.Platform) = x64 ?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define Win64 = "no" ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Name="Kalk" Id="*" UpgradeCode="F9D116C9-E90A-4956-803E-D8A7D324D434" Language="1033" Codepage="1252" Version="$(var.Version)" Manufacturer="Kalk">
<Package InstallerVersion="450" Compressed="yes" InstallScope="perMachine" Platform='$(var.Platform)'/>
<MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of [ProductName] is already installed."/>
<Icon Id="KalkIco" SourceFile=".\kalk.ico"/>
<WixVariable Id="WixUILicenseRtf" Value=".\wix/License.rtf"/>
<Property Id="ARPPRODUCTICON" Value="KalkIco"/>
<MediaTemplate EmbedCab="yes"/>
<UIRef Id="WixUI_Minimal"/>
<Feature Id="ProductFeature" Title="ConsoleApp" Level="1">
<ComponentRef Id="KalkExe"/>
<ComponentRef Id="KalkShortcut"/>
<ComponentRef Id="ModifyPathEnv"/>
</Feature>
<!-- Create directories -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.PlatformProgramFilesFolder)">
<Directory Id="KalkProgramFiles" Name="Kalk"/>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="KalkProgramMenu" Name="Kalk"/>
</Directory>
</Directory>
<!-- Application binaries -->
<DirectoryRef Id="KalkProgramFiles">
<Component Id="KalkExe" Guid="*" Win64='$(var.Win64)'>
<File Id="KalkExeFile" Source="..\target\release\kalk.exe" Name="kalk.exe" KeyPath="yes"/>
</Component>
</DirectoryRef>
<DirectoryRef Id="KalkProgramMenu">
<!-- Application shortcut -->
<Component Id="KalkShortcut" Guid="aa36e61a-23cd-4383-b744-2f78e912f0dc" Win64='$(var.Win64)'>
<Shortcut Id="KalkShortcutFile" Name="Kalk" Description="A calculator" Target="[KalkProgramFiles]kalk.exe"/>
<RemoveFolder Id="KalkProgramMenu" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\kalk" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<DirectoryRef Id="KalkProgramFiles">
<!-- Add to PATH -->
<Component Id="ModifyPathEnv" Guid="edf0b679-9eb6-46f7-a5d1-5160f30acb34" KeyPath="yes" Win64='$(var.Win64)'>
<Environment Id="PathEnv" Value="[KalkProgramFiles]" Name="PATH" Permanent="no" Part="first" Action="set" System="yes"/>
</Component>
</DirectoryRef>
</Product>
</Wix>