sumatrapdfreader / sumatrapdf

SumatraPDF reader
http://www.sumatrapdfreader.org
GNU General Public License v3.0
13.75k stars 1.74k forks source link

Silent "all users" installation of SumatraPDF 3.5.2 fails if not in admin CMD #4559

Open bfg01 opened 1 month ago

bfg01 commented 1 month ago

SumatraPDF version

Describe the bug Trying to install in "silent" mode for all users instead of default user via command line; this fails if CMD was not run as administrator beforehand. Whether successful or failed, there is no output in command line, but if echoing variable "%errorlevel%" after running the command it outputs plain '0' when successful and plain '1' when failed. I know this should be a logical result, but I actually expected for SumatraPDF installer to call UAC in case CMD session was not admin.

To Reproduce Steps to reproduce the behavior:

  1. Open CMD as normal user
  2. SumatraPDF-3.5.2-64-install.exe -s -all-users -with-filter -with-preview
  3. echo %errorlevel%
  4. See if anything is installed

Expected behavior For SumatraPDF to call UAC in case CMD session is not admin

File that reproduces the problem Not applicable

Screenshots Not applicable

Additional context Not applicable

GitHubRulesOK commented 1 month ago

silent means no feedback in most apps thus I personally would expect same as for printing dont use silent or else you cant see what is failing. Filter and Preview are system level functions needing to attack the registry by a "TrustedInstaller" (same as re-wiring a house)

If a user environment is not elevated then dont run as "all users" without admin password somewhere in the mix.

RUNAS USAGE:

RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ]
        /user:<UserName> program

RUNAS [ [/noprofile | /profile] [/env] [/savecred] ]
        /smartcard [/user:<UserName>] program

RUNAS /trustlevel:<TrustLevel> program

   /noprofile        specifies that the user's profile should not be loaded.
                     This causes the application to load more quickly, but
                     can cause some applications to malfunction.
   /profile          specifies that the user's profile should be loaded.
                     This is the default.
   /env              to use current environment instead of user's.
   /netonly          use if the credentials specified are for remote
                     access only.
   /savecred         to use credentials previously saved by the user.
   /smartcard        use if the credentials are to be supplied from a
                     smartcard.
   /user             <UserName> should be in form USER@DOMAIN or DOMAIN\USER
   /showtrustlevels  displays the trust levels that can be used as arguments
                     to /trustlevel.
   /trustlevel       <Level> should be one of levels enumerated
                     in /showtrustlevels.
   program         command line for EXE.  See below for examples