I created a setup to check the product name and the CurrentMajorVersionNumber of Windows Server 2019 Datacenter in Inno Setup.
But for any reason I can not get any logs in the Inno Setup file.
I checked the registry location for Server 2019 which is
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion.
The ProductName in the registry is REG_SZ.
The CurrentMajorVersionNumber in the registry is REG_DWORD.
function InitializeSetup(): Boolean;
var
ProductName: string;
CurrentMajorVersionNumber: string;
begin
if RegQueryStringValue(
HKEY_LOCAL_MACHINE, '\SOFTWARE\Microsoft\Windows NT\CurrentVersion',
'ProductName', ProductName) then
begin
Log(' > ProductName:' + ProductName)
end;
if RegQueryStringValue(
HKEY_LOCAL_MACHINE, '\SOFTWARE\Microsoft\Windows NT\CurrentVersion',
'CurrentMajorVersionNumber', CurrentMajorVersionNumber) then
begin
Log(' > CurrentMajorVersionNumber:' + CurrentMajorVersionNumber)
end;
end;
When the above code is ran there is no log available. Reading other post on this platform regarding this topic could not help me. Is there any fix?