This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- installer registry access in windows server 2012
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jan 18, 2013
12:37 AM
installer registry access in windows server 2012
I have a custom action in an Installshield Basic MSI project to find out the version of SQL Server from registry.
The installer works fine on a Windows 7 machine. The above script works fine in isolation on a Windows Server 2012 machine. However when I run the installer (as ADMIN) on windows server 2012, it does not work as expected and the error description is - It cannot find the registry key.
Any ideas.
RegKey2012 = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\" & _
"Microsoft SQL Server\MSSQL11.MSSQLSERVER\"
If RegKeyExists(RegKey2012) Then
WScript.StdOut.Write("2012")
Else
WScript.StdOut.Write("2008R2")
End If
Function RegKeyExists(Key)
Dim oShell, entry
On Error Resume Next
Set oShell = CreateObject("WScript.Shell")
entry = oShell.RegRead(Key)
If Err.Number <> 0 Then
Err.Clear
RegKeyExists = False
Else
Err.Clear
RegKeyExists = True
End If
End Function
The installer works fine on a Windows 7 machine. The above script works fine in isolation on a Windows Server 2012 machine. However when I run the installer (as ADMIN) on windows server 2012, it does not work as expected and the error description is - It cannot find the registry key.
Any ideas.
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Feb 07, 2013
01:01 AM
srout2000 wrote:
I have a custom action in an Installshield Basic MSI project to find out the version of SQL Server from registry.RegKey2012 = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\" & _
"Microsoft SQL Server\MSSQL11.MSSQLSERVER\"
If RegKeyExists(RegKey2012) Then
WScript.StdOut.Write("2012")
Else
WScript.StdOut.Write("2008R2")
End If
Function RegKeyExists(Key)
Dim oShell, entry
On Error Resume Next
Set oShell = CreateObject("WScript.Shell")
entry = oShell.RegRead(Key)
If Err.Number <> 0 Then
Err.Clear
RegKeyExists = False
Else
Err.Clear
RegKeyExists = True
End If
End Function
The installer works fine on a Windows 7 machine. The above script works fine in isolation on a Windows Server 2012 machine. However when I run the installer (as ADMIN) on windows server 2012, it does not work as expected and the error description is - It cannot find the registry key.
Any ideas.
Why don't you try System Search option to detect the registry entry?
