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
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
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.
Answered 08/12/2010 by: VBScab
Red Belt

Please log in to comment
0
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
Answered 08/12/2010 by: murali.bhat
Purple Belt

Please log in to comment
0
i will try to run this script and will let u know.but if these 3 app weren't installed then i need to install this .let me know how to do this.
thanks
Answered 08/12/2010 by: harshakola
Orange Belt

Please log in to comment
0
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.
Answered 08/12/2010 by: murali.bhat
Purple Belt

Please log in to comment
0
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.
Answered 08/13/2010 by: VBScab
Red Belt

Please log in to comment
0
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.
Answered 08/13/2010 by: harshakola
Orange Belt

Please log in to comment
0
Yes, you need to declare the property NETFRAMEWORK, MMCVERSION, WINREM in Property table. Set the default values as "0". Let the vbscript change the default values.
I am not sure about the remote management. If you have a file, you can check its version just like mmc version.
Answered 08/16/2010 by: murali.bhat
Purple Belt

Please log in to comment
0
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.
Answered 08/16/2010 by: harshakola
Orange Belt

Please log in to comment
0
Copy the entire script to the vb custom action and make the custom action to run before the launch condition. Set the condition as "NOT Installed"
Answered 08/16/2010 by: murali.bhat
Purple Belt

Please log in to comment
0
I had assumed that your question was purely based on script but now it turns out that the script will be running as part of an MSI installation.

Why complicate things with script? You should be using the AppSearch and LaunchCondition actions and their associated tables.
Answered 08/17/2010 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity