This repository was archived by the owner on Apr 9, 2026. It is now read-only.
forked from gerardog/gsudo
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmanual_testing.cmd
More file actions
110 lines (95 loc) · 2.82 KB
/
manual_testing.cmd
File metadata and controls
110 lines (95 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
@echo off
pushd src\gsudo
rmdir /q /s bin
dotnet clean
dotnet build --nologo -c Debug -p:IntegrityOption=DISABLE_INTEGRITY
if %errorlevel% neq 0 (
echo Build failed.
pause
goto end
)
popd
set ELEVATOREXE="%cd%\src\gsudo\bin\Debug\UniGetUI Elevator.exe" >nul 2>&1
set ELEVATIONTEST=pwsh.exe -Command "If ((Fltmc.exe).Count -eq 3) {Write-Host 'NOT running elevated' -ForegroundColor Blue} else { Write-Host 'Running elevated' -ForegroundColor Green};"
@echo | set /p=%*
cls
echo Build has completed. Initiating test sequence. Current process elevation status:
%ELEVATIONTEST%
echo You may run tests from a non-elevated command prompt for the best results.
pause
cls
echo Testing basic elevation. You should see
echo - ONE non-elevated print
echo - ONE uac prompt and ONE elevated print,
echo - ONE non-elevated print.
pause
%ELEVATIONTEST%
%ELEVATOREXE% %ELEVATIONTEST%
%ELEVATIONTEST%
pause
cls
echo Testing nested elevation. You should see
echo - TWO uac prompts WITH their respective elevated prints
echo - ONE non-elevated print.
pause
%ELEVATOREXE% %ELEVATOREXE% %ELEVATIONTEST%
%ELEVATOREXE% %ELEVATOREXE% %ELEVATOREXE% %ELEVATOREXE% %ELEVATOREXE% %ELEVATIONTEST%
%ELEVATIONTEST%
pause
cls
echo Testing cache for current process. You should see
echo - ONE non-elevated print
echo - ONE uac prompt
echo - THREE elevated prints
echo - ONE non-elevated print
echo - ONE uac prompt
echo - ONE elevated prints
echo - TWO non-elevated print
pause
%ELEVATOREXE% -k
%ELEVATIONTEST%
%ELEVATOREXE% cache on
%ELEVATOREXE% %ELEVATIONTEST%
%ELEVATOREXE% %ELEVATIONTEST%
%ELEVATOREXE% %ELEVATIONTEST%
%ELEVATIONTEST%
%ELEVATOREXE% cache off
%ELEVATOREXE% cache on
%ELEVATOREXE% %ELEVATIONTEST%
%ELEVATIONTEST%
%ELEVATOREXE% -k
%ELEVATIONTEST%
pause
cls
echo Testing cache for other processes. This will test that cache cannot be shared between process,
echo but that killing cache does affect ALL cache instances. You should see
echo - ONE non-elevated print
echo - ONE uac prompt
echo - ONE elevated print
echo FIRST EXTERNAL COMMAND EXECUTION, with ONE uac
echo - NO uac prompt
echo SECOND EXTERNAL COMMAND EXECUTION, without uac
echo - ONE uac prompt
echo - ONE elevated print
pause
%ELEVATOREXE% -k
%ELEVATIONTEST%
%ELEVATOREXE% cache on
%ELEVATOREXE% %ELEVATIONTEST%
echo Now run the command below on a separate prompt. You should see a UAC prompt
echo %ELEVATOREXE% %ELEVATIONTEST%
echo After pressing enter here, you should see NO UAC prompt
pause
%ELEVATOREXE% %ELEVATIONTEST%
echo Now run the commands below on a separate prompt.
echo %ELEVATOREXE% -k
echo After pressing enter here, you should see ONE UAC prompt
pause
%ELEVATOREXE% %ELEVATIONTEST%
%ELEVATOREXE% -k
%ELEVATIONTEST%
pause
cls
echo The tests have concluded.
pause
:end