microsoft / microsoft/msix-packaging

Relaunching as admin for msixmgr depends on having msixmgr.exe in %PATH%.

Open
#390 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-MSIX Core Bug
Dominant language
C
Stars
1.1k
Forks
193
Avg merge
2h 16m
Merged PRs (30d)
2

Description

Project
Win7Msix

Describe the bug
We've had a few reports recently that the installation of msix packages wasn't working on windows 7. The reported error was "Windows cannot find 'msixmgr.exe'. Make sure you typed the name correctly, and then try again." when launching the msix file. I investigated further and found out that because environment variables are inherited when launching sub processes, if you install msixmgr from any browser (Chrome in this instance), and then without restarting it try to install the msix package the error would occur.

To Reproduce

  1. On Windows 7 open chrome or edge browser
  2. Download and install msixmgr without closing the browser
  3. Download / launch any msix package

Expected behavior
The msix package installation is successfully initiated.

Screenshots
Screenshot

Platform
Windows 7 SP1

Additional context
I think the problem is in how relaunching as admin is implemented.
https://github.com/microsoft/msix-packaging/blob/e00e737ba572fdedf561b0f246bac56821f95603/MsixCore/msixmgr/msixmgr.cpp#L103-L108

The issue is that lpFile is not the full path to msixmgr.exe. Since the exe is already executing we can use GetModuleFileNameW as it is done here: https://github.com/microsoft/msix-packaging/blob/e00e737ba572fdedf561b0f246bac56821f95603/MsixCore/msixmgr/msixmgr.cpp#L35-L36 to obtain full path and use it instead.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in MsixCore/msixmgr/msixmgr.cpp, especially the relaunch-as-admin code at lines 103-108 and the existing GetModuleFileNameW use near lines 35-36. Reproduce the Windows 7 browser-install scenario, then verify that relaunching works without requiring msixmgr.exe in the inherited PATH.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.