mirror of
https://github.com/reactos/ahk_tests.git
synced 2025-02-21 12:20:38 +00:00
[AHK_Helper_Functions]
Add nGetRevisionNumber() function to get revision number. svn path=/trunk/ahk_tests/; revision=2023
This commit is contained in:
parent
762433947f
commit
4e7d2c77bc
@ -28,6 +28,37 @@ SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
|
||||
DetectHiddenText, Off ; Hidden text is not detected
|
||||
|
||||
|
||||
nGetRevisionNumber()
|
||||
{
|
||||
; usage:
|
||||
; nRevision := nGetRevisionNumber()
|
||||
; Note: we can't use TestsFailed() here since Windows doesn't really have revision
|
||||
result := 0
|
||||
szApp = %A_WorkingDir%\Apps\Cap.exe ; Utility by Mysoft (Grégori Macário Harbs)
|
||||
|
||||
IfNotExist, %szApp%
|
||||
TestsInfo("nGetRevisionNumber(): Can NOT find '" szApp "'.")
|
||||
else
|
||||
{
|
||||
Run, %szApp% /silent /reg Software\ReactOS
|
||||
SplitPath, szApp, ProcessName
|
||||
Process, WaitClose, %ProcessName%, 4
|
||||
if ErrorLevel
|
||||
{
|
||||
bTerminateProcess(ProcessName)
|
||||
TestsInfo("nGetRevisionNumber(): Process '" ProcessName "' failed to close.")
|
||||
}
|
||||
else
|
||||
{
|
||||
RegRead, result, HKEY_CURRENT_USER, Software\ReactOS, Revision
|
||||
if ErrorLevel
|
||||
TestsInfo("nGetRevisionNumber(): Unable to read HKCU\Software\ReactOS, Revision.")
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
bTerminateProcess(szProcess)
|
||||
{
|
||||
global TestsTotal
|
||||
|
Loading…
x
Reference in New Issue
Block a user