I had written this script to check the presence of MS Office 2003 and Word 2007 on a machine before proceeding for installation. Here is the code:
officepath11= sProgramFilesDir & "\Microsoft Office\Office11\"
officepath12= sProgramFilesDir & "\Microsoft Office\Office12\"
'set File System Object
set fso=createobject("scripting.filesystemobject")
'Check if file exists for Office 2003 and if yes then its version
path11 = fso.GetAbsolutePathName("C:\Program Files (x86)\Microsoft Office\Office11\winword.exe")
if (fso.FileExists(path11)) then
returnstring11=fso.getfileversion(officepath11 & "winword.exe")
else
returnstring11="Null"
end if
'Check if file exists for Word 2007 and if yes then its version
path12 = fso.GetAbsolutePathName("C:\Program Files (x86)\Microsoft Office\Office12\winword.exe")
if (fso.FileExists(path12)) then
returnstring12=fso.getfileversion(officepath12 & "winword.exe")
else
returnstring12="Null"
end if
arr11=split(returnstring11,".")
arr12=split(returnstring12,".")
if (arr11(0)="11" AND arr12(0)="12") then
'msgbox "Office 2003 and word 2007 both are installed, continue with script below"
else
if (arr11(0)="11" AND arr12(0)="Null") then
msgbox "Please install Word 2007 before installing this application"
WScript.Quit
else
if (arr11(0)="Null" AND arr12(0)="12") then
msgbox "Please install Office 2003 before installing this application"
WScript.Quit
else
if (arr11(0)="Null" AND arr12(0)="Null") then
msgbox "Please install Office 2003 and Word 2007 before installing this application"
WScript.Quit
end if
end if
end if
end if
set fso=nothing
This Blog is for all people working or related to the MSI and App-V. There are lots of issues we face in everyday work regarding the technology. The sole purpose of my blog is to help others with whatever I learn. All you people out there, please help by commenting, voting, propagating and sharing my blog with your friends and colleagues but with due credit and acknowledgement to the material posted here with my name and blog url as I still do hold the copyright of the posts here.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment