abbodi1406 / vcredist

AIO Repack for latest Microsoft Visual C++ Redistributable Runtimes
The Unlicense
5.62k stars 321 forks source link

Wish: Add check administrative priveledges + info #109

Open Zeroes1 opened 1 week ago

Zeroes1 commented 1 week ago

check VisualCppRedist_AIO_x86_x64_84.zip version

1) Please add check administrative priveledges under account who run VisualCppRedist_AIO_x86_x64.exe

because for install/uninstall need admin priveledges

for example i run VisualCppRedist_AIO_x86_x64.exe /aiR

for detect and delete all packages under domain limit user i see what VisualCppRedist_AIO_x86_x64.exe unpack himself packages run reg.exe run findstr.exe ...

but nothing happens and process VisualCppRedist_AIO_x86_x64.exe don't closed (not exit) i'm wait addition 5 min no happens more, no exit process..

2) Please add to main page project (https://github.com/abbodi1406/vcredist) info about need administrative priveledges for use program

Zeroes1 commented 1 week ago

temporary I resolve it with made BAT file

@echo off

net session >nul 2>&1
if %ERRORLEVEL% == 0 (
VisualCppRedist_AIO_x86_x64.exe /aiR
) else (
if /i "%userdomain%"=="%COMPUTERNAME%" (
    echo %USERNAME% [is Admin: No]
) else (
    echo User: %USERNAME%@%USERDNSDOMAIN% [is Admin: No]
)
echo Warning: for use utility need Administrative priveledges!
)
exit
abbodi1406 commented 1 week ago

Both 7z sfx and the script check for admin privileges, under the normal circumstances reg.exe query "HKU\S-1-5-19"

you case is special i don't know what domain account supposed to be or what privileges it can have

nevertheless, can you run this in command prompt?

whoami /groups | findstr /i /c:"S-1-16-16384" /c:"S-1-16-12288"
Zeroes1 commented 1 week ago

1) At work [Limited Domain User]: reg.exe query "HKU\S-1-5-19" Error. Access denied. ErrorLevel == 1

command: whoami /groups | findstr /i /c:"S-1-16-16384" /c:"S-1-16-12288" nothing output

2)At Home [Acc Admin, UAC Off]: reg.exe query "HKU\S-1-5-19"

HKEY_USERS\S-1-5-19\AppEvents HKEY_USERS\S-1-5-19\Console HKEY_USERS\S-1-5-19\Control Panel HKEY_USERS\S-1-5-19\Environment HKEY_USERS\S-1-5-19\EUDC HKEY_USERS\S-1-5-19\Keyboard Layout HKEY_USERS\S-1-5-19\Microsoft HKEY_USERS\S-1-5-19\Network HKEY_USERS\S-1-5-19\Printers HKEY_USERS\S-1-5-19\SOFTWARE HKEY_USERS\S-1-5-19\System

ErrorLevel == 0 whoami /groups | findstr /i /c:"S-1-16-16384" /c:"S-1-16-12288" Mandatory Label\High Mandatory Label Label S-1-16-12288

abbodi1406 commented 1 week ago

whoami command does not output anything if admin privileges are not detected, as expected

reg.exe query "HKU\S-1-5-19" also gives errorlevel 1, meaning the script should exit without installing but yes, i found that it doesn't auto-exit when ran from 7z sfx as it should, that's why it's stuck

:unadmin
echo ==== ERROR ====
echo This script require administrator privileges.
echo To do so, right click on this script and select 'Run as administrator'
goto :E_Exit

E_Exit routine has prompt

will be fixed in next version