to check if .net frame work 2.0 mmc 3.0 and Windows remote Mgmt
Hi
.net 2.0 or greater
mmc 3.0
Windows remote Mgmt
These three are going to be the prereq of my application i need to check if these 3 applications were installed or not on workstations.If these are installed then my app will run with out any issues if not installed then i need to install them first and run my application .i've exe for these 3 apps.i'm n't sure how to go with the logic using vb script.
Thanks in advance
.net 2.0 or greater
mmc 3.0
Windows remote Mgmt
These three are going to be the prereq of my application i need to check if these 3 applications were installed or not on workstations.If these are installed then my app will run with out any issues if not installed then i need to install them first and run my application .i've exe for these 3 apps.i'm n't sure how to go with the logic using vb script.
Thanks in advance
0 Comments
[ + ] Show comments
Answers (10)
Please log in to answer
Posted by:
anonymous_9363
14 years ago
There are some choices to make. Do you want to simply check for a file's existence of its version? Or maybe the installation registry data (HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductCode])? Or other registry data? A combination of some/all of those?
At the end of the day, there are many scripts around which will check a file's existence. File version retrieval is trickier, especially in VBScript but it can be done - check out JSware's file operation scripts. Additionally, there are scripts which can retrieve registry data. JSWare has a very good class file for registry acces which, if you're a serious scripter, will quickly become part of your toolkit.
At the end of the day, there are many scripts around which will check a file's existence. File version retrieval is trickier, especially in VBScript but it can be done - check out JSware's file operation scripts. Additionally, there are scripts which can retrieve registry data. JSWare has a very good class file for registry acces which, if you're a serious scripter, will quickly become part of your toolkit.
Posted by:
murali.bhat
14 years ago
See if this helps.
Set objShell = CreateObject("Wscript.shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strComputer ="."
'Check for .NetFramework 2 or higher
Const HKEY_LOCAL_MACHINE = &H80000002
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strValue = ""
on error resume next
strValue = objShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5\Version")
on error goto 0
If strValue = "" then
on error resume next
strValue = objShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Version")
on error goto 0
If strValue = "" then
on error resume next
strValue = objShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727\Version")
on error goto 0
End If
End If
If strValue = "" then
msgbox "No .Net Framework!"
Else
msgbox ".Net Framework version : " & strValue
End If
msgbox "MMC version : " & objFSO.GetFileVersion("c:\windows\system32\mmc.exe")
Set objShell = Nothing
Set objFSO = Nothing
Posted by:
harshakola
14 years ago
Posted by:
murali.bhat
14 years ago
Assign the strValue to a Property and use this Property in the Launch Condiction of the msi.
Session.Property("NETFRAMEWORKS") = strValue
Session.Property("MMCVERSION") = objFSO.GetFileVersion("c:\windows\system32\mmc.exe")
In the Launch condition, use the below command :
NETFRAMEWORKS <= "2" followed by the message.
MMCVERSION <= "3" followed by the message.
Session.Property("NETFRAMEWORKS") = strValue
Session.Property("MMCVERSION") = objFSO.GetFileVersion("c:\windows\system32\mmc.exe")
In the Launch condition, use the below command :
NETFRAMEWORKS <= "2" followed by the message.
MMCVERSION <= "3" followed by the message.
Posted by:
anonymous_9363
14 years ago
let me know how to do this.Installing an application involves executing a program. Again, instead of expecting others to do your work for nothing, do some work for yourself and find a script that does that. If you find yourself having trouble integrating what you have, then come back and ask questions.
Posted by:
harshakola
14 years ago
Hi Murali,
I'm bit confused with what you are saying.can you explain clearly.from my understanding i feel like i need to do declare a property in the property table as NETFRAMEWORK=strvalue and how abt windows remote managment .is taht going to be the same as mmc version. please make your time and explain in detail.Thanks for your responses.
I'm bit confused with what you are saying.can you explain clearly.from my understanding i feel like i need to do declare a property in the property table as NETFRAMEWORK=strvalue and how abt windows remote managment .is taht going to be the same as mmc version. please make your time and explain in detail.Thanks for your responses.
Posted by:
murali.bhat
14 years ago
Posted by:
harshakola
14 years ago
hi Murali
i've assigned values 0 the above mentioned properties. But i'm not clear abt this script
Assign the strValue to a Property and use this Property in the Launch Condiction of the msi.
Session.Property("NETFRAMEWORKS") = strValue
Session.Property("MMCVERSION") = objFSO.GetFileVersion("c:\windows\system32\mmc.exe")
In the Launch condition, use the below command :
NETFRAMEWORKS <= "2" followed by the message.
MMCVERSION <= "3" followed by the message.
can u explain how to work from here.
i mean where to use exactly the following script.How to use them in launch condition tables.I've an exe files with me.which needs to install if we don't have higher versions of these applications.
Thanks for your time murali rally appreciate your help.
i've assigned values 0 the above mentioned properties. But i'm not clear abt this script
Assign the strValue to a Property and use this Property in the Launch Condiction of the msi.
Session.Property("NETFRAMEWORKS") = strValue
Session.Property("MMCVERSION") = objFSO.GetFileVersion("c:\windows\system32\mmc.exe")
In the Launch condition, use the below command :
NETFRAMEWORKS <= "2" followed by the message.
MMCVERSION <= "3" followed by the message.
can u explain how to work from here.
i mean where to use exactly the following script.How to use them in launch condition tables.I've an exe files with me.which needs to install if we don't have higher versions of these applications.
Thanks for your time murali rally appreciate your help.
Posted by:
murali.bhat
14 years ago
Posted by:
anonymous_9363
14 years ago
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.