Files
Marcos Paulo 7db396618e
Packaging lint / lint (push) Has been cancelled
ci / ci (macos-latest) (push) Has been cancelled
ci / ci (ubuntu-latest) (push) Has been cancelled
ci / ci (windows-latest) (push) Has been cancelled
feat(release): packaging for macOS, Windows and Linux; app icon; xtask version/ico; plain launch reopens the last vault or asks for a folder; --version
Packaging is ported from the Craft family (effectcraft): DMG built and smoke-tested on
macOS aarch64, MSI/deb/rpm scripts adapted, thin release.yml and packaging-lint.yml callers.
rfd 0.17 added (native folder dialog; same version the other Craft apps use).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 12:48:09 -03:00

102 lines
5.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
NotesCraft MSI (WiX Toolset v5: `dotnet tool install -g wix`). Built by package.ps1:
wix build notescraft.wxs installer-ui.wxs -arch x64 -d Version=1.2.3 -d BinDir=... -d IconPath=... -o out.msi
Per-machine install into Program Files (or a folder the user picks), a Start Menu shortcut and,
unless DESKTOPSHORTCUT=0 (the wizard's "Create a desktop shortcut" box), a desktop shortcut.
-->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package
Name="NotesCraft"
Manufacturer="The NotesCraft authors"
Version="$(var.Version)"
UpgradeCode="BFE3142F-AE3C-44AB-8680-D3F8535A0521"
Scope="perMachine"
Compressed="yes"
Language="1033">
<SummaryInformation Description="NotesCraft, a native Obsidian-compatible markdown notes app" Manufacturer="The NotesCraft authors" />
<!-- 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 NotesCraft is already installed." />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<!-- The setup wizard (installer-ui.wxs): pick the folder on a fresh install. -->
<UIRef Id="NotesCraftUI" />
<Icon Id="NotesCraftIcon.ico" SourceFile="$(var.IconPath)" />
<Property Id="ARPPRODUCTICON" Value="NotesCraftIcon.ico" />
<Property Id="ARPURLINFOABOUT" Value="https://git.marcospaulo.dev.br/masi/notescraft" />
<Property Id="ARPURLUPDATEINFO" Value="https://git.marcospaulo.dev.br/masi/notescraft" />
<Property Id="ARPHELPLINK" Value="https://git.marcospaulo.dev.br/masi/notescraft/issues" />
<!-- An upgrade, repair or silent reinstall goes where the installed copy already is: the App Paths
"Path" value written below, or for releases before this installer change (no Path value; they
could be put elsewhere with INSTALLFOLDER=...) the folder of the notescraft.exe that App Paths names. A
"file" search with no FileSearch inside yields that file's folder. A folder passed on the
command line (INSTALLFOLDER=...) wins. -->
<Property Id="INSTALLFOLDER" Secure="yes" />
<Property Id="PREVIOUSINSTALLFOLDER" Secure="yes">
<RegistrySearch Id="PreviousInstallFolder" Root="HKLM" Type="directory"
Key="Software\Microsoft\Windows\CurrentVersion\App Paths\notescraft.exe" Name="Path" />
</Property>
<Property Id="PREVIOUSEXEFOLDER" Secure="yes">
<RegistrySearch Id="PreviousExeFolder" Root="HKLM" Type="file"
Key="Software\Microsoft\Windows\CurrentVersion\App Paths\notescraft.exe" />
</Property>
<SetProperty Id="INSTALLFOLDER" Value="[PREVIOUSINSTALLFOLDER]" After="AppSearch" Sequence="both"
Condition="PREVIOUSINSTALLFOLDER AND NOT INSTALLFOLDER" />
<SetProperty Id="INSTALLFOLDER" Action="SetINSTALLFOLDERFromExe" Value="[PREVIOUSEXEFOLDER]"
After="SetINSTALLFOLDER" Sequence="both" Condition="PREVIOUSEXEFOLDER AND NOT INSTALLFOLDER" />
<!-- The desktop shortcut: on by default for a fresh install (a box in the wizard, or
DESKTOPSHORTCUT=0 silently); an upgrade keeps what the installed copy chose, and adds none
to an install from before this option. -->
<Property Id="DESKTOPSHORTCUT" Value="1" Secure="yes" />
<Property Id="PREVIOUSDESKTOPSHORTCUT" Secure="yes">
<RegistrySearch Id="PreviousDesktopShortcut" Root="HKLM" Type="raw" Key="Software\NotesCraft" Name="DesktopShortcut" />
</Property>
<SetProperty Id="DESKTOPSHORTCUT" Value="[PREVIOUSDESKTOPSHORTCUT]" After="SetINSTALLFOLDERFromExe" Sequence="both"
Condition="WIX_UPGRADE_DETECTED" />
<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="INSTALLFOLDER" Name="NotesCraft" />
</StandardDirectory>
<StandardDirectory Id="ProgramMenuFolder" />
<StandardDirectory Id="DesktopFolder" />
<Feature Id="Main" Title="NotesCraft" Level="1">
<ComponentGroupRef Id="NotesCraftFiles" />
</Feature>
</Package>
<Fragment>
<ComponentGroup Id="NotesCraftFiles" Directory="INSTALLFOLDER">
<Component Id="NotesCraftApp" Guid="0A6A8DAF-F2B0-43DD-8BF5-02D70F153EC3">
<File Id="NotesCraftExe" Source="$(var.BinDir)\notescraft.exe" KeyPath="yes">
<Shortcut Id="StartMenuShortcut" Directory="ProgramMenuFolder" Name="NotesCraft"
Description="NotesCraft, a native Obsidian-compatible markdown notes app" WorkingDirectory="INSTALLFOLDER" Advertise="yes"
Icon="NotesCraftIcon.ico" IconIndex="0" />
</File>
<RegistryValue Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\App Paths\notescraft.exe" Value="[#NotesCraftExe]" Type="string" />
<RegistryValue Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\App Paths\notescraft.exe" Name="Path" Value="[INSTALLFOLDER]" Type="string" />
<!-- The desktop shortcut choice, for the next upgrade (empty: none). -->
<RegistryValue Root="HKLM" Key="Software\NotesCraft" Name="DesktopShortcut" Value="[DESKTOPSHORTCUT]" Type="string" />
</Component>
<Component Id="NotesCraftCli">
<File Id="NotesCraftCliExe" Source="$(var.BinDir)\notescraft-cli.exe" KeyPath="yes" />
</Component>
<!-- A component under the user's profile folders needs an HKCU key path (ICE38, ICE43). -->
<Component Id="DesktopShortcut" Directory="DesktopFolder" Condition="DESKTOPSHORTCUT = &quot;1&quot;">
<Shortcut Id="DesktopShortcut" Name="NotesCraft" Description="NotesCraft, a native Obsidian-compatible markdown notes app"
Target="[#NotesCraftExe]" WorkingDirectory="INSTALLFOLDER" Icon="NotesCraftIcon.ico" IconIndex="0" />
<RegistryValue Root="HKCU" Key="Software\NotesCraft" Name="DesktopShortcut" Value="1" Type="string" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>