pixi icon indicating copy to clipboard operation
pixi copied to clipboard

Windows MSI default installation needs '--force' to update

Open mixib opened this issue 1 year ago • 1 comments

Checks

  • [X] I have checked that this issue has not already been reported.

  • [X] I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

  1. Install pixi from pixi-x86_64-pc-windows-msvc.msi Release v0.25.0, keeping the defaults.
  2. See two pixi additions to Path: PATH= ...; $Env:LocalAppData\pixi\bin\; $Env:USERPROFILE\.pixi\bin
  3. Run update script
> pixi self-update
  x pixi is not installed in the default location:
  |
  | - Default pixi location: $Env:USERPROFILE\.pixi\bin\pixi.exe
  | - Pixi location detected: $Env:LocalAppData\pixi\bin\pixi.exe
  |
  | It can happen when pixi has been installed via a dedicated package manager (such as Homebrew on macOS).
  | You can always use `pixi self-update --force` to force the update.
> pixi self-update --force
pixi is already up-to-date (version 0.25.0)

It is possible to Uninstall pixi when clicking on Uninstall via the Add or remove programs feature of the Windows Control Panel. This removes both additions to Path.

Issue description

The documentation indicates that $Env:LocalAppData is the default PIXI_HOME when installing on Windows. This seems to match #L90 in main.wxs. However, #L132 refers to $Env:USERPROFILE\.pixi\bin.

Besides, the installation via PowerShell matches the table under the Installer Script Options for Windows but deviates from the description under the Windows Installation tab.

Expected behavior

I would expect pixi self-update to work without the --force flag when the default location from the MSI was kept.

For the installation via MSI, only the folder where pixi is installed should have been added.

The basic differences between the installations via PowerShell and the MSI could be better documented. While both installations have the same output to pixi info, the installations are not equivalent.

> pixi info
      Pixi version: 0.25.0
          Platform: win-64
  Virtual packages: __win=0=0
                  : __archspec=1=skylake
         Cache dir: $Env:LocalAppData\rattler/cache
      Auth storage: $Env:USERPROFILE\.rattler\credentials.json
PowerShell MSI
Indexed in Control Panel No Yes
PIXI_HOME $Env:USERPROFILE\.pixi $Env:LocalAppData\pixi
Additions to path $Env:USERPROFILE\.pixi\bin $Env:LocalAppData\pixi\bin
$Env:USERPROFILE\.pixi\bin
Command for updating pixi self-update pixi self-update --force

mixib avatar Jul 13 '24 22:07 mixib

Thanks for the report! Will take a look!

ruben-arts avatar Jul 14 '24 16:07 ruben-arts