Install in XP compatibility mode
So I've been charged with the task of creating a (completely) silent installer for Oracle 6i Client (and patch) for Windows Vista machines. The Oracle guys have created the appropriate RSP files and wrote a batch file for the install. However, you still have to set Compatibility = Windows XP (Service Pack2) on the .BAT file, the Orainst.exe and Setup.exe. For all the Googling I've done, I can't find a way to do this automatically. I would like to turn this into a VBScript to be pushed from an SCCM box. Any thoughts?
Thanks in advance,
Chris
P.S. - More details may be needed for an answer, so let me know what I've left out.
Thanks in advance,
Chris
P.S. - More details may be needed for an answer, so let me know what I've left out.
0 Comments
[ + ] Show comments
Answers (5)
Please log in to answer
Posted by:
mrminer
14 years ago
Posted by:
robtk
14 years ago
You could try my shim script [:)]. Modify it to suit. I used this version of the script to install Congos 7.3 on Windows 7. It works perfectly.
'==========================================================================
' NAME: win7shim.vbs
' AUTHOR: Robtk
' DATE : 5/27/2010
' COMMENT: Sets the application compatibility registry keys for an executable.
' NOTE: This script and the executable it runs should be in the same directory.
'==========================================================================
'On Error Resume Next
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
strFile = "issetup.exe"
'Get folder path of this vbScript
Set fso = CreateObject("Scripting.FileSystemObject")
strFolder = fso.GetParentFolderName(WScript.ScriptFullName)
strPath = strFolder & "\" & strFile
' Set the current directory
Set Shell = CreateObject("WScript.Shell")
Shell.CurrentDirectory = strFolder
' Write the Windows 7 shim registry keys
strValue = "WINXPSP2 RUNASADMIN"
Shell.Run "REG.EXE ADD ""HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers""" & _
" /v " & Chr(34) & strPath & Chr(34) & " /t REG_SZ /d " & chr(34) & strValue & Chr(34) & " /f", 0, 1
Shell.Run "REG.EXE ADD ""HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers""" & _
" /v " & Chr(34) & strPath & Chr(34) & " /t REG_SZ /d " & chr(34) & strValue & Chr(34) & " /f", 0, 1
' Install Cognos 7.3
Set WshShell = WScript.CreateObject("WScript.Shell")
' Install the program. NOTE: issetup.exe exits immediately so we setup the loop below.
WshShell.Run (strFile & " -s response.ats")
' Setup loop to wait until install is finished.
Set oWmi = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
term = False
Do Until term = True
Set colProcessList = oWmi.ExecQuery("Select * from Win32_Process Where Name = '" & strFile & "'")
If colProcessList.Count = 0 Then
term = True
End If
WScript.sleep 4000
Loop
' Delete the registry key values created above since we don't need them anymore.
Set objRegistry=GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"
strValueName = strPath
objRegistry.DeleteValue HKEY_CURRENT_USER, strKeyPath, strValueName
objRegistry.DeleteValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName
Set objRegistry = Nothing
' Import the configuration
WshShell.Run "C:\Progra~1\Cognos\cer4\bin\configcp.exe -t Config2.ccp",, True
WScript.Quit(0)
'==========================================================================
' NAME: win7shim.vbs
' AUTHOR: Robtk
' DATE : 5/27/2010
' COMMENT: Sets the application compatibility registry keys for an executable.
' NOTE: This script and the executable it runs should be in the same directory.
'==========================================================================
'On Error Resume Next
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
strFile = "issetup.exe"
'Get folder path of this vbScript
Set fso = CreateObject("Scripting.FileSystemObject")
strFolder = fso.GetParentFolderName(WScript.ScriptFullName)
strPath = strFolder & "\" & strFile
' Set the current directory
Set Shell = CreateObject("WScript.Shell")
Shell.CurrentDirectory = strFolder
' Write the Windows 7 shim registry keys
strValue = "WINXPSP2 RUNASADMIN"
Shell.Run "REG.EXE ADD ""HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers""" & _
" /v " & Chr(34) & strPath & Chr(34) & " /t REG_SZ /d " & chr(34) & strValue & Chr(34) & " /f", 0, 1
Shell.Run "REG.EXE ADD ""HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers""" & _
" /v " & Chr(34) & strPath & Chr(34) & " /t REG_SZ /d " & chr(34) & strValue & Chr(34) & " /f", 0, 1
' Install Cognos 7.3
Set WshShell = WScript.CreateObject("WScript.Shell")
' Install the program. NOTE: issetup.exe exits immediately so we setup the loop below.
WshShell.Run (strFile & " -s response.ats")
' Setup loop to wait until install is finished.
Set oWmi = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
term = False
Do Until term = True
Set colProcessList = oWmi.ExecQuery("Select * from Win32_Process Where Name = '" & strFile & "'")
If colProcessList.Count = 0 Then
term = True
End If
WScript.sleep 4000
Loop
' Delete the registry key values created above since we don't need them anymore.
Set objRegistry=GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"
strValueName = strPath
objRegistry.DeleteValue HKEY_CURRENT_USER, strKeyPath, strValueName
objRegistry.DeleteValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName
Set objRegistry = Nothing
' Import the configuration
WshShell.Run "C:\Progra~1\Cognos\cer4\bin\configcp.exe -t Config2.ccp",, True
WScript.Quit(0)
Posted by:
Jsaylor
14 years ago
Compatibility mode is set as a flag in the registry for each executable. I'm sure you could google it up, but I find the best way to investigate things like this is to pick up a registry snapshot tool (I use regshot, there are about a million others that will work fine though.)
Just start your snapshot tool and take the initial snapshot, change your programs to whatever specific compatibility mode you're looking for, then take the second snapshot and compare. This technique works wonderfully for a lot of under-the-hood windows stuff that you may want to automate when there's no obvious way to do it.
Just start your snapshot tool and take the initial snapshot, change your programs to whatever specific compatibility mode you're looking for, then take the second snapshot and compare. This technique works wonderfully for a lot of under-the-hood windows stuff that you may want to automate when there's no obvious way to do it.
Posted by:
mrminer
14 years ago
Posted by:
orlith
12 years ago
HI
Thks for this tips and script
By the way I'm not able to delete the registry value I set. It seems that if the vakuekey got space in the name you're not able to remove it.
What ever I tried, playing with quote and double quote and Chhr(34)..... I always got a swbemobjectex type mismatch....
I'm so not able to delete this key "C:\Cognos Powerplay 7.4\Cognos\ppu\issetup.exe"
Any hepl appreciate... otherwise I'll let those key exist , which is not a crtical action :)
Thx
Thks for this tips and script
By the way I'm not able to delete the registry value I set. It seems that if the vakuekey got space in the name you're not able to remove it.
What ever I tried, playing with quote and double quote and Chhr(34)..... I always got a swbemobjectex type mismatch....
I'm so not able to delete this key "C:\Cognos Powerplay 7.4\Cognos\ppu\issetup.exe"
Any hepl appreciate... otherwise I'll let those key exist , which is not a crtical action :)
Thx
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.