tsafe-cli 1.0.21

tsafe CLI — local secret and credential manager (replaces .env files)
Documentation
<?xml version='1.0' encoding='windows-1252'?>
<!--
  WiX installer descriptor for tsafe CLI (tsafe.exe).

  Built by: cargo wix -p tsafe-cli -t x86_64-pc-windows-msvc (no-build)

  $(var.Version)           injected by cargo-wix from workspace Cargo.toml at build time.
  $(var.CargoTargetBinDir) injected by cargo-wix; resolves to
                           target/triple/release in no-build mode.

  GUIDs are stable. Never change UpgradeCode or component GUIDs once the product
  has been distributed: doing so breaks Windows Installer upgrade detection.

  Vault data lives under %APPDATA%\tsafe\ (or TSAFE_VAULT_DIR override).
  The uninstaller intentionally does NOT touch vault data - secrets are user data.
  To wipe vault data manually: tsafe profile delete NAME (future command)

  Native messaging: tsafe-nativehost.exe is installed beside tsafe.exe. Manual
  registration remains a post-install operator step because the browser extension
  ID is channel/browser specific. Build tsafe-nativehost before `cargo wix`
  (see scripts/build/build-msi.ps1).
-->
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'
     xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>

  <Product
    Id='*'
    Name='tsafe'
    UpgradeCode='4F9D2A7E-C831-4B56-9E0A-7D8F3C2E15B4'
    Manufacturer='ABS Infrastructure Engineering'
    Language='1033'
    Codepage='1252'
    Version='$(var.Version)'>

    <Package
      Id='*'
      Keywords='Installer'
      Description='tsafe CLI — local secret and credential manager'
      Comments='Developed by Ryan Tilcock · ABS Infrastructure Engineering · ryan.tilcock@msamlin.com'
      Manufacturer='ABS Infrastructure Engineering'
      InstallerVersion='450'
      Languages='1033'
      Compressed='yes'
      SummaryCodepage='1252'
      Platform='x64'/>

    <!--
      Upgrade behaviour:
        - In-place upgrade: remove old version first, then install new (no side-by-side).
        - Downgrade blocked with a user-facing message.
    -->
    <MajorUpgrade
      Schedule='afterInstallInitialize'
      AllowDowngrades='no'
      AllowSameVersionUpgrades='no'
      DowngradeErrorMessage='A newer version of tsafe is already installed. Uninstall it first or obtain the newer version.'/>

    <Media Id='1' Cabinet='media1.cab' EmbedCab='yes' DiskPrompt='CD-ROM #1'/>
    <Property Id='DiskPrompt' Value='tsafe Installation'/>

    <!-- Brand icon (used for ARP entry and shortcuts) -->
    <Icon Id='tsafe.ico' SourceFile='$(var.CargoTargetBinDir)\..\..\..\assets\tsafe.ico'/>
    <Property Id='ARPPRODUCTICON' Value='tsafe.ico'/>

    <!-- Minimal UI: progress + finish dialogs only (no folder picker — installs to Program Files). -->
    <!-- Switch to WixUI_InstallDir if a configurable install path is ever required.             -->
    <UIRef Id='WixUI_Minimal'/>
    <WixVariable Id='WixUILicenseRtf' Value='$(var.CargoTargetBinDir)\..\..\..\assets\LICENSE.rtf'/>

    <Directory Id='TARGETDIR' Name='SourceDir'>
      <Directory Id='ProgramFiles64Folder' Name='PFiles'>
        <Directory Id='APPLICATIONFOLDER' Name='tsafe'>

          <!-- tsafe.exe binary -->
          <Component Id='binary0' Guid='8E7C4B3A-F210-4D6E-A9CB-3F5E1D8A2C70'>
            <File
              Id='exe0'
              Name='tsafe.exe'
              DiskId='1'
              Source='$(var.CargoTargetBinDir)\tsafe.exe'
              KeyPath='yes'/>
          </Component>

          <Component Id='NativeHostBinary' Guid='D4E5F6A7-B8C9-4D0E-1F2A-3B4C5D6E7F8A'>
            <File
              Id='nativehost0'
              Name='tsafe-nativehost.exe'
              DiskId='1'
              Source='$(var.CargoTargetBinDir)\tsafe-nativehost.exe'
              KeyPath='yes'/>
          </Component>

          <!--
            Append install folder to system PATH.
            Permanent='no' means the PATH entry is removed automatically on uninstall.
          -->
          <Component Id='PathEnv' Guid='2A5F8D1C-E93B-4A7F-B4E2-6C0D9E3B1F52' KeyPath='yes'>
            <Environment
              Id='PATH'
              Name='PATH'
              Value='[APPLICATIONFOLDER]'
              Permanent='no'
              Part='last'
              Action='set'
              System='yes'/>
          </Component>

        </Directory>
      </Directory>

      <!--
        Desktop shortcut → tsafe.exe ui
        Registry key is the KeyPath (required by WiX); removed with the component on uninstall.
      -->
      <Directory Id='DesktopFolder' Name='Desktop'>
        <Component Id='DesktopShortcut' Guid='A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D'>
          <Shortcut
            Id='DesktopShortcutLink'
            Name='tsafe'
            Description='tsafe — local secret and credential manager'
            Target='[APPLICATIONFOLDER]tsafe.exe'
            Arguments='ui'
            Icon='tsafe.ico'
            WorkingDirectory='APPLICATIONFOLDER'/>
          <RemoveFolder Id='RemoveDesktopFolder' Directory='DesktopFolder' On='uninstall'/>
          <RegistryValue
            Root='HKCU'
            Key='Software\ABS\tsafe'
            Name='DesktopShortcut'
            Type='integer'
            Value='1'
            KeyPath='yes'/>
        </Component>
      </Directory>

      <!-- Start Menu folder: tsafe\ with launch + uninstall shortcuts -->
      <Directory Id='ProgramMenuFolder'>
        <Directory Id='ApplicationProgramsFolder' Name='tsafe'>

          <Component Id='StartMenuShortcut' Guid='B2C3D4E5-F6A7-4B8C-9D0E-1F2A3B4C5D6E'>
            <Shortcut
              Id='StartMenuLaunchLink'
              Name='tsafe'
              Description='Launch tsafe vault UI'
              Target='[APPLICATIONFOLDER]tsafe.exe'
              Arguments='ui'
              Icon='tsafe.ico'
              WorkingDirectory='APPLICATIONFOLDER'/>
            <!-- Uninstall shortcut — standard Windows convention -->
            <Shortcut
              Id='StartMenuUninstallLink'
              Name='Uninstall tsafe'
              Description='Remove tsafe from this computer'
              Target='[SystemFolder]msiexec.exe'
              Arguments='/x [ProductCode]'
              Icon='tsafe.ico'/>
            <RemoveFolder Id='RemoveStartMenuFolder' Directory='ApplicationProgramsFolder' On='uninstall'/>
            <RegistryValue
              Root='HKCU'
              Key='Software\ABS\tsafe'
              Name='StartMenuShortcut'
              Type='integer'
              Value='1'
              KeyPath='yes'/>
          </Component>

          <!-- Clean up the ABS registry key tree on uninstall -->
          <Component Id='RegistryCleanup' Guid='C3D4E5F6-A7B8-4C9D-0E1F-2A3B4C5D6E7F'>
            <RegistryValue
              Root='HKCU'
              Key='Software\ABS\tsafe'
              Name='Installed'
              Type='integer'
              Value='1'
              KeyPath='yes'/>
            <RemoveRegistryKey
              Root='HKCU'
              Key='Software\ABS\tsafe'
              Action='removeOnUninstall'/>
          </Component>

        </Directory>
      </Directory>

    </Directory>

    <Feature
      Id='DefaultFeature'
      Title='tsafe'
      Level='1'>
      <ComponentRef Id='binary0'/>
      <ComponentRef Id='NativeHostBinary'/>
      <ComponentRef Id='PathEnv'/>
      <ComponentRef Id='DesktopShortcut'/>
      <ComponentRef Id='StartMenuShortcut'/>
      <ComponentRef Id='RegistryCleanup'/>
    </Feature>

    <CustomAction
      Id='UnregisterNativeHostOnUninstall'
      FileKey='exe0'
      ExeCommand='browser-native-host unregister'
      Execute='deferred'
      Impersonate='yes'
      Return='ignore'/>

    <InstallExecuteSequence>
      <Custom Action='UnregisterNativeHostOnUninstall' Before='RemoveFiles'>REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE</Custom>
    </InstallExecuteSequence>

    <!-- Add/Remove Programs metadata -->
    <SetProperty Id='ARPINSTALLLOCATION' Value='[APPLICATIONFOLDER]' After='CostFinalize'/>
    <Property Id='ARPCONTACT'       Value='Ryan Tilcock'/>
    <Property Id='ARPHELPLINK'      Value='https://dev.azure.com/tsafe'/>
    <Property Id='ARPURLINFOABOUT'  Value='https://dev.azure.com/tsafe'/>
    <Property Id='ARPURLUPDATEINFO' Value='https://dev.azure.com/tsafe'/>
    <Property Id='ARPCOMMENTS'      Value='Local secret and credential manager. Developer: Ryan Tilcock (ryan.tilcock@msamlin.com) · ABS Infrastructure Engineering.'/>
    <!-- ARPNOMODIFY is set by WixUI_Minimal automatically; no need to repeat it here. -->

  </Product>
</Wix>