0

Goal: Change Default search engine, Homepage and url searchbar in major browsers FF, MSIE (version6+), Chrome, Safari, opera.

Conditions: I want to create a setup program through NSIS installer, which would change the settings. I am not looking for any javascript solution, or browser add solution.

ALL helps appreciated.

raj
  • 19
  • 5
  • 1
    This not the right place for questions like this. SO is a Q&A site concerning specific programming questions on code. It is not a code shop. Do the research yourself, come back with a specific problem on a piece of code. – Seki Jul 25 '13 at 17:04
  • 1
    This just sounds like something evil/spyware would do, to stop people doing this kind of stuff Opera is now using a checksum on the config file that contains the default stuff... – Anders Jul 26 '13 at 02:47
  • @andres what ever is inside a person mind, he only finds those things. What is evil if a user installs any software and he knows what the software is meant to do. I am not the first to ask any such question, you may find big companies have already created such softwares, when they do it is for world peace and when any body like me want to do it people like you tag it as evil. Rethink about it. – raj Jul 26 '13 at 04:05

1 Answers1

0

I already have answered a similar question earlier on this forum, so please do a little search before posting questions. Well following is the summary for IE, FF and chrome which I implemented in my installer. Hope this helps.

For IE:

You just need to edit the registry

HKEY_CURRENT_USER "Software\Microsoft\Internet Explorer\Main" "Start Page" 
HKEY_CURRENT_USER "Software\Microsoft\Internet Explorer\Main" "Default_Search_URL"
HKEY_CURRENT_USER "Software\Microsoft\Internet Explorer\Main" "Default_Page_URL" "http://abc.com/"
HKEY_CURRENT_USER "Software\Microsoft\Internet Explorer\SearchScopes\YourSearchEngineName" "DisplayName" "YourSearchEngineName"
HKEY_CURRENT_USER "Software\Microsoft\Internet Explorer\SearchScopes\YourSearchEngineName" "URL" "YourSearchEngineUrl"
HKEY_CURRENT_USER "Software\Microsoft\Internet Explorer\SearchScopes" "DefaultScope" "YourSearchEngineName" 

For chrome:

Find this file:

"$LOCALAPPDATA\Google\Chrome\User Data\Default\Preferences"

Use nsJson plugin to edit its "homepage" attribute.

For changing the url search bar (default search) , you need to find some way to edit the sqlite database:

"$LOCALAPPDATA\Google\Chrome\User Data\Default\Web Data

In this there is a keywords table where you have to add your search engine. And then update it in the meta table of same databse.

For Firefox:

Find this file:

 $APPDATA\Mozilla\Profiles\default_profile\prefs.js

Its a javascript file, you can edit its attributes to change the home page and default search.

foobar
  • 2,887
  • 2
  • 30
  • 55
  • thanks smilepleeeaz. Can you also tell how to do it for opera and safari. Where i am actually facing the issue is scripting the nsis. Can you please share the code. I do not know if it right to ask for source here on S.O. – raj Jul 26 '13 at 14:36
  • Actually it is more complicated - e.g. Chrome Preferences are saved in JSON format so they can be edited easily but Firefox has custom format so you need to create parser for it first. It is a huge amount of code I am not sure somebody has out of the box solution for you. – Slappy Jul 28 '13 at 07:04
  • Hi, I added row id of required search engine(say 14) from keywords table to meta table of chrome with key value : "Default Search Provider ID" -> 14. But still the search engine is not setting as default – cosmoloc Jun 29 '15 at 13:42