How to detect if Opera is installed ? (and get the Opera folder location)
I have searched the 'Opera community forum' and Google for last 60 minutes, but can't find any answer. :mad:
Can anyone please tell me if there is any way to programetically detect wheather Opera is installed in my client's PC or not ?
Also, Is there any way to detect Opera installation folder ?
Thanks in advance. :thumb:
Re: How to detect if Opera is installed ? (and get the Opera folder location)
if using VB 6, then try using SearchTreeForFile API. it will give you the path of the file.
since i dont have Opera installed, i tried for FireFox and it worked.
VB Code:
Private Declare Function SearchTreeForFile Lib "imagehlp" (ByVal RootPath As String, ByVal InputPathName As String, ByVal OutputPathBuffer As String) As Long
Private Sub Form_Load()
Dim tmpStr As String, myResult As Long
tmpStr = String(260, 0)
myResult = SearchTreeForFile("c:\", "filename with extension", tmpStr)
If myResult <> 0 Then
MsgBox "Location : " + Left(tmpStr, InStr(1, tmpStr, Chr(0)) - 1)
Else
MsgBox "File not found!"
End If
End Sub
Harsh
Re: How to detect if Opera is installed ? (and get the Opera folder location)
Thanks Harsh. :thumb:
I posted same question in Opera community and received a reply.
If anyone knows ANY other information on this topic, please please help me.
Thanks !
Re: How to detect if Opera is installed ? (and get the Opera folder location)
Just remember, users like myself have Windows installed on a different drive other than C. My opera install is located in E:\Program Files\Opera\
Having said that, I also wouldn't rely on the filename as I can rename Opera.exe to IHateInternetExplorerThisMightBeOpera.exe. Opera would still work but your function would not.
I would see if the opera develoeprs could shed any light on this
Re: How to detect if Opera is installed ? (and get the Opera folder location)
yes, we all forgot about the registry thingy. you could take a look at RegOpenKeyEx API or RegOpenKey.
sorry, could not help much on this. i have never used these APIs before.
this will still work even if ppl change the name of the exe.
Harsh
EDIT: remember to use RegCloseKeyEx to close the open registry value.
Re: How to detect if Opera is installed ? (and get the Opera folder location)
Thanks. I know 'bout those registry APIs. :)
I was looking for those exact Keys.
..anyway now it is time to fireup VM and test with all versions of Opera I have. :D
Re: How to detect if Opera is installed ? (and get the Opera folder location)
sorry, my post was not complete.
you can check for the installed components, Reg Key:
Code:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\uninstall\Opera (or whatever)
see if it helps you!!
Harsh
Re: How to detect if Opera is installed ? (and get the Opera folder location)
Thanks. :thumb:
The problem with Opera (and Firefox) is, it doesn't need to be installed everytime you format/reinstall Windows.
If you backup your profiles and program files, Opera will work anywhere without any problem if required system dlls are present.
Again, different versions of Opera can stay side-by-side without any problem.
I guess,I'll first try to get the keys mentioned by haavard and Rijk in my thread at Opera Communiny forum.
If the keys are not present,I'll use the uninstaller information.
If nothing is found then I'll use your SearchTreeForFile method with GetFileVersionInfo and VerQueryValue to check company information and fileversion.
Re: How to detect if Opera is installed ? (and get the Opera folder location)
Quote:
Originally Posted by iPrank
...The problem with Opera (and Firefox) is, it doesn't need to be installed everytime you format/reinstall Windows.
If you backup your profiles and program files, Opera will work anywhere without any problem if required system dlls are present....
could you shed some light on this.
you mean that if i just copy-paste the FireFox folder from Program files location to somewhere else (in the back-up drive), then also i can expect the browser to work??
Re: How to detect if Opera is installed ? (and get the Opera folder location)
Not sure about Firefox.
But for Opera (in singleuser mode) it is true.
In multiuser mode a simple backup of profile folder and some settings chande in Opera.ini will work.
In fact, I use a single copy of Opera in every OS in my multiboot system. Saves time - but insecure.
Re: How to detect if Opera is installed ? (and get the Opera folder location)
hmm, wierdo!! will never try such stuff.
thank you