tauri-apps / nsis-tauri-utils

A collection of NSIS plugins written in rust.
Apache License 2.0
16 stars 8 forks source link

NSIS installer fails to install/update in multi-user environment #22

Closed tauri-bot closed 6 months ago

tauri-bot commented 10 months ago

This issue has been upstreamed from https://github.com/tauri-apps/tauri/issues/8223

Describe the bug

Hey! πŸ‘‹

The NSIS installer macro CheckIfAppIsRunning, and it's associated util function get_processes from nsis-tauri-utils does not take into account whether the process is owned by the current user and should when the install mode is set to currentUser.

We have environments utilizing Windows Terminal Services/Remote Desktop Services where there can be multiple users concurrently signed in and the app is installed at the user-level. When the installer/updater checks whether the process is running, it's naively checking based on the process name so in these multi-user environments, it sees multiple processes with the same name running under different users, fails to kill the process, and then fails to install/update.

Reproduction

  1. Create a Tauri app setting the NSIS install mode to currentUser
  2. Install and run the app under one Windows user
  3. In a separate Windows account, attempt to install and run the app and it'll fail

(You can repo with standard Windows Home/Professional, don't need Windows Terminal Services/Remote Desktop Services)

Expected behavior

The NSIS installer, when install mode is set to currentUser, should only check whether the app is running for the current signed in user, not all signed in users.

Platform and versions

[βœ”] Environment
    - OS: Windows 10.0.22000 X64
    βœ” WebView2: 119.0.2151.44
    βœ” MSVC: 
        - Visual Studio Build Tools 2019
        - Visual Studio Community 2022
    βœ” rustc: 1.73.0 (cc66ad468 2023-10-03)
    βœ” cargo: 1.73.0 (9c4383fb5 2023-08-26)
    βœ” rustup: 1.26.0 (5af9b9484 2023-04-05)
    βœ” Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 18.9.0
    - pnpm: 8.10.0
    - yarn: 1.22.19
    - npm: 8.19.1

[-] Packages
    - tauri [RUST]: 1.5.2
    - tauri-build [RUST]: 1.5.0
    - wry [RUST]: 0.24.4
    - tao [RUST]: 0.16.5
    - tauri-cli [RUST]: 1.3.1
    - @tauri-apps/api [NPM]: 1.5.1
    - @tauri-apps/cli [NPM]: 1.5.6

[-] App


### Stack trace

_No response_

### Additional context

_No response_
FabianLars commented 6 months ago

https://github.com/tauri-apps/nsis-tauri-utils/pull/24