Getversion issue with Windows 95/98 ?
Hi all,
I made a piece of code which determines the OS of a computer, and also whether Windows Installer has been installed or not. Following to this, the program also checks the version of Windows Installer. If it is 2.0 or higher, the program does nothing. If not, it starts an executable.
The program works fine on WinXP, but when I try to run my program on Windows 95, it crashes when trying to determine the version of Windows Installer.
[my code]
Form1.Show
opsys = fOSName
'
If opsys = "Windows XP" Or opsys = "Windows 2000" Or opsys = "Windows 2000 NT" Then
MsgBox "Windows Installer 2.0 of higher installed..."
Exit Sub
End If
'
''''''''FIRST CHECK WINDOWS DIRECTORY FOR FASTER HANDLING''''''''''''''''''''''''
If Dir("C:\WINDOWS\System32\msiexec.exe") <> "" Then
version = Left(GetVersion("C:\WINDOWS\System32\msiexec.exe") , 1)
If version >= 2 Then
MsgBox "Windows Installer 2.0 or higher installed"
Exit Sub
Else
GoTo install
End If
Else
Path = fSearchFile("msiexec.exe", "C:")
'
If Path <> "" Then
version = Left(GetVersion(Path), 1)
MsgBox "Version: " & version
If version >= 2 Then MsgBox "Windows Installer 2.0 or higher installed"
Else
GoTo install
End If
End If
'
install:
If opsys = "Windows 95" Or opsys = "Windows 98" Or opsys = "Windows ME" Then
Shell "D:\WinInst for 95,98,ME.exe"
Else
Shell "D:\WinInst for NT 4.0 , 2000.exe"
End If
'
[end code]
Does anyone have an idea on why my code might not work (yes, I have all the API call properly coded in another module) on Win95 or Win98?
It seems to be only the checking of the fileversion which causes the culprit.
Any help will be much appreciated...
Max
|