GitCorner

Code

ossartcraftfigcraft🌐
b45255bb6fe2
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
  <?ifndef HasCraftFontLicences ?>
  <?define HasCraftFontLicences=0 ?>
  <?endif?>
  <Package Name="FigCraft" Manufacturer="Learning Machines LLC" Version="$(var.Version)" UpgradeCode="7F8B9827-D065-41B7-A514-2A454B21F484" Scope="perUserOrMachine" Compressed="yes" Language="1033">
    <SummaryInformation Description="FigCraft interface design and prototyping tool" Manufacturer="Learning Machines LLC" />
    <?include $(sys.SOURCEFILEDIR)install-policy.wxi?>
    <!-- Same-version upgrades let successive pre-releases of one X.Y.Z replace each other
         (MSI versions are numeric, so 1.2.3-rc.1 and 1.2.3-rc.2 are both 1.2.3). -->
    <MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of FigCraft is already installed." />
    <MediaTemplate EmbedCab="yes" CompressionLevel="high" />

    <!-- MSI caches this icon using its Id as the filename. Advertised shortcuts to an
         .exe need an .exe icon identifier (ICE50), even when the source is an ICO. -->
    <Icon Id="FigcraftIcon.exe" SourceFile="$(var.IconPath)" />
    <Property Id="ARPPRODUCTICON" Value="FigcraftIcon.exe" />
    <Property Id="ARPURLINFOABOUT" Value="https://getartcraft.com/apps/figcraft" />
    <Property Id="ARPURLUPDATEINFO" Value="https://getartcraft.com/apps/figcraft" />
    <Property Id="ARPHELPLINK" Value="https://discord.gg/artcraft" />

    <StandardDirectory Id="ProgramFiles6432Folder">
      <Directory Id="CraftSuiteFolder" Name="ArtCraft">
        <Directory Id="INSTALLFOLDER" Name="FigCraft" />
      </Directory>
    </StandardDirectory>
    <StandardDirectory Id="ProgramMenuFolder" />

    <!-- An upgrade installs where the user put the previous version (written by FigcraftApp). -->

    <Feature Id="Main" Title="FigCraft" Level="1">
      <?if $(var.HasCraftFontLicences) = 1 ?>
      <ComponentGroupRef Id="CraftFontLicences" />
      <?endif?>
      <ComponentGroupRef Id="FigcraftFiles" />
    </Feature>

    <!-- The setup wizard: WixUI_InstallDir without its licence page (the code is MIT OR
         Apache-2.0; there is nothing to accept). A later NewDialog on the same button wins. -->
    <ui:WixUI Id="WixUI_InstallDir" InstallDirectory="INSTALLFOLDER" />
    <UI>
      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2" Condition="NOT Installed" />
      <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2" />
      <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchFigcraft" Condition="WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 AND NOT Installed" />
    </UI>
    <!-- Our own art, generated by package.ps1 from the app icon (not WiX's stock bitmaps). -->
    <WixVariable Id="WixUIBannerBmp" Value="$(var.BannerBmp)" />
    <WixVariable Id="WixUIDialogBmp" Value="$(var.DialogBmp)" />

    <!-- The full version (Version is numeric, so it drops a pre-release tag), shown on the wizard's
         pages through figcraft.en-us.wxl. -->
    <Property Id="FigcraftVersion" Value="$(var.DisplayVersion)" />

    <!-- Finish page: say where to find the app, and offer to start it (ticked by default). -->
    <Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="FigCraft $(var.DisplayVersion) is installed. You can start it any time from the Start menu." />
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch FigCraft" />
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
    <Property Id="WixShellExecTarget" Value="[#FigcraftExe]" />
    <!-- Runs in the wizard's own (unelevated) process, so the app starts as the user, not as admin. -->
    <CustomAction Id="LaunchFigcraft" BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)" DllEntry="WixShellExec" Impersonate="yes" Return="ignore" />
  </Package>

  <Fragment>
    <?if $(var.HasCraftFontLicences) = 1 ?>
    <ComponentGroup Id="CraftFontLicences" Directory="INSTALLFOLDER">
      <Files Include="$(var.DocsDir)\**" />
    </ComponentGroup>
    <?endif?>
    <ComponentGroup Id="FigcraftFiles" Directory="INSTALLFOLDER">
      <Component Id="FigcraftApp" Guid="238228C3-4C1D-4B33-8C5D-C31B65BC2DA4">
        <File Id="FigcraftNotice" Source="$(var.BinDir)\NOTICE" KeyPath="no" />
        <File Id="FigcraftExe" Source="$(var.BinDir)\figcraft.exe" KeyPath="yes">
          <Shortcut Id="StartMenuShortcut" Directory="ProgramMenuFolder" Name="FigCraft" Description="FigCraft interface design and prototyping" WorkingDirectory="INSTALLFOLDER" Advertise="yes" Icon="FigcraftIcon.exe" IconIndex="0" />
        </File>

        <!-- .figcraft: FigCraft's own format; FigCraft is its default app. -->
        <ProgId Id="Figcraft.Document" Description="FigCraft Document" Icon="FigcraftExe" IconIndex="0">
          <Extension Id="figcraft" ContentType="application/x-figcraft">
            <Verb Id="open" Command="Open" TargetFile="FigcraftExe" Argument="&quot;%1&quot;" />
          </Extension>
        </ProgId>
        <!-- SVG and images: offered under "Open with", never forced as the default. -->
        <ProgId Id="Figcraft.Image" Description="Image" Icon="FigcraftExe" IconIndex="0" />
        <RegistryValue Root="HKMU" Key="Software\Classes\Figcraft.Image\shell\open\command" Value="&quot;[#FigcraftExe]&quot; &quot;%1&quot;" Type="string" />
        <RegistryValue Root="HKMU" Key="Software\Classes\.svg\OpenWithProgids" Name="Figcraft.Image" Value="" Type="string" />
        <RegistryValue Root="HKMU" Key="Software\Classes\.png\OpenWithProgids" Name="Figcraft.Image" Value="" Type="string" />
        <RegistryValue Root="HKMU" Key="Software\Classes\.jpg\OpenWithProgids" Name="Figcraft.Image" Value="" Type="string" />
        <RegistryValue Root="HKMU" Key="Software\Classes\.jpeg\OpenWithProgids" Name="Figcraft.Image" Value="" Type="string" />
        <!-- Sketch files (opened as a copy; FigCraft doesn't save .sketch): "Open with" only too. -->
        <ProgId Id="Figcraft.Sketch" Description="Sketch Document" Icon="FigcraftExe" IconIndex="0" />
        <RegistryValue Root="HKMU" Key="Software\Classes\Figcraft.Sketch\shell\open\command" Value="&quot;[#FigcraftExe]&quot; &quot;%1&quot;" Type="string" />
        <RegistryValue Root="HKMU" Key="Software\Classes\.sketch\OpenWithProgids" Name="Figcraft.Sketch" Value="" Type="string" />

        <!-- "Open with" app list and the Run dialog (Win+R "figcraft"). -->
        <RegistryValue Root="HKMU" Key="Software\Classes\Applications\figcraft.exe" Name="FriendlyAppName" Value="FigCraft" Type="string" />
        <RegistryValue Root="HKMU" Key="Software\Classes\Applications\figcraft.exe\shell\open\command" Value="&quot;[#FigcraftExe]&quot; &quot;%1&quot;" Type="string" />
        <RegistryValue Root="HKMU" Key="Software\Classes\Applications\figcraft.exe\SupportedTypes" Name=".figcraft" Value="" Type="string" />
        <RegistryValue Root="HKMU" Key="Software\Classes\Applications\figcraft.exe\SupportedTypes" Name=".svg" Value="" Type="string" />
        <RegistryValue Root="HKMU" Key="Software\Classes\Applications\figcraft.exe\SupportedTypes" Name=".png" Value="" Type="string" />
        <RegistryValue Root="HKMU" Key="Software\Classes\Applications\figcraft.exe\SupportedTypes" Name=".jpg" Value="" Type="string" />
        <RegistryValue Root="HKMU" Key="Software\Classes\Applications\figcraft.exe\SupportedTypes" Name=".jpeg" Value="" Type="string" />
        <RegistryValue Root="HKMU" Key="Software\Classes\Applications\figcraft.exe\SupportedTypes" Name=".sketch" Value="" Type="string" />
        <RegistryValue Root="HKMU" Key="Software\Microsoft\Windows\CurrentVersion\App Paths\figcraft.exe" Value="[#FigcraftExe]" Type="string" />
        <RegistryValue Root="HKMU" Key="Software\FigCraft" Name="InstallDir" Value="[INSTALLFOLDER]" Type="string" />
      </Component>

<?if $(var.HasCli) = 1 ?>
      <Component Id="FigcraftCli">
        <File Id="FigcraftCliExe" Source="$(var.BinDir)\figcraft-cli.exe" KeyPath="yes" />
      </Component>
<?endif?>
    </ComponentGroup>
  </Fragment>
</Wix>