Skip to content

Commit

Permalink
Improve wix config
Browse files Browse the repository at this point in the history
  • Loading branch information
fralonra authored Aug 4, 2023
1 parent 5961a46 commit d090465
Showing 1 changed file with 41 additions and 32 deletions.
73 changes: 41 additions & 32 deletions extra/windows/wix/wgshadertoy.wxs
Original file line number Diff line number Diff line change
@@ -1,65 +1,74 @@
<?xml version="1.0" encoding="windows-1252"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Name="WgShadertoy" Id="*" UpgradeCode="618addfc-c365-4f47-80e1-ef53f98917dd" Language="1033" Codepage="1252" Version="0.3.1" Manufacturer="fralonra">
<Product Name="WgShadertoy"
Id="*"
UpgradeCode="618addfc-c365-4f47-80e1-ef53f98917dd"
Language="1033"
Codepage="1252"
Version="0.3.1"
Manufacturer="Fralonra">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/>
<MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of [ProductName] is already installed."/>
<Icon Id="WgShadertoy.exe" SourceFile=".\extra\windows\wgshadertoy.ico"/>
<Icon Id="WgShadertoyIcon" SourceFile=".\extra\windows\wgshadertoy.ico"/>
<WixVariable Id="WixUILicenseRtf" Value=".\extra\windows\wix\license.rtf"/>
<Property Id="ARPPRODUCTICON" Value="WgShadertoy.exe"/>
<Property Id="ARPPRODUCTICON" Value="WgShadertoyIcon"/>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch WgShadertoy"/>
<Property Id="WixShellExecTarget" Value="[#WgShadertoyExeFile]"/>
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes"/>
<MediaTemplate EmbedCab="yes"/>
<UIRef Id="WixUI_InstallDir"/>

<Feature Id="ProductFeature" Title="ConsoleApp" Level="1">
<ComponentRef Id="WgShadertoyExe"/>
<ComponentRef Id="WgShadertoyShortcut"/>
<ComponentRef Id="ModifyPathEnv"/>
<ComponentRef Id="ContextMenu"/>
</Feature>
<UI>
<UIRef Id="WixUI_InstallDir"/>
<Publish Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>

<!-- Create directories -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALLDIR" Name="WgShadertoy"/>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="WgShadertoyProgramMenu" Name="WgShadertoy"/>
<Directory Id="ProgramMenu" Name="WgShadertoy"/>
</Directory>
</Directory>

<!-- Application binaries -->
<DirectoryRef Id="INSTALLDIR">
<Component Id="WgShadertoyExe" Guid="*">
<File Id="WgShadertoyExeFile" Source=".\target\release\wgshadertoy.exe" Name="wgshadertoy.exe" KeyPath="yes"/>
<File Id="WgShadertoyExeFile" Source=".\target\release\wgshadertoy.exe" Name="wgshadertoy.exe" KeyPath="yes" Checksum="yes"/>
</Component>
</DirectoryRef>

<DirectoryRef Id="WgShadertoyProgramMenu">
<!-- Application shortcut -->
<Component Id="WgShadertoyShortcut" Guid="826d2913-4ba4-4ab2-951e-0506f62522d4">
<Shortcut Id="WgShadertoyShortcutFile" Icon="WgShadertoy.exe" Name="WgShadertoy" Description="Description" Target="[INSTALLDIR]wgshadertoy.exe"/>
<RemoveFolder Id="WgShadertoyProgramMenu" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\WgShadertoy" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
<DirectoryRef Id="ProgramMenu">
<Component Id="Shortcut" Guid="*">
<Shortcut Id="ShortcutFile"
Icon="WgShadertoyIcon"
Name="WgShadertoy"
Description="A WGSL playground inspired by Shadertoy"
Target="[!WgShadertoyExeFile]"
WorkingDirectory="INSTALLDIR"/>
<Shortcut Id="UninstallProduct"
Name="Uninstall WgShadertoy"
Target="[SystemFolder]msiexec.exe"
Arguments="/x [ProductCode]"
Description="Uninstalls WgShadertoy" />
<RemoveFolder Id="ProgramMenu" Directory="ProgramMenu" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Fralonra\WgShadertoy" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>

<DirectoryRef Id="INSTALLDIR">
<!-- Add to PATH -->
<Component Id="ModifyPathEnv" Guid="856af15d-9368-47c9-a6af-8aec2d549619" KeyPath="yes">
<Environment Id="PathEnv" Value="[INSTALLDIR]" Name="PATH" Permanent="no" Part="first" Action="set" System="yes"/>
</Component>
</DirectoryRef>

<DirectoryRef Id="TARGETDIR">
<!-- Add context menu -->
<Component Id="ContextMenu" Guid="a58956dd-6acc-4d13-a7d4-639595519d29">
<RegistryKey Root="HKCU" Key="Software\Classes\Directory\Background\shell\Open WgShadertoy here\command">
<RegistryValue Type="string" Value="[INSTALLDIR]wgshadertoy.exe &quot;%V&quot;" KeyPath="yes"/>
</RegistryKey>
<RegistryKey Root="HKCU" Key="Software\Classes\Directory\Background\shell\Open WgShadertoy here">
<RegistryValue Type="string" Name="Icon" Value="[INSTALLDIR]wgshadertoy.exe"/>
</RegistryKey>
</Component>
</DirectoryRef>
<Feature Id="MainApplicatiton" Title="Main Application" Level="1">
<ComponentRef Id="WgShadertoyExe"/>
<ComponentRef Id="Shortcut"/>
<ComponentRef Id="ModifyPathEnv"/>
</Feature>
</Product>
</Wix>

0 comments on commit d090465

Please sign in to comment.