cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Komorebi
Level 2

System Search Registry with MsiGetProperty

Hi,

I defined a System Search in my project like this:

Registry Root: HKEY_LOCAL_MACHINE

Registry Key: SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full

Registry Value: InstallPath

Search the 64-Bit Portion of the Registry: Checked

In script:

function GetWindowsInstallerProperty(PropertyName, /* output */ VariableName)

NUMBER Size;
STRING PropertyValue;

begin
   Size = 3000;
   MsiGetProperty(ISMSI_HANDLE, PropertyName, PropertyValue, Size);
   VariableName = PropertyValue;
end; 

 

Although the registry key exists (for both 32bit and 64bit) I'm getting nothing as value back.

This is a project I inherited from someone at the company, so I don't even know if MsiGetProperty is the correct way of doing it.

I logged everything and PropertyName is coming in the function properly as "DOTNET_FRAMEWORK_PATH".

 

Tried a few things but nothing makes it work (Run installer as administrator, run it on a Server, ...)


Thx, Lieven Cardoen

 

Labels (1)
0 Kudos
(2) Replies
Komorebi
Level 2

When executing the installer with debugging I'm able to see following things:

AppSearch: Property: DOTNET_FRAMEWORK_PATH, Signature: NewSignature11
MSI (c) (F0:C0) [15:28:56:462]: Note: 1: 2262 2: Signature 3: -2147287038
MSI (c) (F0:C0) [15:28:56:462]: PROPERTY CHANGE: Adding DOTNET_FRAMEWORK_PATH property. Its value is 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\'.

...

20) [15:29:38:573]: PROPERTY CHANGE: Adding DOTNET_FRAMEWORK_PATH property. Its value is 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\'.

...

Property(S): DOTNET_FRAMEWORK_PATH = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\


So I guess the value is found in the registry but MsiGetProperty does not return the value...

 

Thx, Lieven C.

 

0 Kudos
MarkusLatz
Level 8

Do you see the call to your script function "GetWindowsInstallerProperty" in the msi log file ?

regards

Markus

0 Kudos