Detecting Minimum Requirment
Previous Top Next

'THINSTALL_RUNTIME_SCRIPT
'This script detects minimum system requirements before you application runs
'This script will also be executed before the installer is invoked

Function check_for_IE5
'Check the version of shdocvw.dll in c:\windows\system32
shdocvw_location = ExpandPath("%SystemSystem%") + "\shdocvw.dll"

'Get the field "FileVersion" from the DLL
file_version = GetFileVersionValue(shdocvw_location, "FileVersion")
need_download = 1

if file_version <> "" then
d=InStr(file_version, ".")
major_high = Mid(file_version, 1, d-1)
if major_high >= 5 then
need_download = 0
end if
else
'If the user does not have shdocvw installed at all
'then we can't open IE and send them to the download page!
MsgBox("This program requires Internet Explorer 5.0 or higher be installed")
ExitProcess 0
end if

if need_download then
mres = MsgBox("This program requires Internet Explorer 5.0 or higher be installed" + Chr(13) + "Click OK to go to the download page for Internet Explorer" + Chr(13) + "Click Cancel to Abort", vbOKCancel, "Internet Explorer Upgrade Required")
if mres = vbOK then
set objShell = CreateObject("Shell.Application")
objShell.ShellExecute("http://www.google.com/search?hl=en&q=internet+explorer+download&btnI=I'm+Feeling+Lucky")
end if
ExitProcess 0
end if
end function


Function check_for_dotnet
set wshShell = CreateObject("Wscript.shell")
On Error Resume Next
key = wshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\InstallRoot")
If Err.Number <> 0 Then
mres = MsgBox("This program requires the .NET Framework installed" + Chr(13) + "Click OK to go to the download page" + Chr(13) + "Click Cancel to Abort", vbOKCancel, ".NET Framework install required")
if mres = vbOK then
set objShell = CreateObject("Shell.Application")
objShell.ShellExecute("http://www.google.com/search?hl=en&q=.net+framework+download&btnI=I'm+Feeling+Lucky")
end if
end if
end function

Function OnRequirementsCheck
check_for_IE5
check_for_dotnet
end function